diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 86b77f8c6b..120db09a19 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -47,6 +47,8 @@ /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/aggregate-error/ @BendingBender +/types/agora-rtc-sdk/ @menthays +/types/ajv-errors/ @afshawnlotfi /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci /types/alexa-voice-service/ @dolanmiu @@ -64,11 +66,12 @@ /types/amplify-deferred/ @joeriks @laurentiustamate94 /types/amplitude-js/ @Asido /types/amqp/ @seikho @jonnysparkplugs +/types/amqp-connection-manager/ @rogierschouten /types/amqp-rpc/ @wokim /types/amqplib/ @mnahkies @abreits @nfantone @zelein /types/analytics-node/ @fongandrew @thomasthiebaud /types/anchor-js/ @xt0rted -/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu +/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu @scipper /types/angular-agility/ @rolandzwaga /types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf /types/angular-block-ui/ @lassebn @sclassen @@ -146,6 +149,7 @@ /types/ansi-regex/ @mvachhar /types/ansi-styles/ @brynbellomy @plylrnsdy /types/ansicolors/ @rogierschouten +/types/antlr4/ @mcchatman8009 /types/any-db/ @rogierschouten /types/any-db-transaction/ @rogierschouten /types/anybar/ @khoomeister @@ -155,7 +159,8 @@ /types/api-error-handler/ @tkrotoff /types/apicache/ @danielsogl /types/apigee-access/ @CasperSkydt -/types/apollo-codegen/ @bradleyayers +/types/apollo-codegen/ @bradleyayers @kostspielig +/types/apollo-upload-client/ @Slessi /types/app-root-dir/ @chenyang-biu /types/app-root-path/ @shantmarouti /types/appdmg/ @unindented @@ -174,7 +179,7 @@ /types/archy/ @vvakame /types/are-we-there-yet/ @brianloveswords /types/argon2-browser/ @ivangabriele -/types/argparse/ @arcticwaters @tlaziuk +/types/argparse/ @arcticwaters @tlaziuk @eps1lon /types/args/ @Slessi /types/argv/ @hookclaw /types/arr-union/ @mrmlnc @@ -185,6 +190,7 @@ /types/arrify/ @wanganjun /types/artillery/ @kmccoan-allocadia /types/asana/ @tkqubo +/types/asap/ @fpascutti /types/ascii2mathml/ @RagibHasin /types/asenv/ @remisery /types/asn1js/ @microshine @@ -205,6 +211,7 @@ /types/atlaskit__inline-edit/ @lstanden /types/atlaskit__layer/ @lstanden /types/atlaskit__single-select/ @lstanden +/types/atlassian-crowd-client/ @mtgto /types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atob/ @johngeorgewright /types/atom/ @GlenCFL @smhxx @lierdakil @@ -227,10 +234,12 @@ /types/autosuggest-highlight/ @senukartur /types/awesomplete/ @webbiesdk @bmdixon @tbekolay @chrislopresto /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites +/types/axe-webdriverjs/ @JoshuaKGoldberg /types/axel/ @ruslan-molodyko +/types/axios-token-interceptor/ @innovation-team /types/axon/ @jewbre /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT /types/azure-mobile-services-client/ @dmorosinotto @@ -242,7 +251,7 @@ /types/babel-plugin-react-pug/ @jpap /types/babel-plugin-syntax-jsx/ @marvinhagemeister /types/babel-template/ @yortus @marvinhagemeister -/types/babel-traverse/ @yortus @marvinhagemeister +/types/babel-traverse/ @yortus @marvinhagemeister @rpetrich /types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny /types/babel-webpack-plugin/ @j-f1 /types/babel__code-frame/ @mohsen1 @ForbesLindesay @@ -250,7 +259,7 @@ /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo +/types/backbone/ @borisyankov @nvivo @kenjiru /types/backbone-associations/ @craigbrett17 /types/backbone-fetch-cache/ @delphinus35 /types/backbone-relational/ @eirikhm @@ -261,6 +270,7 @@ /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan /types/backlog-js/ @vvatanabe +/types/backo2/ @Retsam /types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio /types/bagpipes/ @micmro @@ -285,6 +295,7 @@ /types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly +/types/bencode/ @tobenna /types/better-curry/ @pocesar /types/better-sqlite3/ @Morfent @matrumz /types/bezier-easing/ @ptlis @@ -296,6 +307,7 @@ /types/bigint/ @Evgenus /types/bignum/ @Patman64 /types/bigscreen/ @dduugg +/types/bin-pack/ @orentrutner /types/binary-parser/ @riggs @dolanmiu /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented @@ -327,7 +339,7 @@ /types/bluebird-global/ @d-ph /types/bluebird-retry/ @pvomhoff /types/blueimp-md5/ @rmartone @mkohlmyr -/types/bn.js/ @LogvinovLeon +/types/bn.js/ @LogvinovLeon @HenryNguyen5 /types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton /types/body-parser-xml/ @tbounsiar /types/bonjour/ @quentin-ol @octo-sniffle @@ -359,6 +371,7 @@ /types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin +/types/bpmn-moddle/ @haydos89 /types/brace-expansion/ @BendingBender /types/braces/ @vemoo /types/braft-editor/ @me @@ -380,11 +393,13 @@ /types/bucks/ @zaneli /types/buffer-compare/ @chrootsu /types/buffer-equal/ @Bartvds +/types/buffer-from/ @burnnat +/types/buffer-reader/ @nrlquaker /types/buffers/ @rhencke /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -426,6 +441,7 @@ /types/catbox/ @jasonswearingen @AJamesPhillips @saboya /types/cbor/ @pushplay /types/ccap/ @taoqf +/types/cesium/ @Zuzon @hnipps @szechyjs /types/chai/v2/ @Bartvds @AGBrown /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom /types/chai-arrays/ @clementprevot @@ -439,7 +455,7 @@ /types/chai-jquery/ @kazimanzurrashid /types/chai-json-schema/ @ulrichheiniger /types/chai-oequal/ @mizunashi-mana -/types/chai-spies/ @kuzn-ilya +/types/chai-spies/ @kuzn-ilya @harm-less @jounisuo /types/chai-string/ @nmalaguti /types/chai-subset/ @delta62 @AGBrown /types/chai-uuid/ @harm-less @@ -450,14 +466,14 @@ /types/chardet/ @Gebatzens /types/charm/ @Xananax /types/charset/ @cspotcode -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore -/types/chartist/ @mtgibbs @psimonski @clottman @affilnost +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore @gebeto @frabnt @alexdor +/types/chartist/ @mtgibbs @psimonski @clottman @affilnost @sunnyrjuneja /types/chayns/ @HenningKuehl /types/check-sum/ @BendingBender /types/check-types/ @idchlife /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 /types/chessboardjs/ @sliverb @davidmpaz /types/chmodr/ @BendingBender /types/chokidar/ @reppners @felixfbecker @bayssmekanique @@ -466,6 +482,9 @@ /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chromecast-caf-receiver/ @craigrbruce +/types/chromecast-caf-sender/ @samuelmaddock /types/chromedriver/ @pe8ter /types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek @@ -509,7 +528,7 @@ /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard @Pr1st0n +/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller /types/codependency/ @morphatic /types/coffeeify/ @tkQubo /types/coinbase/ @rogierschouten @@ -525,6 +544,7 @@ /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham /types/com.darktalker.cordova.screenshot/ @akarienta +/types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto /types/combine-source-map/ @TeamworkGuy2 /types/combined-stream/ @felixge @tlaziuk /types/combokeys/ @iclanton @@ -536,6 +556,7 @@ /types/commangular/ @hiraash /types/comment-json/ @Jason3S /types/common-errors/ @icopp +/types/common-prefix/ @seangenabe /types/common-tags/ @zuzusik @tzupengwang /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek @@ -553,6 +574,7 @@ /types/conf/ @SamVerschueren @BendingBender /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez +/types/config-yaml/ @me /types/configstore/ @ArcticLight /types/configurable/ @jewbre /types/confit/ @ethanresnick @@ -564,6 +586,7 @@ /types/connect-livereload/ @SomaticIT /types/connect-modrewrite/ @tinganho /types/connect-mongo/ @Syati +/types/connect-mongodb-session/ @NattapongSiri /types/connect-pg-simple/ @pasieronen /types/connect-redis/ @xstoudi @morcerf /types/connect-slashes/ @samherrmann @@ -585,6 +608,7 @@ /types/cookie-session/ @borislavjivkov /types/cookie-signature/ @lith-light-g /types/cookie_js/ @slawiko +/types/cookiejar/ @paroxp /types/cookies/ @WangZishi @jkeylu @BendingBender /types/copy-paste/ @SrTobi /types/copy-text-to-clipboard/ @BendingBender @@ -615,7 +639,7 @@ /types/correlation-id/ @natemara /types/cors/ @pluma /types/cosmiconfig/v4/ @ozum -/types/cosmiconfig/ @ozum @szeck87 @saadq +/types/cosmiconfig/ @ozum @szeck87 @saadq @jinwoo /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault @@ -653,6 +677,7 @@ /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu /types/cssbeautify/ @rictic +/types/csso/ @screendriver /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende @@ -732,6 +757,7 @@ /types/datatables.net-fixedheader/ @szechyjs @Silver-Connection /types/datatables.net-rowgroup/ @maixiu /types/datatables.net-rowreorder/ @baywet +/types/datatables.net-scroller/ @RohdeK /types/datatables.net-select/ @szechyjs /types/date-arithmetic/ @HeeL /types/date.format.js/ @balrob @@ -749,7 +775,7 @@ /types/debug/ @swook @galtalmor @zamb3zi /types/decamelize/ @samverschueren /types/decay/ @enaeseth -/types/decompress/ @plantain-00 +/types/decompress/ @plantain-00 @jbethke /types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 /types/dedent/ @douglasduteil @@ -772,6 +798,7 @@ /types/delaunator/ @DenisCarriere /types/delay/ @BendingBender /types/deline/ @iarroyo5 +/types/deluge/ @Diasiare /types/denodeify/ @joaomoreno /types/deoxxa-content-type/ @pine613 /types/depcheck/ @ark120202 @@ -792,6 +819,7 @@ /types/detect-port/ @lith-light-g /types/detect-touch-events/ @thomastilkema /types/detox/ @TareqElMasri +/types/devexpress-aspnetcore-bootstrap/ @devexpress @skubarenko /types/df-visible/ @Litee /types/dhtmlxgantt/ @mkozhukh @chriscamicas /types/dhtmlxscheduler/ @mkozhukh @@ -847,7 +875,7 @@ /types/dropboxjs/ @Steve-Fenton @xperiments /types/dropkickjs/ @VorobeY1326 /types/dropzone/v4/ @nvivo @outring @renuo @Hikariii -/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro +/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro @dwaxweiler /types/dts-generator/ @mtraynham /types/duplexer2/ @Goldsmith42 /types/duplexer3/ @BendingBender @@ -866,6 +894,7 @@ /types/each/ @misak113 /types/earcut/ @NaridaL /types/easeljs/ @evilangelist +/types/eases/ @MathiasPaumgarten /types/easy-api-request/ @DeadAlready /types/easy-jsend/ @DeadAlready /types/easy-session/ @DeadAlready @@ -874,6 +903,7 @@ /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde /types/echarts/ @xieisabug @AntiMoron @liveangela +/types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian @@ -893,7 +923,7 @@ /types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 /types/electron-notifications/ @djpereira /types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy @jkleinsc +/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey /types/electron-settings/v2/ @leonard-thieu /types/electron-settings/ @icopp @nrlquaker /types/electron-spellchecker/ @unindented @@ -907,31 +937,34 @@ /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie @alexlafroscia @mike-north /types/ember-data/ @dwickern @mike-north @chriskrycho /types/ember-feature-flags/ @tansongyang /types/ember-mocha/ @dwickern /types/ember-modal-dialog/ @tansongyang /types/ember-qunit/v2/ @dwickern /types/ember-qunit/ @dwickern +/types/ember-resolver/ @dfreeman /types/ember-test-helpers/ @dwickern /types/ember-testing-helpers/ @chriskrycho +/types/ember__test-helpers/ @dfreeman @jamescdavis /types/emissary/ @vvakame /types/emoji-mart/ @Kovensky +/types/emoji-regex/ @iKBAHT /types/emojione/ @dbrgn /types/empower/ @vvakame /types/emscripten/ @zakki @periklis /types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda /types/engine.io-client/ @KentarouTakeda -/types/enhanced-resolve/ @e-cloud @onigoetz +/types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly /types/enigma.js/ @konne /types/enquire.js/ @screendriver /types/ent/ @rogierschouten /types/entities/ @aliceklipper /types/env-to-object/ @MugeSo /types/envify/ @tkQubo -/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden +/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden @hotell /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff @@ -965,6 +998,7 @@ /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/ethereum-protocol/ @LogvinovLeon /types/ethereumjs-abi/ @LogvinovLeon /types/ethereumjs-tx/ @LogvinovLeon /types/ethereumjs-util/ @cortopy @@ -979,8 +1013,9 @@ /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep /types/events/ @yasupeke -/types/eventsource/ @scottleedavis +/types/eventsource/ @scottleedavis @afroozeh /types/evernote/ @corps +/types/ex-react-native-i18n/ @maplerichie /types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers @@ -989,13 +1024,15 @@ /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 /types/expect/ @jmreidy @merrywhether -/types/expect-puppeteer/ @JoshuaKGoldberg +/types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov +/types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki +/types/expo__status-bar-height/ @dawnmist /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov /types/express-brute/ @cyrilschumacher @@ -1031,6 +1068,7 @@ /types/express-partials/ @jt000 /types/express-promise-router/ @wanganjun /types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-redis-cache/ @ajliv /types/express-route-fs/ @kripod /types/express-routemap/ @icopp /types/express-sanitized/ @cjbarth @@ -1041,7 +1079,7 @@ /types/express-unless/ @wokim /types/express-winston/ @bricka /types/express-ws/ @ajliv -/types/express-xml-bodyparser/ @noticeMaker +/types/express-xml-bodyparser/ @noticeMaker @macedigital /types/extend/ @reppners /types/extjs/ @brian428 /types/extract-files/ @Slessi @@ -1053,7 +1091,7 @@ /types/f1/ @neolwc /types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira /types/facebook-instant-games/ @menushka @oyvindjam -/types/facebook-js-sdk/ @amritk +/types/facebook-js-sdk/ @amritk @mahmoudzohdi /types/facebook-pixel/ @noctishsu /types/faker/v3/ @Kuniwak /types/faker/ @bensw @basp @Kuniwak @mattbishop @@ -1099,11 +1137,12 @@ /types/fetch-jsonp/ @tkrotoff /types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues /types/fetch.io/ @newraina -/types/ffi/ @loyd +/types/ffi/ @loyd @waitingsong /types/ffmpeg-static/ @iamstevetran /types/ffprobe-static/ @iamstevetran /types/fhir-js-client/ @rmchndrng /types/fibers/ @soywiz +/types/fibjs/ @richardo2016 /types/figures/ @BendingBender /types/file-exists/ @BendingBender /types/file-saver/ @cyrilschumacher @DaIgeb @chrismbarr @@ -1347,6 +1386,7 @@ /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal /types/generate-changelog/ @ffflorian +/types/generate-json-webpack-plugin/ @rynclark /types/generic-functions/ @stpettersens /types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici @@ -1357,6 +1397,7 @@ /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan /types/get-caller-file/ @ajafff +/types/get-folder-size/ @mszczepanczyk /types/get-node-dimensions/ @vincekovacs /types/get-stdin/ @DanielRosenwasser /types/get-stream/ @douglasduteil @BendingBender @@ -1368,6 +1409,7 @@ /types/gijgo/ @atatanasov /types/giraffe/ @darthapo /types/git/ @vvakame +/types/git-branch/ @rynclark /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow /types/github-username-regex/ @BehindTheMath @@ -1382,6 +1424,7 @@ /types/glob-expand/ @vvakame /types/glob-parent/ @mrmlnc /types/glob-stream/ @Bartvds @mrmlnc +/types/glob-to-regexp/ @whatasoda /types/global-tunnel-ng/ @BendingBender /types/globalize/ @gcastre @afromogli /types/globalize-compiler/ @iclanton @@ -1394,8 +1437,8 @@ /types/google-apps-script/ @motemen @grant /types/google-apps-script-oauth2/ @dhayab /types/google-cloud__datastore/ @beaulac -/types/google-cloud__pubsub/ @pheromonez -/types/google-cloud__storage/ @blove @nbperry +/types/google-cloud__pubsub/ @pheromonez @LunaPg +/types/google-cloud__storage/ @blove @nbperry @welkie /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit @@ -1408,15 +1451,16 @@ /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz /types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm -/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar /types/googlemaps.infobubble/ @Dashue /types/googlepay/ @Fluccioni /types/got/ @BendingBender @LinusU @ikokostya /types/graceful-fs/v2/ @Bartvds /types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen +/types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass @@ -1431,7 +1475,7 @@ /types/gravatar-url/ @ivangabriele /types/greasemonkey/ @kotas /types/grecaptcha/v0/ @brentj73 -/types/grecaptcha/ @DethAriel +/types/grecaptcha/ @DethAriel @rafaeltavares /types/gregorian-calendar/ @cwalv /types/grid-styled/ @antonvasin @vittorio @lhache /types/gridfs-stream/ @liorm @@ -1500,6 +1544,7 @@ /types/gulp-shell/ @tkqubo /types/gulp-size/ @tkrotoff @remisery /types/gulp-sort/ @joeskeen +/types/gulp-strip-comments/ @Aqours /types/gulp-strip-debug/ @peterjuras /types/gulp-svg-sprite/ @tkqubo /types/gulp-svgmin/ @Aankhen @@ -1522,13 +1567,14 @@ /types/hapi/v12/ @jasonswearingen /types/hapi/v15/ @jasonswearingen /types/hapi/v16/ @jasonswearingen @AJamesPhillips -/types/hapi/ @BorntraegerMarc @rafaelsouzaf @jhsimms @SimonSchick +/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick /types/hapi-auth-basic/ @AJamesPhillips @saboya /types/hapi-auth-jwt2/v7/ @warrenseymour /types/hapi-auth-jwt2/ @warrenseymour @SimonSchick /types/hapi-decorators/ @kenhowardpdx /types/har-format/ @micmro /types/hard-rejection/ @BendingBender +/types/hard-source-webpack-plugin/ @woitechen /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender /types/hash-file/ @HiromiShikata @@ -1556,9 +1602,10 @@ /types/hexo-bunyan/ @segayuu /types/hexo-fs/ @segayuu /types/hexo-log/ @segayuu +/types/hexo-util/ @segayuu /types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens /types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu @alvis +/types/highland/ @Bartvds @hgwood @iwllyu @alvis @notbobthebuilder /types/highlight.js/ @nikeee @sourrust @joshuakgoldberg /types/hiredis/ @titan /types/history/v2/ @sergey-buturlakin @ngbrown @@ -1592,9 +1639,12 @@ /types/http-codes/ @mhegazy /types/http-context/ @mtraynham /types/http-errors/ @tkrotoff @BendingBender +/types/http-graceful-shutdown/ @dlee-nvisia +/types/http-link-header/ @screendriver /types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt /types/http-proxy-agent/ @mrmlnc /types/http-proxy-middleware/ @zebMcCorkle @BendingBender +/types/http-rx/ @L2jLiga /types/http-server/ @plantain-00 /types/http-status/ @misak113 /types/http-string-parser/ @pine613 @@ -1617,6 +1667,7 @@ /types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas /types/i18next-express-middleware/ @cyrilschumacher +/types/i18next-ko/ @dwaxweiler /types/i18next-node-fs-backend/ @cyrilschumacher /types/i18next-sprintf-postprocessor/ @cyrilschumacher /types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas @@ -1645,9 +1696,11 @@ /types/imap/ @psnider /types/imap-simple/ @pushplay /types/imgur-rest-api/ @lukewestby +/types/imperium/ @gaetansenn /types/impress/ @borisyankov /types/in-app-purchase/ @l-jonas /types/in-range/ @DanielRosenwasser +/types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame /types/indent-string/ @mhegazy /types/inert/v4/ @nycdotnet @AJamesPhillips @@ -1659,25 +1712,26 @@ /types/iniparser/ @chrootsu /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood +/types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame /types/integer/ @Morfent /types/interact.js/ @dduugg @adidahiya @thasner -/types/intercom-client/ @jineshshah36 +/types/intercom-client/ @jineshshah36 @peping /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi /types/internal-ip/ @BendingBender /types/intl/ @RagibHasin +/types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-tel-input/ @fdnhkj @leonard-thieu /types/into-stream/ @BendingBender /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 /types/inversify-devtools/ @inversify -/types/ion.rangeslider/v1/ @dduugg -/types/ion.rangeslider/ @sixinli -/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor +/types/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche +/types/ion-rangeslider/ @Karel-van-de-Plassche +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 /types/iota.lib.js/ @fogsh /types/ip/ @codeanimal /types/ip-regex/ @unindented @@ -1713,6 +1767,7 @@ /types/is-stream/ @me /types/is-svg/ @BendingBender /types/is-text-path/ @mhegazy +/types/is-touch-device/ @screendriver /types/is-url/ @RyotaMurohoshi /types/is-url-superb/ @kryops /types/is-windows/ @mizunashi-mana @@ -1761,11 +1816,11 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @ahnpnl @joshuakgoldberg @UselessPickles @r3nya @hotell /types/jest-axe/ @JoshuaKGoldberg /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang -/types/jest-each/ @theutz +/types/jest-each/ @theutz @nickmccurdy /types/jest-environment-puppeteer/ @joshuakgoldberg /types/jest-get-type/ @myabc /types/jest-image-snapshot/ @dawnmist @@ -1782,9 +1837,10 @@ /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd /types/joigoose/ @boothwhack /types/josa/ @vichyssoise +/types/jotform-css.js/ @pandawood /types/jpeg-js/ @DanielRosenwasser /types/jpegtran-bin/ @hikoma /types/jpm/ @github-account-because-they-want-it @@ -1795,6 +1851,7 @@ /types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 /types/jquery-ajax-chain/ @humana-fragilitas /types/jquery-alertable/ @stever +/types/jquery-animate-scroll/ @AndersonFriaca /types/jquery-awesome-cursor/ @zskovacs /types/jquery-backstretch/ @dkulyk /types/jquery-countdown/ @AndersonFriaca @@ -1808,6 +1865,7 @@ /types/jquery-focusable/ @AndersonFriaca /types/jquery-fullscreen/ @bgrieder /types/jquery-galleria/ @rimig +/types/jquery-gray/ @AndersonFriaca /types/jquery-handsontable/ @intelorca /types/jquery-jcrop/ @joeskeen /types/jquery-jsonrpcclient/ @Ty3uK @@ -1817,7 +1875,8 @@ /types/jquery-mask-plugin/ @avidenic @AndersonFriaca /types/jquery-maskmoney/ @AndersonFriaca /types/jquery-match-height/ @kbytesys -/types/jquery-mockjax/ @laszlojakab @vladeck +/types/jquery-mockjax/ @laszlojakab @vladeck @hasaki +/types/jquery-mouse-exit/ @AndersonFriaca /types/jquery-mousewheel/ @xt0rted /types/jquery-next-id/ @AndersonFriaca /types/jquery-notifier/ @allipierre @@ -1828,6 +1887,7 @@ /types/jquery-sticky/ @maixiu /types/jquery-tags-input/ @AndersonFriaca /types/jquery-timeentry/ @marknadig +/types/jquery-toast-plugin/ @viqashussain /types/jquery-toastmessage-plugin/ @joeskeen /types/jquery-truncate-html/ @abraaoalves /types/jquery-urlparam/ @stpettersens @@ -1851,7 +1911,7 @@ /types/jquery.dropotron/ @cyrilschumacher /types/jquery.dynatree/ @fdecampredon /types/jquery.elang/ @sumegizoltan -/types/jquery.fancytree/ @alphaleonis @abedi-ir @Nitecube +/types/jquery.fancytree/ @alphaleonis @abedi-ir @niikoo @Nitecube /types/jquery.filtertable/ @totpero /types/jquery.finger/ @maxackley /types/jquery.flagstrap/ @felipedgarcia @@ -1864,6 +1924,7 @@ /types/jquery.jsignature/ @pjmagee /types/jquery.leanmodal/ @FinelySliced /types/jquery.livestampjs/ @vbortone +/types/jquery.nicescroll/ @Wkalmar /types/jquery.notify/ @evil-shrike /types/jquery.notifybar/ @zaneli /types/jquery.noty/ @kingdango @thelfensdrfer @@ -1932,7 +1993,7 @@ /types/jsend/ @CaselIT /types/jsesc/ @Bartvds /types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln /types/jshamcrest/ @dharkness /types/jsmockito/ @shiver-me-timbers /types/jsnox/ @stkb @DovydasNavickas @@ -1940,6 +2001,7 @@ /types/json-merge-patch/ @senyaarseniy /types/json-parse-better-errors/ @DanielRosenwasser /types/json-patch/ @vvakame +/types/json-patch-gen/ @RohdeK /types/json-pointer/ @Bartvds /types/json-query/ @mtraynham /types/json-rpc-ws/ @npenin @mlamp @@ -1969,6 +2031,7 @@ /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf +/types/jsreport-html-to-xlsx/v1/ @me /types/jsreport-html-to-xlsx/ @me /types/jsreport-jsrender/ @taoqf /types/jsreport-phantom-pdf/ @taoqf @@ -2003,13 +2066,14 @@ /types/karma-chai/ @JayAndCatchFire /types/karma-chai-sinon/ @vasek17 /types/karma-coverage/ @tkrotoff -/types/karma-fixture/ @evictor +/types/karma-fixture/ @evictor @afshawnlotfi /types/karma-jasmine/ @michelsalib /types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko /types/kdbush/ @DenisCarriere +/types/keen-tracking/ @rui-ferreira /types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik /types/keyboardjs/ @vbortone @piranha771 @@ -2048,7 +2112,7 @@ /types/ko.plus/ @conficient /types/koa/ @DavidCai1993 @jkeylu @brikou /types/koa-basic-auth/ @Tobias4872 -/types/koa-bodyparser/ @hellopao +/types/koa-bodyparser/ @hellopao @anup-2s /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu /types/koa-compress/ @hellopao @@ -2073,22 +2137,23 @@ /types/koa-range/ @strax /types/koa-redis/ @nsimmons /types/koa-response-time/ @thorsedeke -/types/koa-route/ @migstopheles -/types/koa-router/ @hellopao @schfkt +/types/koa-route/ @migstopheles @jacogr +/types/koa-router/ @hellopao @schfkt @JounQin /types/koa-send/ @pe8ter @tlaziuk /types/koa-session/ @kerol2r20 @tlaziuk /types/koa-session-minimal/ @longztian /types/koa-sslify/ @wingsbob /types/koa-static/ @hellopao @tlaziuk +/types/koa-static-cache/ @JounQin /types/koa-views/ @brooklyndev -/types/koa-webpack/ @malj -/types/koa-websocket/ @me +/types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk +/types/koa-websocket/ @moimael @jacogr /types/koa-xml-body/ @uwinkelvos /types/koa2-cors/ @xialeistudio /types/koa__cors/ @Xstoudi @izayoiko @stevehipwell /types/kolite/ @borisyankov /types/konami.js/ @mareek -/types/kraken-js/ @darkwebdev +/types/kraken-js/ @darkwebdev @micksatana /types/kramed/ @tonicblue /types/kss/ @giladgray /types/kue/ @drudge @amiram @pc-jedi @deerawan @@ -2136,7 +2201,7 @@ /types/leapmotionts/ @logotype /types/legal-eagle/ @j-f1 /types/lerna-get-packages/ @LogvinovLeon -/types/less/ @thasner @pranaygp +/types/less/ @thasner @pranaygp @dwaxweiler /types/less-middleware/ @federicobond /types/less2sass/ @gatimus /types/lestate/ @thelambdaparty @@ -2146,13 +2211,15 @@ /types/leven/ @jmalonzo /types/levenshtein/ @geoffreak /types/libpq/ @Lodin -/types/libxmljs/ @fdecampredon +/types/libxmljs/ @fdecampredon @ComFreek /types/libxslt/ @alejo90 /types/license-checker/ @rogierschouten @unindented /types/lil-uuid/ @Pr1st0n /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen /types/line-reader/ @stpettersens +/types/lingui__core/ @huan086 +/types/lingui__react/ @huan086 /types/linkify-it/ @praxxis /types/listr/ @durad /types/lls/ @borislavjivkov @@ -2514,18 +2581,20 @@ /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex /types/markdownlint/ @ark120202 -/types/marked/ @worr @BendingBender +/types/marked/ @worr @BendingBender @CrossR /types/marker-animate-unobtrusive/ @viskin /types/markerclustererplus/ @enanox @mxl /types/markitup/ @drillbits +/types/marko/ @darkwebdev /types/maskedinput/ @lokeshpeta /types/masonry-layout/ @m-a-wilson @warriorrocker /types/massive/v3/ @swissspidy @clarenceh /types/massive/ @swissspidy @clarenceh @AmazingTurtle /types/match-media-mock/ @asvetliakov +/types/match-sorter/ @claasahl /types/material-components-web/ @BrentDouglas @ckosti /types/material-design-lite/ @bradzacher -/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz +/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino /types/material-ui-datatables/ @coding2012 /types/material__animation/ @BrentDouglas @ckosti /types/material__auto-init/ @BrentDouglas @ckosti @@ -2557,7 +2626,7 @@ /types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol @andnp +/types/mathjs/ @siavol @andnp @bradbesserman /types/matter-js/ @piranha771 @hasparus /types/maxmind/ @geoffreak /types/mcustomscrollbar/ @flurg @@ -2570,7 +2639,7 @@ /types/mem-fs/ @MyFoodBag /types/mem-fs-editor/ @MyFoodBag /types/memcached/ @KentarouTakeda -/types/memoize-one/ @karol-majewski +/types/memoize-one/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud @@ -2580,6 +2649,7 @@ /types/merge-stream/ @k-kagurazaka @daniel-zazula /types/merge2/ @tkrotoff @smac89 /types/merkle/ @kerol2r20 +/types/mermaid/ @ggilmore /types/mersenne-twister/ @KentarouTakeda /types/meshblu/ @fnipo /types/mess/ @Nemo157 @@ -2598,6 +2668,7 @@ /types/metric-suffix/ @davidm77 /types/mfiles/ @avonwyss /types/micro/ @kaoDev +/types/micro-cors/ @CallumDenby /types/micromatch/v2/ @glen-84 /types/micromatch/ @glen-84 @vemoo /types/microrouter/ @mathieudutour @@ -2607,6 +2678,7 @@ /types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev /types/microtime/ @vincekovacs /types/milkcocoa/ @odangosan +/types/millisecond/ @xeoneux /types/mime/ @jedigo @dhritzkiv /types/mime-db/ @AJamesPhillips /types/mime-types/ @Perlmint @@ -2616,7 +2688,7 @@ /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub /types/minimist-options/ @ikatyang -/types/minio/ @barinbritva @castorw +/types/minio/ @barinbritva @castorw @loremaps /types/minipass/ @BendingBender /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @andraaspar @isiahmeadows @@ -2630,7 +2702,7 @@ /types/mkpath/ @optical /types/mobx-apollo/ @pselden /types/mobx-devtools-mst/ @pluma -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 /types/mocha-each/ @magnostherobot /types/mocha-phantomjs/ @ErikSchierboom /types/mocha-steps/ @Arylo @@ -2653,13 +2725,16 @@ /types/moment-jalaali/ @alitaheri /types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas /types/moment-round/ @jacobbaskin +/types/moment-shortformat/ @whatasoda /types/moment-strftime2/ @dex4er /types/moment-timezone/ @michelsalib @alanblins /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach +/types/mongodb-memory-server/ @dmitryrogozhny +/types/mongodb-uri/ @mernxl /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab +/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz @@ -2676,6 +2751,8 @@ /types/morgan/ @staticfunction @pscanf /types/morphdom/ @arvitaly /types/morris.js/ @mareek @sindilevich +/types/mosca/ @GabrielGouv +/types/motor-hat/ @muntyan /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff /types/moviedb/ @basarat @0x6368656174 @@ -2689,7 +2766,7 @@ /types/msgpack5/ @wokim @heycalmdown /types/msnodesql/ @borisyankov @SomaticIT /types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter @mcdado /types/mu2/ @jedigo /types/muicss/ @samuelneff /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob @@ -2707,14 +2784,16 @@ /types/murmurhash-js/ @cvle /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi -/types/mustache/ @markashleybell +/types/mustache/ @markashleybell @manuth /types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro /types/mz/ @ThomasHickman /types/n3/ @phreed /types/named-regexp-groups/ @jewbre +/types/named-routes/ @qqilihq /types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill +/types/nanographql/ @cdaringe /types/nanoid/ @bash /types/nanomsg/ @titan /types/nanoscroller/ @zihark17 @@ -2745,9 +2824,10 @@ /types/network-interfaces/ @anderswestberg /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev +/types/newman/ @LogvinovLeon /types/newrelic/ @mastermatt /types/nexpect/ @vvakame -/types/next/ @dru89 @brikou +/types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira /types/next-redux-wrapper/ @stevegeek /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva @@ -2775,20 +2855,21 @@ /types/nightwatch/ @rkavalap @schlesiger /types/nivo-slider/ @AndersonFriaca /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko -/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour +/types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati /types/nodal/ @charrondev -/types/node/v4/ @eps1lon -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude -/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude +/types/node/v4/ @eps1lon @Archcry +/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub @Archcry +/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya +/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @ZaneHannanAU /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann /types/node-calendar/ @luzianz /types/node-cleanup/ @agadar /types/node-cron/ @maximelkin +/types/node-dijkstra/ @nokutu /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo /types/node-emoji/ @jonestristand @styu @@ -2802,9 +2883,10 @@ /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel /types/node-int64/ @x3cion @kevin-greene-ck -/types/node-ipc/ @arvitaly +/types/node-ipc/ @arvitaly @gjurgens /types/node-jsfl-runner/ @mrand01 /types/node-json-db/ @kuzn-ilya +/types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras /types/node-notifier/ @tkQubo /types/node-polyglot/ @timjk @@ -2817,9 +2899,10 @@ /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner /types/node-sprite-generator/ @Perlmint +/types/node-ssdp/ @OrionNebula /types/node-static/ @Morfent /types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 @XC-Zhang /types/node-uuid/ @jeffmay /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong @@ -2827,11 +2910,12 @@ /types/node-xmpp-client/ @PJakcson /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 +/types/node-zopfli/ @Alorel /types/node_redis/ @borisyankov /types/nodecredstash/ @migstopheles -/types/nodegit/ @dolanmiu +/types/nodegit/ @dolanmiu @tniessen /types/nodemailer/v3/ @rogierschouten -/types/nodemailer/ @rogierschouten @dex4er +/types/nodemailer/ @rogierschouten @dex4er @bioball /types/nodemailer-direct-transport/ @rogierschouten /types/nodemailer-mailgun-transport/ @otociulis /types/nodemailer-pickup-transport/ @psnider @@ -2861,6 +2945,7 @@ /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk +/types/nuka-carousel/ @Romic /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @@ -2876,6 +2961,7 @@ /types/oauth2-server/ @vangorra @cirick /types/oauth2orize/ @wokim @heycalmdown @stevehipwell /types/obelisk.js/ @bdrupieski +/types/obj-file-parser/ @benc-uk /types/object-assign/ @chbrown /types/object-diff/ @rogierschouten /types/object-hash/ @misak113 @@ -2890,7 +2976,7 @@ /types/oclazyload/ @rolandzwaga /types/odata/ @janhommes @jcchalte /types/ofe/ @Morfent -/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham +/types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks @@ -2911,6 +2997,7 @@ /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 +/types/openpgp/ @errietta /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis @@ -2933,12 +3020,14 @@ /types/osmtogeojson/ @tkqubo /types/osrm/ @DenisCarriere /types/otplib/ @renjfk +/types/overwatch-api/ @JoshuaHall /types/owasp-password-strength-test/ @stephtr /types/owl.carousel/ @igorissen @KennethanCeyer /types/owlcarousel/ @dpiatkowski /types/p-all/ @BendingBender /types/p-any/ @BendingBender /types/p-cancelable/ @BendingBender +/types/p-catch-if/ @LinusU /types/p-debounce/ @BendingBender /types/p-defer/ @SamVerschueren /types/p-do-whilst/ @BendingBender @@ -2946,7 +3035,7 @@ /types/p-event/ @BendingBender /types/p-every/ @BendingBender /types/p-lazy/ @BendingBender -/types/p-limit/ @BendingBender +/types/p-limit/ @BendingBender @LinusU /types/p-loading/ @renjfk /types/p-locate/ @BendingBender /types/p-log/ @BendingBender @@ -2965,7 +3054,7 @@ /types/p-tap/ @BendingBender /types/p-throttle/ @BendingBender /types/p-timeout/ @BendingBender -/types/p-try/ @BendingBender +/types/p-try/ @BendingBender @LinusU /types/p-wait-for/ @BendingBender /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson @@ -2975,8 +3064,8 @@ /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg /types/pangu/ @plantain-00 -/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly -/types/paper/ @clark-stevenson @Xakaloz +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo +/types/paper/ @clark-stevenson @Xakaloz @sebaswebdev /types/paralleljs/ @jbaldwin /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli @@ -2993,8 +3082,15 @@ /types/parse-torrent/ @niieani @tlaziuk /types/parse-torrent-file/ @tlaziuk /types/parse-unit/ @Jack-Works +/types/parse5/v4/ @inikulin @andnp +/types/parse5/ @inikulin +/types/parse5-htmlparser2-tree-adapter/ @inikulin +/types/parse5-parser-stream/ @inikulin +/types/parse5-plain-text-conversion-stream/ @inikulin +/types/parse5-sax-parser/ @inikulin +/types/parse5-serializer-stream/ @inikulin /types/parseurl/ @bomret -/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu +/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz /types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 /types/passport-anonymous/ @0x6368656174 /types/passport-beam/ @AtlasDev @@ -3002,7 +3098,7 @@ /types/passport-facebook/ @staticfunction @lucasmacosta /types/passport-facebook-token/ @rmartone @mrand01 /types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders +/types/passport-github2/ @yasupeke @mthmulders @codepunkt /types/passport-google-oauth/ @staticfunction /types/passport-google-oauth2/ @bluehatbrit /types/passport-http/ @krizalys @tlaziuk @cjbarth @@ -3043,6 +3139,7 @@ /types/peerjs/ @nakakura /types/pegjs/ @vvakame @SrTobi @siegebell /types/pem/ @tony19 @DethAriel +/types/pem-jwk/ @alessiopcc /types/persona/ @Nycto /types/pet-finder-api/ @me /types/pg/v6/ @pspeter3 @@ -3084,6 +3181,7 @@ /types/pinyin/ @wanganjun /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga +/types/pixi.js/ @clark-stevenson /types/pkg-dir/ @NK-WEB-Git /types/pkijs/ @microshine /types/platform/ @JakeH @@ -3095,13 +3193,14 @@ /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann -/types/pluralize/ @ukyo +/types/pluralize/ @ukyo @karol-majewski /types/png-async/ @kanreisa /types/pngjs/ @jason0x43 /types/pngquant-bin/ @hikoma /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai +/types/polyfill-service/ @Alorel /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 /types/polymer/ @lgrignon @laco0416 @@ -3123,7 +3222,7 @@ /types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-browser/ @spaulg @geppy @fredgalvao /types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo -/types/pouchdb-find/ @trubit +/types/pouchdb-find/ @trubit @tiangolo /types/pouchdb-http/ @spaulg @geppy @fredgalvao /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao /types/pouchdb-node/ @spaulg @geppy @fredgalvao @@ -3137,12 +3236,13 @@ /types/preloadjs/ @endel /types/prelude-ls/ @AyaMorisawa /types/prettier/ @ikatyang -/types/pretty-bytes/ @plantain-00 +/types/pretty-bytes/v4/ @plantain-00 +/types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-format/ @ikatyang /types/pretty-ms/ @BendingBender /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak -/types/prismic-dom/ @nickw444 +/types/prismic-dom/ @nickw444 @sbilstein /types/prismjs/ @eriklieben @andrewiggins @mmiszy /types/private-ip/ @coderslagoon /types/procfs-stats/ @cyrilschumacher @@ -3153,12 +3253,15 @@ /types/proj4leaflet/ @BendingBender /types/project-oxford/ @scsouthw /types/promise-dag/ @OSjoerdWie +/types/promise-ftp/ @coolreader18 +/types/promise-ftp-common/ @coolreader18 /types/promise-map-limit/ @kohlmannj /types/promise-pg/ @coldacid /types/promise-polyfill/ @skysteve /types/promise-pool/ @vilic /types/promise-queue/ @LachlanStuart /types/promise-retry/ @shirakaba +/types/promise-sftp/ @coolreader18 /types/promise-timeout/ @Aankhen /types/promise.prototype.finally/ @slavik57 @BendingBender /types/promised-temp/ @rokadias @@ -3206,7 +3309,7 @@ /types/pumpify/ @JustinBeckwith @aoberoi /types/pupa/ @nju33 /types/puppeteer/v0/ @marvinhagemeister @cdeutsch -/types/puppeteer/ @marvinhagemeister @cdeutsch @jwbay +/types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma /types/pusher-js/ @tkqubo @cainlevy @@ -3221,12 +3324,14 @@ /types/qlik-engineapi/ @konne /types/qlik-visualizationextensions/ @konne /types/qr-image/ @taoqf +/types/qrcode/ @plantain-00 /types/qrcode.react/ @mleko /types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti /types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro +/types/querystringify/ @ilich /types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr @43081j +/types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone /types/quixote/ @greybax /types/qunit/v1/ @diullei /types/qunit/ @waratuman @@ -3237,7 +3342,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3270,41 +3375,46 @@ /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks +/types/re-base/ @jordandrako +/types/reach__router/ @kingdaro /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo +/types/react-amplitude/ @rayzor65 /types/react-animate-on-scroll/ @ralbuque /types/react-app/ @prakarshpandey /types/react-aria-menubutton/ @forabi @crohlfs /types/react-autocomplete/ @lstanden /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates -/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint -/types/react-big-calendar/ @piotrwitek @paustint @pikpok +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 /types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas -/types/react-bootstrap-typeahead/ @Guymestef @radziksh +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson /types/react-breadcrumbs/ @KostyaEsmukov /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros /types/react-burger-menu/ @radziksh /types/react-calendar-heatmap/ @9renpoto -/types/react-calendar-timeline/ @radziksh +/types/react-calendar-timeline/ @radziksh @acemac /types/react-cartographer/ @trevonmckay /types/react-circular-progressbar/ @lstanden /types/react-click-outside/ @screendriver /types/react-codemirror/ @velveret @rudi-c +/types/react-coinhive/ @sktbcbbs /types/react-collapse/ @Kimahriman /types/react-collapsible/ @knegusen /types/react-color/ @LKay @markspolakovs @mntdn /types/react-confirm/ @santiagodoldan /types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix +/types/react-copy-write/ @samhh @davej /types/react-credit-cards/ @vstrimaitis /types/react-cropper/ @stepancar /types/react-css-modules/ @KostyaEsmukov @skirsdeda @@ -3315,9 +3425,9 @@ /types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 /types/react-datagrid/ @stephenjelfs /types/react-date-range/ @Junbong -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas -/types/react-dates/ @Artur-A +/types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong /types/react-dnd-html5-backend/ @oizie /types/react-dnd-multi-backend/ @dawnmist @@ -3346,6 +3456,7 @@ /types/react-form/v1/ @cameron-mcateer /types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker +/types/react-gateway/ @jsonunger /types/react-geosuggest/ @brmenchl /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn @@ -3353,17 +3464,18 @@ /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway /types/react-hamburger-menu/ @grzesie2k +/types/react-hammerjs/ @jsonunger /types/react-helmet/v4/ @evanbb @isman-usoh /types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit /types/react-helmet-async/ @forabi -/types/react-highlight-words/ @mhegazy +/types/react-highlight-words/ @mhegazy @diogodca /types/react-highlighter/ @oizie /types/react-holder/ @isman-usoh /types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas /types/react-hyperscript/ @tock203 /types/react-i18next/v1/ @KostyaEsmukov /types/react-i18next/v4/ @GiedriusGrabauskas -/types/react-i18next/ @GiedriusGrabauskas @chnoch +/types/react-i18next/ @GiedriusGrabauskas @chnoch @beheh /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay /types/react-image-crop/ @danielasy @@ -3371,6 +3483,7 @@ /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd /types/react-infinite-calendar/ @christianchown +/types/react-infinite-scroll-component/ @sroy3 /types/react-infinite-scroller/ @Lapanti @psrebniak /types/react-input-calendar/ @stepancar /types/react-input-mask/ @apare @@ -3380,11 +3493,13 @@ /types/react-is/ @AviVahl /types/react-is-deprecated/ @seansfkelley /types/react-joyride/ @DanielRosenwasser @bendxn +/types/react-js-pagination/ @netoisc /types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston +/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston @phbou72 @LucianBuzzo /types/react-lazyload/ @m0a +/types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit /types/react-list/ @buptyyf @tomshen /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs @@ -3399,13 +3514,17 @@ /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff +/types/react-motion-ui-pack/ @jsonunger +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk /types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea /types/react-native-autocomplete-input/ @ifiokjr +/types/react-native-background-timer/ @chillkroeteTTS /types/react-native-bluetooth-serial/ @RodrigoAWeber /types/react-native-communications/ @huhuanming @PaitoAnderson +/types/react-native-custom-tabs/ @philnova /types/react-native-datepicker/ @jacobbaskin +/types/react-native-dialog/ @MrLuje /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 /types/react-native-drawer/ @jnbt @suniahk @@ -3425,39 +3544,43 @@ /types/react-native-loading-spinner-overlay/ @fhelwanger /types/react-native-material-design-searchbar/ @iRoachie /types/react-native-material-kit/ @iRoachie @timwangdev -/types/react-native-material-textfield/ @mindhivefi +/types/react-native-material-textfield/ @mindhivefi @iRoachie /types/react-native-material-ui/ @iRoachie /types/react-native-mixpanel/ @r3nya /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi -/types/react-native-navigation/ @egorshulga /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown -/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz +/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz @bm-software /types/react-native-push-notification/ @PaitoAnderson @tomSawkins /types/react-native-qrcode/ @plantain-00 /types/react-native-safari-view/ @mrand01 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar +/types/react-native-settings-list/ @MrLuje +/types/react-native-share/ @marknelissen /types/react-native-snap-carousel/ @jnbt @j-fro @gazaret /types/react-native-sortable-grid/ @j-fro /types/react-native-sortable-list/ @sivolobov @RookY2K -/types/react-native-sqlite-storage/ @dryganets +/types/react-native-sqlite-storage/ @dryganets @cavarzan /types/react-native-star-rating/ @iRoachie +/types/react-native-svg-charts/ @krzysztof-miemiec /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq /types/react-native-tab-navigator/ @iRoachie -/types/react-native-tab-view/ @kaoDev +/types/react-native-tab-view/ @kaoDev @iRoachie @timwangdev /types/react-native-text-input-mask/ @RodrigoAWeber -/types/react-native-touch-id/ @huhuanming @gazaret +/types/react-native-toast-native/ @bm-software +/types/react-native-touch-id/ @huhuanming @gazaret @jinshin1013 /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming -/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj +/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay +/types/react-notify-toast/ @klaascuvelier /types/react-numeric-input/ @heatherbooker /types/react-onclickoutside/v5/ @LKay /types/react-onclickoutside/ @LKay @@ -3465,10 +3588,11 @@ /types/react-overlays/ @aaronbeall @vitosamson /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-places-autocomplete/ @guilhermehubner +/types/react-places-autocomplete/ @guilhermehubner @r3nya /types/react-pointable/ @istefo @mdibyo /types/react-popover/ @jacoporicare /types/react-portal/ @shuntksh +/types/react-primitives/ @aghoneim92 /types/react-props-decorators/ @tkqubo /types/react-radio-group/ @jsonunger /types/react-recaptcha/ @mhegazy @zzanol @@ -3482,10 +3606,10 @@ /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz -/types/react-rnd/ @Ragg- +/types/react-rnd/ @Ragg- @fsubal /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @@ -3501,10 +3625,12 @@ /types/react-scrollbar/ @stephenjelfs /types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur /types/react-share/ @icopp +/types/react-show-more/ @naortor /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR /types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya +/types/react-slider/ @jsonunger /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey /types/react-sortable-pane/ @rhysd @@ -3512,9 +3638,11 @@ /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-sticky/ @curtisw0 +/types/react-sticky-el/ @jbraithwaite /types/react-stickynode/ @tstirrat /types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia /types/react-svg/ @viccrubs @chrisgarber +/types/react-svg-inline/ @kiyopikko /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @@ -3523,7 +3651,7 @@ /types/react-syntax-highlighter/ @NoHomey /types/react-table/ @royxue @psakalo @Havret /types/react-tabs/ @danez -/types/react-tag-input/ @Ogglas @jankarres +/types/react-tag-input/ @Ogglas @jankarres @matthewberryman /types/react-tagcloud/ @wassname /types/react-tagsinput/ @mykter /types/react-tap-event-plugin/ @mxl @@ -3541,7 +3669,7 @@ /types/react-touch/ @grzesie2k /types/react-tracking/ @alloy /types/react-transition-group/v1/ @LKay -/types/react-transition-group/ @LKay +/types/react-transition-group/ @LKay @Epskampie /types/react-treeview/ @janslow /types/react-truncate/ @mattvperry /types/react-twitter-auth/ @paulfasola @@ -3551,7 +3679,7 @@ /types/react-virtualized-select/ @seansfkelley /types/react-webcam/ @squat /types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz /types/react-widgets-moment/ @dawnmist /types/react-youtube/ @kgtkr /types/react-youtube-embed/ @charles-salmon @@ -3571,7 +3699,7 @@ /types/reapop/ @Barrokgl /types/recaptcha2/ @l-jonas /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow /types/recluster/ @dex4er /types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra /types/reconnectingwebsocket/ @nguarracino @@ -3597,12 +3725,13 @@ /types/redux-devtools-dock-monitor/ @mc-petry /types/redux-devtools-log-monitor/ @mc-petry /types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz /types/redux-first-router-link/ @janb87 /types/redux-first-router-restore-scroll/ @icopp +/types/redux-first-routing/ @tlaziuk /types/redux-form/v4/ @aikoven /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @reggino @maddijoyce /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray @@ -3612,8 +3741,10 @@ /types/redux-localstorage-debounce/ @LKay /types/redux-localstorage-filter/ @LKay /types/redux-logger/ @arusakov @kgroat +/types/redux-mock-store/v0/ @MarianPalkus /types/redux-mock-store/ @MarianPalkus /types/redux-optimistic-ui/ @asvetliakov +/types/redux-orm/ @keenondrums /types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack /types/redux-persist-transform-encrypt/ @LKay @dante-101 /types/redux-persist-transform-filter/ @LKay @@ -3627,21 +3758,23 @@ /types/redux-storage-engine-jsurl/ @screendriver /types/redux-storage-engine-localstorage/ @screendriver /types/redux-test-utils/ @huwmartin +/types/redux-testkit/ @Bookler96 /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd /types/ref-struct/ @loyd /types/ref-union/ @loyd -/types/reflux/ @mauricedb +/types/reflux/v0/ @mauricedb +/types/reflux/ @mauricedb @LiangZugeng /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy /types/remarkable/ @makepost -/types/remote-redux-devtools/ @ColinEberhardt @unindented +/types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella /types/request-as-curl/ @atd-schubert /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt @@ -3663,7 +3796,8 @@ /types/restangular/ @borisyankov /types/restful.js/ @tkqubo /types/restify/v4/ @blittle @stevehipwell -/types/restify/ @blittle @stevehipwell @leanazulyoro +/types/restify/v5/ @blittle @stevehipwell @leanazulyoro +/types/restify/ @blittle @stevehipwell @leanazulyoro @mgebundy /types/restify-cookies/ @weekens /types/restify-cors-middleware/ @dthunell /types/restify-errors/ @stevehipwell @@ -3696,6 +3830,7 @@ /types/roads/ @dancespiele /types/roads-server/ @dancespiele /types/roll/ @icopp +/types/rolling-rate-limiter/ @l-jonas /types/rollup-plugin-json/ @asmockler /types/ronomon__crypto-async/ @BendingBender /types/rosie/ @abner @subvertallchris @abukurov @@ -3713,7 +3848,9 @@ /types/rsync/ @philippstucki /types/rtree/ @oefirouz /types/run-parallel/ @mrmlnc +/types/run-parallel-limit/ @mrmlnc /types/run-sequence/ @k-kagurazaka +/types/runes/ @viralpickaxe /types/rword/ @icopp /types/rx/ @Igorbek /types/rx-angular/ @mickdelaney @@ -3758,6 +3895,7 @@ /types/scalike/ @ryoppy /types/schema-registry/ @bonzzy /types/schwifty/ @ozum +/types/scoped-http-client/ @mattvperry @rianadon /types/screenfull/ @icholy @lionelb @joelshepherd /types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla /types/screeps-profiler/ @ramblurr @@ -3779,6 +3917,7 @@ /types/select2/ @borisyankov @denisname /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch +/types/selenium-standalone/ @SanderDeWaal1992 /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina /types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn /types/semantic-ui/ @leonard-thieu @@ -3811,10 +3950,11 @@ /types/send/ @MikeJerred /types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin /types/sequester/ @Strate +/types/serialize-error/ @thomasthiebaud /types/serialize-javascript/ @lith-light-g /types/serialport/v4/ @codefoster /types/serialport/ @codefoster @apearson @@ -3822,6 +3962,7 @@ /types/serve-index/ @tkrotoff /types/serve-static/ @urossmolnik @LinusU /types/server-destroy/ @gyszalai +/types/servicenow/ @bryceg /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser @@ -3840,7 +3981,7 @@ /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher -/types/shopify-buy/ @openminder +/types/shopify-buy/ @openminder @straiforos /types/shortid/ @stpettersens @despairblue /types/shot/ @AJamesPhillips /types/should-sinon/ @Arylo @@ -3850,10 +3991,11 @@ /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen /types/sigmund/ @BendingBender +/types/signale/ @resir014 @kingdaro @rjoydip /types/signalr/ @borisyankov @keesey @GiedriusGrabauskas /types/signalr-no-jquery/ @gjoshevski /types/signals/ @diullei -/types/signature_pad/ @AbubakerB @jrmihalick +/types/signature_pad/ @AbubakerB @jrmihalick @leejaedus /types/simple-assign/ @NoHomey /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- @@ -3871,7 +4013,8 @@ /types/single-line-log/ @ffflorian /types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg /types/sinon-as-promised/ @igrayson -/types/sinon-chai/ @kazimanzurrashid @jedmao +/types/sinon-chai/v2/ @kazimanzurrashid @jedmao +/types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt /types/sinon-chrome/ @pimterry @crimx @kobanyan /types/sinon-express-mock/ @jpchip @tlaziuk /types/sinon-mongoose/ @stevehipwell @@ -3880,6 +4023,7 @@ /types/sip.js/ @decyrus /types/sipml/ @chookies /types/sitemap2/ @shundy +/types/six-runtime/ @493636333 /types/sizzle/ @leonard-thieu /types/sjcl/ @Evgenus /types/skatejs/ @Hotell @@ -3889,7 +4033,12 @@ /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr +/types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan +/types/slate-base64-serializer/ @YangusKhan +/types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee +/types/slate-plain-serializer/ @YangusKhan +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan /types/sleep/ @rajarz /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii @@ -3903,20 +4052,21 @@ /types/smtpapi/ @a-morales /types/snapsvg/ @lhk @mattanja @kant2002 /types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @DarkerTV @ShayBox @Dev-Yukine +/types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine /types/snoowrap/ @vitosamson @TheAppleFreak /types/snowboy/ @dolanmiu -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi +/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro /types/socket.io-client/ @progre @divillysausages @florentpoujol /types/socket.io-parser/ @plantain-00 /types/socket.io-redis/ @nupplaphil @seeLuck /types/socket.io.users/ @kataras +/types/socketio-jwt/ @ehallander9591 /types/socketio-jwt-auth/ @codeanimal /types/socketio-wildcard/ @BendingBender /types/socketty/ @Nax /types/sockjs/ @pmccloghrylaing /types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk -/types/solidity-parser-antlr/ @LogvinovLeon +/types/solidity-parser-antlr/ @LogvinovLeon @albrow /types/solr-client/ @liul85 /types/solution-center-communicator/ @dami-gg /types/sort-array/ @mrmlnc @@ -3942,6 +4092,8 @@ /types/split/ @marcinporebski /types/split.js/ @icholy /types/split2/ @mugeso +/types/splunk-bunyan-logger/ @bricka +/types/splunk-logging/ @bricka /types/spotify-api/ @skovmand /types/spotify-web-playback-sdk/ @Festify @mraerino @NeoLegends /types/sprintf/ @soywiz @BendingBender @@ -3963,8 +4115,9 @@ /types/stacktrace-js/ @exceptionless @pilagod /types/stale-lru-cache/ @cxcorp /types/stampit/v2/ @koresar -/types/stampit/ @koresar +/types/stampit/ @koresar @lummish /types/stamplay-js-sdk/ @ridermansb +/types/starwars-names/ @claasahl /types/stat-mode/ @BendingBender /types/stats.js/ @gregolai @hberntsen @danvk /types/statsd-client/ @peterkooijmans @chrisleck @@ -3975,7 +4128,7 @@ /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj +/types/stellar-sdk/ @carl-foster @tristonj @pselden /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompjs/ @jimic @Dr4k4n @@ -3987,12 +4140,16 @@ /types/storybook__addon-info/ @mkornblum @fyrkant /types/storybook__addon-knobs/ @joscha @martynaskadisa /types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha -/types/storybook__addon-options/ @joscha @simonhn +/types/storybook__addon-notes/ @joscha @amacleay +/types/storybook__addon-options/ @joscha @simonhn @amacleay /types/storybook__addon-storyshots/ @bradleyayers /types/storybook__react/ @joscha @wapgear +/types/storybook__react-native/ @joscha @wapgear @alechill /types/storybook__vue/ @pntgupta /types/stream-buffers/ @Jason3S +/types/stream-chain/ @uhop +/types/stream-csv-as-json/ @uhop +/types/stream-json/ @uhop /types/stream-meter/ @mugeso /types/stream-series/ @k-kagurazaka /types/stream-to-array/v0/ @Bartvds @@ -4000,18 +4157,20 @@ /types/stream-to-promise/ @Alorel /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb +/types/streamtest/ @lummish /types/strftime/ @cyrilschumacher /types/strict-uri-encode/ @hoishin /types/string/ @basp /types/string-hash/ @ethanrubio /types/string-similarity/ @ragtime /types/string-template/ @TonyPythoneer +/types/string-width/ @jacobbubu /types/string_score/ @marcinporebski /types/stringify-object/ @khoomeister /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @@ -4021,6 +4180,7 @@ /types/strophe/ @DavidKDeutsch /types/structured-source/ @azu /types/styled-jsx/ @R1ZZU +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh /types/stylelint/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylus/ @SomaticIT @@ -4029,7 +4189,9 @@ /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting +/types/summernote/ @wstaelens @nusantara-cloud /types/sumo-logger/ @forabi @clementallen +/types/suncalc/ @horiuchi /types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf /types/superagent-no-cache/ @mxl @@ -4043,6 +4205,7 @@ /types/svg-parser/ @mrmlnc /types/svg-path-bounding-box/ @NotWoods /types/svg-sprite/ @tkqubo +/types/svg-sprite-loader/ @rynclark /types/svg2png/ @hansrwindhoff @sccgithub /types/svg4everybody/ @BendingBender /types/svgjs.draggable/ @LiFeleSs @@ -4062,6 +4225,8 @@ /types/swagger-sails-hook/ @micmro /types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt /types/swagger-tools/ @bricka +/types/swagger-ui-dist/ @haowen737 +/types/swagger-ui-express/ @dmitryrogozhny /types/swaggerize-express/ @mugeso @nickmorton /types/swe-validation/ @hjalmers /types/swfobject/ @rou @@ -4085,13 +4250,13 @@ /types/tabulator/ @euginio /types/tail/ @spacejack /types/tapable/v0/ @e-cloud -/types/tapable/ @e-cloud +/types/tapable/ @e-cloud @johnnyreilly /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht /types/tcp-ping/ @stegano -/types/tedious/ @rogierschouten @cjthompson +/types/tedious/ @rogierschouten @cjthompson @v-suhame /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi /types/temp/ @DanielRosenwasser @@ -4099,20 +4264,23 @@ /types/tempfile/ @SamVerschueren @BendingBender /types/tempy/ @douglasduteil /types/terminal-menu/ @aravindarun +/types/test-listen/ @stephenmathieson /types/testingbot-api/ @timbru31 /types/tether/ @adidahiya /types/tether-drop/ @adidahiya /types/tether-shepherd/ @mtgibbs /types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 +/types/text-encoding/ @pine613 @mohsen1 /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey +/types/textversionjs/ @aaronosher +/types/tgfancy/ @Dabolus /types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender -/types/throttle-debounce/ @czbuchi +/types/throttle-debounce/ @czbuchi @franklixuefei /types/through/ @AndrewGaspar /types/through2/v0/ @Bartvds @jedmao /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @@ -4124,18 +4292,23 @@ /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici +/types/tinajs__tina/ @Jimexist +/types/tinajs__tina-redux/ @Jimexist /types/tinder/ @pingec /types/tiny-slider-react/ @screendriver /types/tinycolor2/ @M-Zuber @geertjansen @nvh +/types/tinycon/ @dwaxweiler /types/tinycopy/ @vvatanabe /types/tinymce/ @martinduparc @ipoul @nicohartto /types/titanium/ @appcelerator @janvennemann /types/title/ @fa7ad /types/tldjs/ @geoffreak +/types/tlds/ @ajshres /types/tmp/ @optical @Perlmint /types/to-absolute-glob/ @ajafff /types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman +/types/to-snake-case/ @LogvinovLeon /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss @@ -4162,6 +4335,7 @@ /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve +/types/triplesec/ @threesquared /types/trunk8/ @niemyjski /types/tryer/ @bengry /types/tspromise/ @soywiz @@ -4173,7 +4347,7 @@ /types/tweezer.js/ @praxxis /types/twig/ @soywiz @enko /types/twilio/ @nickiannone @ashleybrener -/types/twit/ @Volox @lostfictions @sapphiredev +/types/twit/ @Volox @lostfictions @sapphiredev @abraham /types/twitter/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan /types/twitter-text/ @rhysd @@ -4191,7 +4365,7 @@ /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo /types/uglify-js/v2/ @tkrotoff -/types/uglify-js/ @alan-agius4 @tkrotoff +/types/uglify-js/ @alan-agius4 @tkrotoff @johnnyreilly /types/uglifycss/ @blendsdk /types/uglifyjs-webpack-plugin/ @vajkayrene /types/ui-grid/ @btesser @joeskeen @pbojanczyk @@ -4216,12 +4390,12 @@ /types/unist/ @bizen241 /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV -/types/universal-router/ @jtmthf +/types/universal-router/ @jtmthf @tlaziuk @Lodin /types/unorm/ @chbrown /types/untildify/ @BendingBender /types/unused-filename/ @BendingBender /types/unzip/ @coding2012 -/types/unzipper/ @s73obrien @natemara +/types/unzipper/ @s73obrien @natemara @bartje321 /types/update-notifier/v1/ @vvakame @nchen63 /types/update-notifier/ @vvakame @nchen63 @bitjson /types/upng-js/ @plantain-00 @@ -4234,7 +4408,7 @@ /types/url-join/ @rogierschouten @devrelm /types/url-metadata/ @mrkmg /types/url-params/ @danielsogl -/types/url-parse/ @ChernenkoPaul +/types/url-parse/ @ChernenkoPaul @harisiva /types/url-regex/ @unindented /types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi @@ -4255,6 +4429,7 @@ /types/uuid/ @iamolivinius @felipeochoa @cjbarth /types/uuid-1345/ @mugeso /types/uuid-js/ @mhegazy +/types/uuid-parse/ @screendriver /types/uuid-validate/ @HiromiShikata /types/uws/ @plantain-00 @orblazer /types/valdr/ @ilbertz @@ -4275,11 +4450,12 @@ /types/verror/ @svi3c @max4t /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan +/types/vexdb/ @MayorMonty /types/vexflow/ @rquiring @sebastianhaas @bohoffi /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas +/types/victory/ @asvetliakov @snerks @Havret @alredyExist +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 /types/viewporter/ @borisyankov @@ -4292,7 +4468,7 @@ /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura /types/vision/v4/ @jasonswearingen @AJamesPhillips /types/vision/ @jasonswearingen @AJamesPhillips @lenovouser /types/vitalsigns/ @cyrilschumacher @@ -4304,10 +4480,12 @@ /types/voronoi-diagram/ @michaelneu /types/vortex-web-client/ @Pro /types/voximplant-websdk/ @aylarov +/types/vue-color/ @me /types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs -/types/vuex-i18n/ @jaeggerr +/types/vue2-datepicker/ @ChristianStornowski +/types/vuex-i18n/ @jaeggerr @noamkfir /types/w2ui/ @Ptival /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium @@ -4331,6 +4509,8 @@ /types/weapp-api/ @vargeek /types/web-animations-js/ @kritollm /types/web-bluetooth/ @urish +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino +/types/web3-eth-abi/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin /types/webassembly-js-api/ @periklis /types/webcl/ @NCARalph @@ -4343,27 +4523,33 @@ /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions /types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @christophehurpeau -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham /types/webpack-cleanup-plugin/ @malj +/types/webpack-config-utils/ @hotell /types/webpack-dev-middleware/v1/ @bumbleblym @reduckted -/types/webpack-dev-middleware/ @bumbleblym @reduckted -/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 +/types/webpack-dev-middleware/ @bumbleblym @reduckted @chrisabrams +/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 @arturovt /types/webpack-dotenv-plugin/ @kryops /types/webpack-env/ @use-strict @rhonsby /types/webpack-fail-plugin/ @deevus -/types/webpack-hot-middleware/ @bumbleblym @icylace +/types/webpack-hot-client/ @rynclark @ZSkycat +/types/webpack-hot-middleware/ @bumbleblym @icylace @chrisabrams /types/webpack-manifest-plugin/ @r3nya /types/webpack-merge/v0/ @deevus /types/webpack-merge/ @deevus @mtraynham /types/webpack-node-externals/ @mtraynham /types/webpack-notifier/ @bumbleblym +/types/webpack-serve/v1/ @rynclark @Jokcy @ZSkycat +/types/webpack-serve/ @rynclark @Jokcy @ZSkycat /types/webpack-sources/ @e-cloud @chriseppstein /types/webpack-stream/ @iclanton @bumbleblym /types/webpack-validator/ @deevus +/types/webpackbar/ @rynclark /types/webrtc/ @nakakura +/types/website-scraper/ @screendriver /types/websocket/ @loyd @flynetworks @zhaoleimxd @jdneo /types/webspeechapi/ @saschanaz /types/websql/ @TeamworkGuy2 @@ -4373,8 +4559,10 @@ /types/weighted/ @ccitro /types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil +/types/wepy/ @Jimexist +/types/wepy-redux/ @Jimexist /types/whatwg-mimetype/ @petejohanson -/types/whatwg-streams/ @saschanaz @ksm2 +/types/whatwg-streams/ @saschanaz @ksm2 @MattiasBuelens /types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 @@ -4391,8 +4579,8 @@ /types/winjs/ @adamhewitt627 @craigktreasure @xirzec /types/winreg/ @RX14 @BobBuehler /types/winrt-uwp/ @saschanaz @taylor224 -/types/winston/ @bonnici @codeanimal @DABH /types/winston-dynamodb/ @nickiannone +/types/winston-mail/ @idono87 /types/winston-syslog/ @cjbarth /types/wiring-pi/ @NoHomey /types/wnumb/ @acoreyj @@ -4400,6 +4588,8 @@ /types/word-list-json/ @dovidm /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen +/types/workbox-sw/ @wessberg +/types/workerpool/ @Alorel /types/wpapi/ @guoyunhe /types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr @@ -4421,7 +4611,7 @@ /types/xdg-basedir/ @tlaziuk /types/xml/ @YuJianrong /types/xml-parser/ @mhfrantz -/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath +/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl /types/xml2json/ @dolanmiu /types/xmlbuilder/ @wallymathieu /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge @@ -4443,12 +4633,15 @@ /types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney /types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yargs-interactive/ @szeck87 /types/yauzl/ @ffflorian +/types/yauzl-promise/ @dlee-nvisia /types/yayson/ @Codesleuth /types/yazl/ @taoqf /types/ydn-db/ @yathit @gabrielmaldi /types/yeoman-generator/ @armorik83 @janslow @ikatyang /types/yeoman-test/ @ikatyang +/types/yesql/ @Sumolari /types/yog-bigpipe/ @ssddi456 /types/yog-log/ @ssddi456 /types/yog2-kernel/ @ssddi456 @@ -4460,13 +4653,14 @@ /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers /types/zeit__next-typescript/ @icopp -/types/zen-observable/ @aicest +/types/zen-observable/ @aicest @JounQin @itomtom /types/zen-push/ @daprahamian /types/zenscroll/ @HamedFathi /types/zepto/ @jbaldwin /types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu /types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu /types/zeromq/ @davemckeown @erikma @TitaneBoy +/types/zip-webpack-plugin/ @blaise-io /types/zip.js/ @lgrignon /types/zipcodes/ @headdetect /types/zipkin-context-cls/ @plantain-00 diff --git a/README.ko.md b/README.ko.md new file mode 100644 index 0000000000..224967a9dc --- /dev/null +++ b/README.ko.md @@ -0,0 +1,338 @@ +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) + +[![깃터(https://gitter.im/borisyankov/DefinitelyTyped)에서 대화에 참여해보세요](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +> 이 저장소는 고품질의 타입스크립트(TypeScript) 자료형 정의(Type definition)를 위한 저장소입니다. + +이 문서가 가장 최신 내용을 담고있긴 하지만, [공식 사이트(definitelytyped.org)](http://definitelytyped.org)도 확인해보시면 좋습니다. + +## 선언 파일(Declaration file)이 뭔가요? + +[타입스크립트 안내서(TypeScript handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)를 읽어보세요. + +## 선언 파일(Declaration file)을 어떻게 받을 수 있나요?? + +### npm 사용하기 + +아래 방법은 타입스크립트(TypeScript) 2.0+ 이상의 버전을 사용하는 사람들만 사용할 수 있는 방법이기는 합니다만, 이 방법을 사용하기를 장려합니다. + +```sh +npm install --save-dev @types/node +``` + +`node` 를 위한 자료형(Typing)이 컴파일 과정에 자동으로 포함될 겁니다. +더 자세한 내용은 [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)에서 확인해보실 수 있습니다. + +NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입니다. +원하시는 패키지를 찾을 수 없는 경우, [타입서치(TypeSearch)](https://microsoft.github.io/TypeSearch/) 사이트에서 한 번 찾아보세요. + +타입서치(TypeSearch)에서도 찾을 수 없는 경우, 찾고 있는 패키지가 자료형(Typing)을 +[함께 제공](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하고 있지는 않은지 확인해보세요. +패키지에 포함된 자료형(Typing)은 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, +`/// ` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다. + + +### 그 외의 방법들 + +타입스크립트(TypeScript) 1.0 버전에서 사용할 수 있는 방법은 다음과 같습니다. + +* [Typings](https://github.com/typings/typings) 을 사용하기 +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) 을 사용하기~~ (다른 방법을 사용해주세요. NuGet 은 더 이상 DT 자료형(Typing)을 제공하지 않습니다.) +* 이 저장소의 `master` 브랜치를 직접 내려받기 + +위 방법을 사용할 경우 수동으로 [참조(Reference)](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)를 추가해주어야 할 수 있습니다. + + +## 어떻게 이곳에 기여할 수 있나요? + +여러분과 같은 많은 기여자들의 도움 덕분에 이 저장소가 돌아가고 있습니다. 감사합니다. + +### 테스트 + +여러분이 만든 자료형 선언(Type declation)을 세상에 공유하기에 앞서, 여러분이 스스로 여러분의 자료형 선언(Type declation)을 사용하고 확인해주세요. + +#### 이미 존재하는 자료형 패키지를 임시로 수정하기 + +이미 존재하는 패키지의 자료형 선언(Type declaration)에 새로운 기능을 추가하려면 [모듈 증강(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다. +물론 `node_modules/@types/foo/index.d.ts` 를 직접 수정하실 수도 있으며, 이 파일을 복사한 다음 아래의 과정을 따라하실 수도 있습니다. + + +#### 새 자료형 패키지를 임시로 추가하기 + +사용하고 계신 `tsconfig.json` 에 다음 내용을 추가해주세요. + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(`types` 대신 `src/types` 을 사용하실 수도 있습니다.) +그리고 "foo" 모듈(Module)에 대한 선언(Declaration)을 포함하는 `types/foo/index.d.ts` 파일을 만들어주세요. +이제 코드 안에서 여러분의 새 자료형 선언(Type declaration)을 사용하는 `"foo"` 모듈(Module)을 임포트(Import)하실 수 있을 겁니다. +코드를 컴파일하고 실행시켜서 여러분의 자료형(Typing)이 실행 중에 실제로 벌어지는 일과 잘 맞아떨어지는지 확인해주세요. +실제 코드를 통한 확인이 끝나면, [풀 리퀘스트(Pull request)](#풀-리퀘스트pull-request-만들기)를 만들어주세요. +[이미 존재하는 패키지를 수정](#이미-존재하는-패키지를-수정하기)하거나 [새 패키지를 만들기](#새-패키지-만들기)위한 과정들을 따라하시면 됩니다. + + +### 풀 리퀘스트(Pull request) 만들기 + +여러분의 자료형 선언이 잘 작동하는지 확인하셨다면, DefinitelyTyped 에 공유해주세요. + +우선, 이 저장소를 [포크(fork)](https://guides.github.com/activities/forking/)해 주시고, [node](https://nodejs.org/) 를 설치하신 뒤, `npm install` 명령을 실행해주세요. + + +#### 이미 존재하는 패키지를 수정하기 + +* `cd types/my-package-to-edit` 명령을 실행합니다. +* 자료형(Typing) 파일들을 수정합니다. 테스트를 추가하는 것도 잊지마세요! + 만약 브레이킹 체인지(Breaking change)를 만드셨다면, [메이저 버전(major version)](#i-want-to-update-a-package-to-a-new-major-version)을 꼭 올려주세요. +* 패키지 머릿주석의 "Definitions by" 부분에 여러분의 이름을 추가하실 수도 있습니다. + - 이름을 추가하시면 다른 사람들이 그 패키지에 대한 풀 리퀘스트(Pull request)나 이슈(Issue)를 만들 때 여러분에게 알람이 갑니다. + - `// Definitions by: Alice , Bob ` 와 같이 여러분의 이름을 줄의 맨 마지막에 추가할 수 있습니다. + - 사람이 너무 많을 경우엔, 다음과 같이 여러 줄로 쓰실 수도 있습니다. + ```typescript + // Definitions by: Alice + // Bob + // Steve + // John + ``` +* `tslint.json` 파일이 있는 경우에는, `npm run lint package-name` 명령을 실행시키고 결과를 확인해주세요. 그렇지 않은 경우에는, 해당 패키지가 있는 디렉토리 안에서 `tsc` 명령을 실행시키고 결과를 확인해주세요. + +이미 존재하는 패키지에 대한 풀 리퀘스트(Pull request)를 만들었을 경우에는, `dt-bot` 이 이전 저자들을 자동으로 호출하는지 확인해주세요. +그렇지 않은 경우에는, 여러분이 직접 풀 리퀘스트(Pull request)와 관계있는 사람들을 호출할 수도 있습니다. + + +#### 새 패키지를 만들기 + +만약 라이브러리를 만드는 중이고 라이브러리가 타입스크립트(TypeScript)로 쓰여있다면, DefinitelyTyped 에 선언(Declaration)을 올리는 대신 패키지에 [자동생성된 선언(Declaration) 파일을 포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)시킬 수 있습니다. + +NPM 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 패키지의 이름과 같은 이름의 디렉토리를 만들어주세요. +NPM 에 올라가 있지 않은 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 그 패키지가 NPM 에 올라와 있는 패키지와 이름이 겹치지 않는지 확인해주세요. +(`npm info foo` 명령어를 사용하여 `foo` 패키지가 NPM 에 있는지 확인할 수 있습니다.) + +새 자료형 패키지는 다음과 같은 구조로 구성되어있어야만 합니다. + +| 파일 이름 | 용도 | +| --- | --- | +| index.d.ts | 패키지를 위한 자료형(Typing)을 포함하는 파일입니다. | +| foo-tests.ts | 자료형(Typing)의 테스트를 위한 파일입니다. 이 파일의 코드는 실행되지는 않지만, 자료형 검사(Type checking)를 통과해야 합니다. | +| tsconfig.json | `tsc` 명령을 돌릴 수 있게 해주는 파일입니다. | +| tslint.json | 린터(Linter)를 사용할 수 있게 해주는 파일입니다. | + +이 파일들은, npm ≥ 5.2.0 에서는 `npx dts-gen --dt --name my-package-name --template module` 명령으로, +그 이하 경우에는 `npm install -g dts-gen` 와 `dts-gen --dt --name my-package-name --template module` 명령으로 만들 수 있습니다. +`dts-gen` 의 모든 옵션(Option)을 보고싶으시면 [dts-gen](https://github.com/Microsoft/dts-gen) 저장소를 확인해주세요. + +자료형(Typing) 패키지에 새 파일을 추가하거나, `async` 키워드를 사용하기 위해 `"target"` 을 `"es6"` 로 설정하거나, `"lib"` 를 추가하거나, `jsx` 지원을 추가하기 위해서 `tsconfig.json` 파일을 변경해야 할 수도 있습니다. + +DefinitelyTyped 의 관리자들이 주기적으로 새로운 풀 리퀘스트(Pull request)들을 확인하기는 하지만, +다른 풀 리퀘스트(Pull request)가 많을 경우 확인이 느려질 수 있다는 걸 알아주세요. + +[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 패키지는 좋은 예시 중 하나입니다. + + +#### 많이 저지르는 실수들 + +* 우선, [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)에 나와있는 내용들을 따라주세요. +* 코드에서는 모든 곳에서 탭(Tab)을 사용하거나, 항상 4 개의 띄어쓰기를 사용해주세요. +* `function sum(nums: number[]): number`의 경우, 만약 함수가 인자를 변경하지 않는다면 `ReadonlyArray` 를 사용해주세요. +* `interface Foo { new(): Foo; }`의 경우, + 이런 선언은 이 형(Type)을 가진 객체(Object)에 `new` 를 사용할 수 있도록 만듭니다. 많은 경우 여러분은 `declare class Foo { constructor(); }` 를 사용하려는 것일 겁니다. +* `const Class: { new(): IClass; }`의 경우, + `new` 를 사용할 수 있는 상수를 만드는 대신, `class Class { constructor(); }` 와 같이 클래스 선언(Class declaration)을 사용하는 게 더 좋습니다. +* `getMeAT(): T`의 경우, + 만일 자료형 매개변수(Type parameter)가 함수의 매개변수에 등장하지 않는다면, 그런 제너릭(Generic) 함수를 사용할 필요가 없습니다. + 그 제너릭(Generic) 함수는 단순히 자료형 단언(Type assertion)을 위장시킨 것뿐입니다. 이 경우 `getMeAT() as number` 와 같이 진짜 자료형 단언(Type assertion) 을 사용하는 게 더 좋습니다. + 다음은 괜찮은 제너릭(Generic)의 예시입니다. `function id(value: T): T;`. + 다음은 문제가 있는 제너릭(Generic)의 예시입니다. `function parseJson(json: string): T;`. + 예외적으로, `new Map()` 와 같은 경우는 괜찮습니다. +* `Function` 이나 `Object` 와 같은 형(Type)을 사용하는 것은 대부분의 경우 문제를 일으킵니다. 99% 의 경우 더 구체적인 형(Type)을 사용하는게 가능합니다. [함수(Function)](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) 를 위해서는 `(x: number) => number` 와 같은, 객체를 위해서는 `{ x: number, y: number }` 와 같은 형(Type)들을 사용할 수 있습니다. 형(Type)에 대한 정보가 전혀 없을 경우에는, `Object` 형(Type)이 아니라 [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) 형(Type)을 사용해야 합니다. 만일 어떤 형(Type)이 객체라는 사실만 알고 있는 경우, `Object` 나 `{ [key: string]: any }` 가 아니라 [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type) 를 사용해주세요. +* `var foo: string | any`의 경우, + `any` 가 합 자료형(Union type)의 안에서 사용될 경우, 결과 형(Type)은 언제나 `any` 가 됩니다. 따라서 형(Type)의 `string` 부분이 유용해 보인다 하더라도, 사실은 자료형 검사(Type checking)의 측면에서 `any` 와 다른 것이 없습니다. + 대신, `any`, `string`, 나 `string | object` 중 하나를 필요에 맞게 골라서 사용해주세요. + + +#### 패키지 삭제하기 + +패키지가 스스로의 형(Type)을 [포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하게 되면, DefinitelyTyped 에 있는 자료형(Typing) 패키지를 삭제하는 것이 좋습니다. + +`npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]` 명령어를 사용하여 자료형(Typing) 패키지를 삭제할 수 있습니다. +- `typingsPackageName` 는 삭제할 디렉토리의 이름입니다. +- `asOfVersion` 는 새 스텁(Stub) 용 `@types/foo` 를 퍼블리시(Publish)할 버전입니다. 이 버전은 현재 NPM 에 올라간 버전보다 더 높은 버전이어야 합니다. +- `sourceRepoURL` 는 자료형(Typing)을 포함하게 된 저장소의 주소입니다. +- `libraryName` 는 패키지의 이름을 읽기 쉽게 쓴 것입니다. 즉, "angular2" 대신에 "Angular 2" 와 같이 쓰는 것이 좋습니다. (생략했을 경우에는 "typingsPackageName" 와 같은 것으로 취급됩니다.) + +DefinitelyTyped 의 다른 패키지들이 삭제된 자료형(Typing) 패키지를 사용하고 있을 경우, 형(Type)을 포함하기 시작한 원래 패키지를 사용하도록 수정해야합니다. 삭제된 자료형(Typing) 패키지를 사용하는 각 DefinitelyTyped 패키지들의 `package.json` 파일에 `"dependencies": { "foo": "x.y.z" }` 를 추가해주시면 됩니다. + +DefinitelyTyped 에 한 번도 올라온 적 없는 패키지가 형(Type)을 포함하게 되었다면, `notNeededPackages.json` 파일에 추가할 필요도 없습니다. + + +#### 린트(Lint)하기 + +자료형(Typing) 패키지를 린트(Lint)하려면, 패키지 디렉토리에 `{ "extends": "dtslint/dt.json" }` 를 포함하고 있는 `tslint.json` 파일을 추가해주시면 됩니다. 모든 새 패키지는 해당 파일을 가지고 있어야 합니다. +고쳐야 하지만 아직 고쳐지지 않은 린트(Lint) 결과가 있을 때에만 `tslint.json` 에서 린트 규칙(Lint rule)을 사용하지 않도록 설정할 수 있습니다. 예를 들어, + +```js +{ + "extends": "dtslint/dt.json", + "rules": { + // 이 패키지는 Function 형을 사용하고 있으며, 고치는 게 쉽지 않다. + "ban-types": false + } +} +``` + +(린트 규칙(Lint rule)이 절대로 적용되서는 안되는 경우에는, `// tslint:disable rule-name` 나 `//tslint:disable-next-line rule-name` 를 사용하는 것이 좋습니다. 후자가 더 나은 방식입니다.) + +어떤 표현식(Expression)이 특정한 형(Type)을 가진다고 단언(Assert)하고 싶을 때에는 `$ExpectType` 를 사용하시면 됩니다. 어떤 표현식(Expression)이 컴파일에 실패해야하는 경우에는 `$ExpectError` 를 하시면 됩니다. + +```js +// $ExpectType void +f(1); + +// $ExpectError +f("one"); +``` + +[dtslint](https://github.com/Microsoft/dtslint#write-tests) 저장소의 README 파일에서 더 자세한 내용을 확인하실 수 있습니다. + +이런 테스트들은 `npm run lint package-name` 명령으로 실행해볼 수 있습니다. 이 때, `package-name` 은 테스트하고 싶은 패키지의 이름입니다. +테스트 스크립트는 [dtslint](https://github.com/Microsoft/dtslint) 를 사용하고 있습니다. + + +## 자주 하는 질문들 + +#### 이 저장소와 `@types` 패키지들이 대체 무슨 관계가 있는 건가요? + +`master` 브랜치(Branch)의 내용들이 [types-publisher](https://github.com/Microsoft/types-publisher) 를 사용해 자동으로 `@types` 퍼블리시(Publish)됩니다. + +#### 풀 리퀘스트(Pull request)를 제출했습니다. 이게 합쳐질 때까지 얼마나 걸리나요? + +상황에 따라 다르지만, 대부분의 풀 리퀘스트(Pull request)들은 일주일 안에 합쳐집니다. 머릿주석에 있는 저자 중 한명에 의해 승인된 풀 리퀘스트(Pull request)는 보통 더 빨리 합쳐집니다. 새로운 패키지에 대한 풀 리퀘스트(Pull request)는 관리자의 세세한 코드 리뷰를 필요로 하기 때문에 더 오래 걸리는 경우가 많습니다. 각 PR 들은 합쳐지기 전에 TypeScript or DefinitelyTyped 팀 구성원의 코드 리뷰를 받아야 하며, 이는 사람이 하는 일이기 때문에 느려질 수도 있으니 양해를 바랍니다. [풀 리퀘스트 번다운 보드(PR Burndown Board)](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen)에서 열린 풀 리퀘스트에 대한 관리자들의 진행도를 확인하실 수 있습니다. + +#### 내 풀 리퀘스트(Pull request)는 합쳐졌습니다. 언제 NPM 에 `@types` 패키지가 갱신되나요? + +NPM 의 패키지들은 수시간 안에 갱신될 겁니다. 만약 24 시간이 지나도 갱신되지 않으면, 문제를 파악하기 위해 @RyanCavanaugh 나 @andy-ms 를 풀 리퀘스트(Pull request)에서 호출해주세요. + +#### 다른 자료형 정의(Type definition)에 의존하는 자료형 정의(Type definition)을 만들고 있습니다. `` 와 임포트(import) 중 무엇을 사용해야하나요? + +외부 모듈(`export` 를 사용하는 모듈)을 사용할 경우, 임포트(import)를 사용해주세요. +환경과 관련된 모듈(ambient module)(`declare module` 를 쓰거나 전역 변수들을 선언한 모듈)을 사용할 경우, `` 를 사용해주세요. + +#### `package.json` 파일이 가끔 보이던데? + +일반적으로는 `package.json` 파일을 사용할 필요가 없습니다. 패키지가 퍼블리시(Publish)될 때 패키지를 위한 `package.json` 파일은 자동으로 생성됩니다. +가끔 보이는 `package.json` 파일은 의존하는 것들을 표시하기 위해 사용됩니다. [예시](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json)를 한 번 보세요. +의존성을 제외한 다른 필드(Field)들, 그러니까 `"description"` 같은 것들은 사용해서는 안됩니다. +옛날 `@types` 패키지를 사용하고 싶으실 경우에도 `"dependencies": { "@types/foo": "x.y.z" }` 와 같은 내용을 `package.json` 파일에 넣으셔야 합니다. + +#### 어떤 패키지들에 `tslint.json` 이 없거나, `tsconfig.json` 에 `"noImplicitAny": true`, `"noImplicitThis": true`, 나 `"strictNullChecks": true` 가 없어요. + +그럼 그 패키지들이 잘못된 겁니다. 고쳐서 풀 리퀘스트(Pull request)를 제출해주시면 고맙겠습니다. + +#### 자료형 정의(Type definition)을 요청할 수 있나요? + +이미 요청된 자료형 정의(Type definition)들을 [여기서](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest) 보실 수 있습니다. + +#### DOM 을 위한 자료형 정의(Type definitions)는요? + +웹 표준(Web standard)과 관련이 있는 자료형(Typing)들은 [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) 저장소에 기여해서 고치실 수 있습니다. 고쳐진 자료형(Typing)은 `lib.dom.d.ts` 파일에 포함될 겁니다. + +#### 어떤 패키지가 `export =` 를 쓰고 있는데, 저는 디폴트 임포트(Default import)가 더 좋습니다. `export =` 를 `export default` 로 바꿔도 되나요? + +타입스크립트(TypeScript) 2.7 이상을 사용하고 계시면 프로젝트 안에서 `--esModuleInterop` 를 사용해주세요. +그 이하의 경우, 디폴트 임포트(Default import)가 동작하는 환경(Webpack, SystemJS, esm)에서 작업 중이시면 [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) 를 사용하는 걸 고려해보세요. +자료형 정의(Type definition)가 맞는 경우에는 자료형 정의(Type definition)을 수정하지 마세요. +NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 `export =` 이 맞고, `node -p 'require("foo").default'` 이 원하는 값이라면 `export default` 이 맞습니다. + +#### 자료형 선언(Type declaration)에서 타입스크립트(TypeScript) 2.1 이상의 기능을 사용하고 싶습니다. + +정의(Definition) 머릿주석(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) 뒤에 `// TypeScript Version: 2.1` 를 추가해주시면 됩니다. + +#### 타입스크립트(TypeScript)에 기본으로 포함되지 않은 DOM API 를 추가하고 싶어요. + +[TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme) 저장소가 관련되어있을 가능성이 있습니다. 해당 저장소의 안내를 따라주세요. +해당 표준이 아직 초안인 상태라면, 이 저장소와 관련된 일입니다. +`dom-` 으로 시작하는 패키지를 만드신 뒤, "Project" 머릿주석 부분에 해당 표준의 링크를 써 주세요. +다만 표준이 초안을 벗어나면 DefinitelyTyped 에서 삭제되고 `@types` 패키지가 지원이 중단된(Deprecated) 것으로 표시될 수도 있습니다. + +#### 패키지를 새 메이저 버전(major version)에 맞게 갱신하고 싶어요. + +옛날 버전도 계속해서 수정할 예정이라면, 이전 버전에 해당하는 새 디렉토리(예를 들어 `2.` 버전을 위해서는 `v2`)를 만들고 현재 파일들을 그 디렉토리로 옮겨야 합니다. 새 디렉토리로 옮긴 뒤에는 + +1. `tsconfig.json` 와 `tslint.json` 에 포함된 상대경로들을 수정해주어야 합니다. +2. 경로 대응 규칙(Path mapping rule)을 추가하여 테스트가 올바른 버전을 검사하도록 해야합니다. + +예를 들어, [history 패키지의 2 버전의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) 파일은 다음과 같이 생겼습니다. + +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "history": [ "history/v2" ] + }, + }, + "files": [ + "index.d.ts", + "history-tests.ts" + ] +} +``` + +수정 중인 패키지에 의존하는 DefinitelyTyped 의 다른 패키지들이 새 버전과 호환되지 않을 경우, 그 패키지들에도 옛날 버전으로의 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다. 수정 중인 패키지에 의존하는 패키지에 의존하는 패키지들에도 똑같은 작업을 해 주셔야 합니다. + +예를 들어, `react-router` 패키지는 `history@2` 패키지에 의존하고 있기 때문에, [react-router 패키지의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) 파일이 `"history": [ "history/v2" ]` 와 같은 경로 대응 규칙(Path mapping rule)을 가지고 있는 걸 볼 수 있습니다. +이어서 (`react-router` 패키지에 의존하는 패키지인) `react-router-bootstrap` 또한 [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json) 파일 안에 경로 대응 규칙(Path mapping rule)을 가지고 있는 것을 보실 수 있습니다. + +`/// ` 에서는 경로 대응 규칙(Path mapping rule)이 동작하지 않기 때문에, DefinitelyTyped 패키지로에 의존할 때에는 임포트(import) 를 사용해야 합니다. + +#### 전역적으로도 모듈로도 사용될 수 있는 패키지의 자료형 선언(Type declaration)은 어떻게 쓰나요? + +타입스크립트 안내서(TypeScript Handbook)은 [선언(Declaration)을 쓰는 방법에 대한 전반적인 정보](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)와 [예시들](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html)을 포함하고 있습니다. 이 내용에는 ES6 식의 모듈 문법을 사용할 수 있는 자료형 선언(Type declaration)을 만드는 방법과 객체를 전역에서 사용할 수 있도록 하는 방법이 포함되어 있습니다. [big.js 패키지의 자료형 선언(Type declaration)](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts)이 실례입니다. 이 패키지는 웹 페이지의 스크립트 태그를 사용해 불러올 수 있으며, 또한 ES6 식의 임포트(Import) 구문을 사용해서 불러올 수도 있습니다. + +여러분의 패키지가 임포트(Import) 구문을 사용했을 때와 전역적으로 불렀을 때를 테스트 해보고 싶다면, `test` 디렉토리를 추가하고 `YourLibraryName-global.test.ts` 그리고 `YourLibraryName-module.test.ts` 라는 이름으로 테스트 파일 두 개를 추가해주세요. **전역(Global)** 테스트 파일은 웹 페이지에서 전역적으로 사용될 때를 테스트하는 파일입니다. 이 파일에서는 임포트(Import) 구문을 사용하지 않아야 합니다. **모듈(Module)** 테스트 파일은 임포트(Import) 구문을 사용할 때를 테스트 하는 파일입니다. 만약 여러분의 `tsconfig.json` 파일이 `files` 필드(Field)를 가지고 있다면, 이 필드(Field)는 반드시 두 테스트 파일을 모두 포함해야 합니다. [이 방식을 사용하는 실례](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) 또한 big.js 패키지의 자료형 선언(Type declaration)에서 확인해보실 수 있습니다. + +각각의 테스트 파일에 모든 상황을 테스트할 필요는 없다는 걸 잊지마세요. 전역 테스트 파일에서는 전역적으로 사용될 때만 테스트하고, 모듈 테스트 파일에서 나머지 상황들을 모두 테스트 할 수 있으며, 그 반대의 경우도 괜찮습니다. + +#### 지역 패키지(Scoped package)의 경우는 어떻게 하죠? + +`@foo/bar` 패키지와 같은 지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)는 `types/foo__bar` 디렉토리에 추가하면 됩니다. 밑줄 문자가 두 번 있는 것에 주의하세요. + +지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)를 생성하기 위해 `dts-gen` 를 사용한 경우에는, +다음과 같이 생성된 `tsconfig.json` 안에 지역 패키지(Scoped package)를 위한 적절한 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다. + +```json +{ + "paths":{ + "@foo/bar": ["foo__bar"] + } +} +``` + + +#### 깃헙(GitHub)이 보여주는 파일 히스토리(History)가 불완전해요. + +깃헙은 이름이 바뀐 파일의 히스토리(History)를 [지원하지 않습니다](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames). 대신 [`git log --follow`](https://www.git-scm.com/docs/git-log) 명령을 사용하세요. + +#### ES6 에서 사용하는 임포트(Import)를 사용하기 위해 모듈을 익스포트(Export)하지 않는 패키지들에 빈 이름공간을 추가해야 하나요? + +[chai-http](https://github.com/chaijs/chai-http) 패키지와 같은 몇몇 패키지들은 함수를 익스포트(Export)합니다. + +이런 패키지들을 `import * as foo from "foo";` 와 같이 임포트(Import)하면 다음과 같은 오류가 발생합니다. + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +이 오류는 함수의 이름과 똑같은 빈 이름공간(Namespace)을 정의해서 없앨 수 있으나, 좋은 방법은 아닙니다. +[스택오버플로(Stack Overflow)의 이 질문의 답변](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this)이 이 문제와 관련되어 자주 언급됩니다. + +`import foo = require("foo");` 를 사용하여 모듈을 임포트(Import)하거나, 환경에서 ES6 모듈 변환(Module interop)을 지원한다면 `--allowSyntheticDefaultImports` 와 함께 `import foo from "foo";` 같은 디폴트 임포트(Default import)를 사용하는 것이 더 나은 방법입니다. + +## 라이센스 + +이 프로젝트는 MIT license 가 적용되어 있습니다. + +각 자료형 정의(Type definition) 파일들의 저작권은 각 기여자들에게 있으며, 기여자들은 해당 자료형 정의(Type definition) 파일들의 맨 위에 나열되어 있습니다. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) diff --git a/README.md b/README.md index 8e582f05b4..9a31d73da1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -*[You can also read this README in Spanish!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md)* +*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)* ## What are declaration files? @@ -54,7 +54,7 @@ Before you share your improvement with the world, use it yourself. #### Test editing an existing package -To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html). +To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation). You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below. diff --git a/notNeededPackages.json b/notNeededPackages.json index f3dc9ef37f..4e66976014 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -156,12 +156,6 @@ "sourceRepoURL": "https://github.com/brianloveswords/base64url", "asOfVersion": "2.0.0" }, - { - "libraryName": "better-scroll", - "typingsPackageName": "better-scroll", - "sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll", - "asOfVersion": "1.5.0" - }, { "libraryName": "BigInteger.js", "typingsPackageName": "big-integer", @@ -570,6 +564,12 @@ "sourceRepoURL": "https://github.com/acdlite/flux-standard-action", "asOfVersion": "1.1.0" }, + { + "libraryName": "fork-ts-checker-webpack-plugin", + "typingsPackageName": "fork-ts-checker-webpack-plugin", + "sourceRepoURL": "https://github.com/Realytics/fork-ts-checker-webpack-plugin", + "asOfVersion": "0.4.5" + }, { "libraryName": "Foundation Sites", "typingsPackageName": "foundation-sites", @@ -678,6 +678,12 @@ "sourceRepoURL": "https://github.com/facebook/immutable-js", "asOfVersion": "3.8.7" }, + { + "libraryName": "interactjs", + "typingsPackageName": "interact.js", + "sourceRepoURL": "https://github.com/taye/interact.js", + "asOfVersion": "1.3.0" + }, { "libraryName": "inversify", "typingsPackageName": "inversify", @@ -1140,6 +1146,24 @@ "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "react-dnd", + "typingsPackageName": "react-dnd", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-html5-backend", + "typingsPackageName": "react-dnd-html5-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, + { + "libraryName": "react-dnd-test-backend", + "typingsPackageName": "react-dnd-test-backend", + "sourceRepoURL": "https://github.com/react-dnd/react-dnd", + "asOfVersion": "3.0.2" + }, { "libraryName": "react-flip-move", "typingsPackageName": "react-flip-move", @@ -1194,12 +1218,24 @@ "sourceRepoURL": "https://github.com/react-native-community/react-native-modal", "asOfVersion": "4.1.1" }, + { + "libraryName": "react-native-navigation", + "typingsPackageName": "react-native-navigation", + "sourceRepoURL": "https://github.com/wix/react-native-navigation", + "asOfVersion": "2.0.0" + }, { "libraryName": "react-split-pane", "typingsPackageName": "react-split-pane", "sourceRepoURL": "https://github.com/tomkp/react-split-pane", "asOfVersion": "0.1.67" }, + { + "libraryName": "react-svg", + "typingsPackageName": "react-svg", + "sourceRepoURL": "https://github.com/tanem/react-svg", + "asOfVersion": "5.0.0" + }, { "libraryName": "realm", "typingsPackageName": "realm", @@ -1219,7 +1255,7 @@ "asOfVersion": "0.1.5" }, { - "libraryName": "react-bootstrap", + "libraryName": "redux-bootstrap", "typingsPackageName": "redux-bootstrap", "sourceRepoURL": "https://github.com/remojansen/redux-bootstrap", "asOfVersion": "1.1.0" @@ -1494,6 +1530,12 @@ "sourceRepoURL": "https://github.com/samchon/tstl", "asOfVersion": "1.5.7" }, + { + "libraryName": "typed.js", + "typingsPackageName": "typed.js", + "sourceRepoURL": "https://github.com/mattboldt/typed.js", + "asOfVersion": "2.0.9" + }, { "libraryName": "TypeScript", "typingsPackageName": "typescript", @@ -1584,6 +1626,12 @@ "sourceRepoURL": "http://webix.com", "asOfVersion": "5.1.1" }, + { + "libraryName": "winston", + "typingsPackageName": "winston", + "sourceRepoURL": "https://github.com/winstonjs/winston.git", + "asOfVersion": "2.4.4" + }, { "libraryName": "wolfy87-eventemitter", "typingsPackageName": "wolfy87-eventemitter", diff --git a/package.json b/package.json index c5b1b03057..09fe064d48 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "definitely-typed", - "version": "0.0.2", + "version": "0.0.3", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", "repository": { "type": "git", diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 828aab87c2..7faa5da4f8 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -832,8 +832,9 @@ declare namespace AceAjax { /** * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} + * @param scrollLeft The new scroll left value **/ - setScrollLeft(): void; + setScrollLeft(scrollLeft: number): void; /** * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} diff --git a/types/ace/test/edit_session.ts b/types/ace/test/edit_session.ts index 4713495f7a..29b3bb6bd8 100644 --- a/types/ace/test/edit_session.ts +++ b/types/ace/test/edit_session.ts @@ -18,6 +18,23 @@ function createFoldTestSession() { return session; } +function createScrollTestRenderer(): AceAjax.VirtualRenderer | null { + var el = document.createElement("div"); + + if (!el.getBoundingClientRect) { + console.log("Skipping test: This test only runs in the browser"); + return null; + } + + el.style.left = "20px"; + el.style.top = "30px"; + el.style.width = "300px"; + el.style.height = "100px"; + document.body.appendChild(el); + + return new AceAjax.VirtualRenderer(el); +} + function assertArray(a, b) { assert.equal(a + "", b + ""); assert.ok(a.length == b.length); @@ -915,5 +932,25 @@ const aceEditSessionTests = { session = new AceAjax.EditSession(new Array(30).join("\n")); session.documentToScreenPosition(2, 0); session.documentToScreenPosition(2, 0); + }, + + "test setScrollTop()": function() { + var renderer = createScrollTestRenderer(); + var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]); + renderer.setSession(session); + assert.equal(renderer.getScrollTop(), 0); + session.setScrollTop(40); + assert.equal(renderer.getScrollTop(), 40); + renderer.getScrollTop() + }, + + "test setScrollLeft()": function() { + var renderer = createScrollTestRenderer(); + var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]); + renderer.setSession(session); + assert.equal(renderer.getScrollLeft(), 0); + session.setScrollLeft(40); + assert.equal(renderer.getScrollLeft(), 40); + renderer.getScrollLeft() } -}; \ No newline at end of file +}; diff --git a/types/acl/index.d.ts b/types/acl/index.d.ts index 43de3f5369..3f4df31aa2 100644 --- a/types/acl/index.d.ts +++ b/types/acl/index.d.ts @@ -2,9 +2,8 @@ // Project: https://github.com/optimalbits/node_acl // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 -/// /// /// diff --git a/types/activedirectory2/activedirectory2-tests.ts b/types/activedirectory2/activedirectory2-tests.ts new file mode 100644 index 0000000000..662109e746 --- /dev/null +++ b/types/activedirectory2/activedirectory2-tests.ts @@ -0,0 +1,14 @@ +import ActiveDirectory = require("activedirectory2"); + +const ad = new ActiveDirectory({ + url: 'ldap://192.168.199.10', + baseDN: 'OU=MyUsers,DC=mydomain,DC=com', + username: 'service-user@mydomain.com', + password: 'xxxxx000pw' +}); + +ad.authenticate("test@mydomain.com", "yyyy111pw", (err, authed) => { + console.log("hello"); + console.log(err); + console.log(authed); +}); diff --git a/types/activedirectory2/index.d.ts b/types/activedirectory2/index.d.ts new file mode 100644 index 0000000000..f963ae32ba --- /dev/null +++ b/types/activedirectory2/index.d.ts @@ -0,0 +1,151 @@ +// Type definitions for activedirectory2 1.2 +// Project: https://github.com/jsumners/node-activedirectory#readme +// Definitions by: pas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 + +import { Filter } from "ldapjs"; + +interface ADProperties { + url: string; + baseDN: string; + username: string; + password: string; + pageSize?: 1000; + entryParser?: (entry: object, raw: string, cb: (entry: object) => void) => void; + referrals?: { + enabled: false, + exclude: [ + 'ldaps?://ForestDnsZones\\..*/.*', + 'ldaps?://DomainDnsZones\\..*/.*', + 'ldaps?://.*/CN=Configuration,.*' + ] + }; + attributes?: { + user: [ + 'dn', 'distinguishedName', + 'userPrincipalName', 'sAMAccountName', 'mail', + 'lockoutTime', 'whenCreated', 'pwdLastSet', 'userAccountControl', + 'employeeID', 'sn', 'givenName', 'initials', 'cn', 'displayName', + 'comment', 'description' + ], + group: [ + 'dn', 'cn', 'description', 'distinguishedName', 'objectCategory' + ] + }; +} + +interface LDAPjsReqProps { + url: string; + tlsOptions: { + host?: string; + key?: string; + cert?: string; + ca?: string; + rejectUnauthorized: boolean; + }; + socketPath?: string; + log?: any; + timeout?: number; + idleTimeout?: number; + connectionTimeout?: number; + strictDN?: boolean; +} + +type MembershipType = 'all'|'user'|'group'; + +interface ReqProps extends LDAPjsReqProps { + baseDN?: string; + bindDN?: string; + bindCredentials?: string; + scope?: 'base' | 'one' | 'sub'; + filter: string | Filter; + attributes: AttributeSpec; + sizeLimit: 0; + timeLimit: 10; + includeMembership: MembershipType[]; +} + +interface AttributeSpec { + user: UserAttributes[]; + group: GroupAttributes[]; +} + +type GroupAttributes = + | 'distinguishedName' + | 'objectCategory' + | 'cn' + | 'description'; + +type UserAttributes = + | 'distinguishedName' + | 'userPrincipalName' + | 'sAMAccountName' + | 'mail' + | 'lockoutTime' + | 'whenCreated' + | 'pwdLastSet' + | 'userAccountControl' + | 'employeeID' + | 'sn' + | 'givenName' + | 'initials' + | 'cn' + | 'displayName' + | 'comment' + | 'description'; + +interface FindResult { + groups: object[]; + users: object[]; + other: object[]; +} + +declare class ActiveDirectory { + constructor(props: ADProperties); + authenticate( + username: string, + password: string, + callback: (err: string, authenticated: boolean) => void + ): void; + isUserMemberOf( + opts: ReqProps, + username: string, + groupName: string, + callback: (err: object, res: boolean) => void + ): void; + find( + opts: string | ReqProps, + callback: (err: object, results: FindResult) => void + ): void; + findDeletedObjects( + opts: string | ReqProps, + callback: (err: object, results: object[]) => void + ): void; + findUser( + opts: string | ReqProps, + username: string, + callback: (err: object, user: object) => void + ): void; + findUsers( + opts: string | ReqProps, + callback: (err: object, users: object[]) => void + ): void; + findGroup( + opts: string | ReqProps, + groupName: string, + callback: (err: object, group: object) => void + ): void; + findGroups( + opts: string | ReqProps, + groupName: string, + callback: (err: object, groups: object[]) => void + ): void; + getRootDSE( + url: string, + attributes: string[], + callback: (err: object, result: object) => void + ): void; +} + +export = ActiveDirectory; diff --git a/types/activedirectory2/tsconfig.json b/types/activedirectory2/tsconfig.json new file mode 100644 index 0000000000..57a68150ac --- /dev/null +++ b/types/activedirectory2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "activedirectory2-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "es2015.iterable" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/fork-ts-checker-webpack-plugin/tslint.json b/types/activedirectory2/tslint.json similarity index 100% rename from types/fork-ts-checker-webpack-plugin/tslint.json rename to types/activedirectory2/tslint.json diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index 4f6fab3aa1..505fcacfef 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -16,6 +16,17 @@ const inCollection = (collection: { Item(index: any): T }, index: strin return item; }; +{ + let app1: Excel.Application | null = new ActiveXObject('Excel.Application'); + app1.Visible = true; + const book1 = app1.Workbooks.Add(); + + app1.Quit(); + app1 = null; + + WScript.Quit(); +} + const app = new ActiveXObject('Excel.Application'); // create a workbook -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-a-workbook @@ -27,7 +38,7 @@ newBook.SaveAs('allsales.xls'); // create or replace a worksheet -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-or-replace-a-worksheet const newOrExistingWorksheet = () => { const mySheetName = 'Sheet4'; - let mySheet = inCollection(newBook.Worksheets, mySheetName) as Excel.Worksheet | undefined; + let mySheet = inCollection(newBook.Worksheets, mySheetName); if (!mySheet) { WScript.Echo(`The sheet named "${mySheetName} doesn't exist, but will be created.`); mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -37,7 +48,7 @@ const newOrExistingWorksheet = () => { const replaceWorksheet = () => { const mySheetName = 'Sheet4'; app.DisplayAlerts = false; - let mySheet = inCollection(app.Worksheets, mySheetName); + let mySheet = inCollection(app.Worksheets, mySheetName); if (mySheet) { mySheet.Delete(); } app.DisplayAlerts = true; mySheet = app.Worksheets.Add() as Excel.Worksheet; @@ -46,9 +57,7 @@ const replaceWorksheet = () => { }; // referencing multiple sheets -- https://msdn.microsoft.com/VBA/Excel-VBA/articles/sheets-object-excel -const moveMultipleSheets = () => { - app.Worksheets.Item(toSafeArray(1, 'Sheet2')).Move(4); -}; +const moveMultipleSheets = () => app.Worksheets(toSafeArray(1, 'Sheet2')).Move(4); // sort worksheets alphanumerically by name -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/sort-worksheets-alphanumerically-by-name const sortSheetsTabName = () => { @@ -56,9 +65,9 @@ const sortSheetsTabName = () => { const sheets = app.ActiveWorkbook.Sheets; const sheetCount = sheets.Count; for (let i = 0; i < sheetCount; i += 1) { - const sheetI = sheets.Item(i); + const sheetI = sheets(i); for (let j = i; j < sheetCount; j += 1) { - const sheetJ = sheets.Item(j); + const sheetJ = sheets(j); if (sheetJ.Name < sheetI.Name) { sheetJ.Move(sheetI); } } } @@ -68,7 +77,7 @@ const sortSheetsTabName = () => { // fill a value down into blank cells in a column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/fill-a-value-down-into-blank-cells-in-a-column const fillCellsFromAbove = () => { app.ScreenUpdating = false; - const columnA = app.Columns.Item(1); + const columnA = app.Columns(1); try { columnA.SpecialCells(Excel.XlCellType.xlCellTypeBlanks).Formula = '=R[-1]C'; columnA.Value = columnA.Value; @@ -78,7 +87,7 @@ const fillCellsFromAbove = () => { // hide and unhide columns -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/hide-and-unhide-columns const setColumnVisibility = (visible: boolean) => { - const book = app.Workbooks.Item(1); + const book = app.Workbooks(1); const sheet = inCollection(book.Worksheets, 'Sheet1'); if (!sheet) { return; } @@ -97,7 +106,7 @@ const setColumnVisibility = (visible: boolean) => { }; // highlighting the active cell, row, or column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/highlight-the-active-cell-row-or-column -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // highlight active cell @@ -120,10 +129,10 @@ const setColumnVisibility = (visible: boolean) => { prm.Target.EntireColumn.Interior.ColorIndex = 8; app.ScreenUpdating = true; }); -})(); +} // referencing cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/reference-cells-and-ranges -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // all the cells on a worksheet @@ -141,20 +150,19 @@ const setColumnVisibility = (visible: boolean) => { wks.Range('A:A,C:C,F:F').Font.Bold = true; // using index numbers - wks.Cells.Item(6, 1).Value2 = 10; - // Value is also a property with parameters - ActiveXObject.set(wks.Cells.Item(6, 1), 'Value', 10); + wks.Cells(6, 1).Value2 = 10; + wks.Cells(6, 1).Value = 10; // iterating through cells using index numbers for (let counter = 1; counter < 20; counter += 1) { - ActiveXObject.set(wks.Cells.Item(counter, 1), 'Value', 10); + wks.Cells(counter, 1).Value = 10; } // relative to other cells - wks.Cells.Item(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; + wks.Cells(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble; // using a Range object - const rng = wks.Cells.Item('A1:D5'); + const rng = wks.Cells('A1:D5'); rng.Formula = '=RAND()'; rng.Font.Bold = true; @@ -166,23 +174,22 @@ const setColumnVisibility = (visible: boolean) => { // refer to multiple ranges using Areas WScript.Echo(union.Areas.Count); -})(); +} // looping through a range of cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/looping-through-a-range-of-cells -(() => { +{ const wks = app.ActiveSheet as Excel.Worksheet; // using for for (let x = 1; x < 20; x++) { - const currentCell = wks.Cells.Item(x, 1); - if (Math.abs(currentCell.Value()) < 0.01) { - // because Value is typed as a method on the Excel.Range class, we have to treat it as a setter with parameters - ActiveXObject.set(currentCell, 'Value', 0); + const currentCell = wks.Cells(x, 1); + if (Math.abs(currentCell.Value) < 0.01) { + currentCell.Value = 0; } } // using Enumerator - let enumerator = new Enumerator(wks.Cells.Item('A1:D10')); + let enumerator = new Enumerator(wks.Cells('A1:D10')); enumerator.moveFirst(); while (!enumerator.atEnd()) { const currentCell = enumerator.item(); @@ -202,11 +209,11 @@ const setColumnVisibility = (visible: boolean) => { } enumerator.moveNext(); } -})(); +} // using selection -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/selecting-and-activating-cells -(() => { - const wks = app.ActiveWorkbook.Worksheets.Item(1) as Excel.Worksheet; +{ + const wks = app.ActiveWorkbook.Worksheets(1); // make a worksheet the active worksheet; otherwise code which uses the selection will fail wks.Select(); @@ -219,24 +226,24 @@ const setColumnVisibility = (visible: boolean) => { wks.Range("B1").Activate(); // working with 3-D ranges -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/working-with-3-d-ranges - app.Sheets.Item(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); + app.Sheets(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select(); app.Range("A1:H1").Select(); - (app.Selection as Excel.Range).Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + (app.Selection as Excel.Range).Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; // alternatively, use FillAcrossSheets to fill formatting and data across sheets const book = app.ActiveWorkbook; - const wks2 = book.Sheets.Item("Sheet2") as Excel.Worksheet; + const wks2 = book.Worksheets("Sheet2"); const rng = wks2.Range("A1:H1"); - rng.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; + rng.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble; book.Sheets.FillAcrossSheets(rng); -})(); +} // prevent duplicate entry -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/prevent-duplicate-entries-in-a-range -(() => { - const book = app.Workbooks.Item(1); +{ + const book = app.Workbooks(1); ActiveXObject.on(book, 'SheetChange', ['Sh', 'Target'], function(this, prm) { - const EvalRange = this.ActiveSheet.Range("A1:B20"); + const EvalRange = (this.ActiveSheet as Excel.Worksheet).Range("A1:B20"); // If the cell where the value was entered is not in the defined range, if the value pasted is larger than a single cell, or if no value was entered in the cell, then exit the macro if ( @@ -253,10 +260,11 @@ const setColumnVisibility = (visible: boolean) => { return; } + // const enumerator = new Enumerator(book.Worksheets); const enumerator = new Enumerator(book.Worksheets); enumerator.moveFirst(); while (!enumerator.atEnd()) { - const wks = enumerator.item() as Excel.Worksheet; + const wks = enumerator.item(); if (wks.Name === prm.Target.Name) { continue; } // If the value entered already exists in the defined range on the current worksheet, undo the entry. @@ -267,14 +275,14 @@ const setColumnVisibility = (visible: boolean) => { app.EnableEvents = true; } }); -})(); +} // add a unique list of values to a combobox -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/add-a-unique-list-of-values-to-a-combo-box -(() => { - (() => { +{ + { // using the AdvancedFilter property const book = app.ThisWorkbook; - const sheet = book.Worksheets.Item("Sheet1") as Excel.Worksheet; + const sheet = book.Worksheets("Sheet1"); const dataRange = sheet.Range('A1', sheet.Range("A100").End(Excel.XlDirection.xlUp)); dataRange.AdvancedFilter(Excel.XlFilterAction.xlFilterCopy, undefined, sheet.Range('L1'), true); const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray; @@ -284,15 +292,17 @@ const setColumnVisibility = (visible: boolean) => { combobox.Clear(); ActiveXObject.set(combobox, 'List', [], data); combobox.ListIndex = -1; - })(); + } - (() => { + { // using a Dictionary - const sheet = app.ThisWorkbook.Sheets.Item('Sheet2') as Excel.Worksheet; + const sheet = app.ThisWorkbook.Sheets('Sheet2') as Excel.Worksheet; const data = sheet.Range('A2', sheet.Range('A100').End(Excel.XlDirection.xlUp)).Value2 as SafeArray; const arr = new VBArray(data).toArray(); const dict = new ActiveXObject('Scripting.Dictionary'); - arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true)); + for (const x of arr) { + ActiveXObject.set(dict, 'Item', [x], true); + } const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); @@ -307,21 +317,28 @@ const setColumnVisibility = (visible: boolean) => { // alternatively, make a JS array out of the keys, and iterate using forEach // new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x)); - })(); -})(); - -// animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline -(() => { - const wks = app.ActiveSheet as Excel.Worksheet; - const oSparkGroup = wks.Cells.SparklineGroups.Item(1); - - // Set the data source to the first year of data - oSparkGroup.ModifySourceData('B2:M4'); - - // Loop through the data points for the subsequent two years - for (let i = 1; i <= 24; i++) { - // Move the reference for the sparkline group over one cell - oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); - WScript.Sleep(1000); } -})(); + + // animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline + { + const wks = app.ActiveSheet as Excel.Worksheet; + const oSparkGroup = wks.Cells.SparklineGroups(1); + + // Set the data source to the first year of data + oSparkGroup.ModifySourceData('B2:M4'); + + // Loop through the data points for the subsequent two years + for (let i = 1; i <= 24; i++) { + // Move the reference for the sparkline group over one cell + oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address()); + WScript.Sleep(1000); + } + } + + { + const formats = new VBArray(app.ClipboardFormats).toArray(); + for (const format of formats) { + WScript.Echo(format); + } + } +} diff --git a/types/activex-excel/index.d.ts b/types/activex-excel/index.d.ts index c55bfe1c42..6243d25e05 100644 --- a/types/activex-excel/index.d.ts +++ b/types/activex-excel/index.d.ts @@ -2,14 +2,52 @@ // Project: https://msdn.microsoft.com/en-us/library/fp179694.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// /// /// +/// +/// declare namespace Excel { - // tslint:disable-next-line:no-const-enum + type AddSheetResult = + T extends XlSheetType.xlDialogSheet ? DialogSheet : + T extends XlSheetType.xlChart ? Chart : + T extends XlSheetType ? Worksheet : + T extends undefined ? Sheet : + never; + + type InternationalResult = + T extends XlApplicationInternationalStrings ? string : + T extends XlApplicationInternationalNumbers ? number : + T extends XlApplicationInternationalBooleans ? boolean : + any; + + type LineStyle = XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + + type HorizontalAlignments = Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlLeft | Constants.xlRight; + + type VerticalAlignments = Constants.xlBottom | Constants.xlCenter | Constants.xlDistributed | Constants.xlJustify | Constants.xlTop; + + type PivotTableWizardSourceData = + TSourceType extends XlPivotTableSourceType.xlExternal ? SafeArray : + TSourceType extends XlPivotTableSourceType ? Range | SafeArray | string : + TSourceType extends undefined ? undefined : + never; + + type PivotTableWizardAutoPage = + TSourceType extends XlPivotTableSourceType.xlConsolidation ? boolean : + undefined; + + type PrintToFileName = + T extends true ? string : + undefined; + + type Sheet = Worksheet | Chart | DialogSheet; + + type SheetView = WorksheetView | DialogSheetView; + const enum Constants { xl3DBar = -4099, xl3DEffects1 = 13, @@ -180,7 +218,48 @@ declare namespace Excel { xlWorksheetShort = 5, } - // tslint:disable-next-line:no-const-enum + const enum FunctionCategory { + Commands = 10, + Customizing = 11, + Database = 6, + DateAndTime = 2, + DDEAndExternal = 13, + Financial = 1, + Information = 9, + Logical = 8, + LookupAndReference = 5, + MacroControl = 12, + MathAndTrig = 3, + Statistical = 4, + Text = 7, + UserDefined = 14, + } + + const enum InputBoxReturnType { + Formula = 0, + Number = 1, + String = 2, + Boolean = 4, + Range = 8, + ErrorValue = 16, + SafeArray = 64, + } + + const enum PivotFieldSubtotal { + Automatic = 1, + Average = 4, + Count = 3, + CountNums = 8, + Max = 5, + Min = 6, + Product = 7, + StdDev = 9, + StdDevp = 10, + Sum = 2, + Var = 11, + Varp = 12 + } + const enum XlAboveBelow { xlAboveAverage = 0, xlAboveStdDev = 4, @@ -190,7 +269,6 @@ declare namespace Excel { xlEqualBelowAverage = 3, } - // tslint:disable-next-line:no-const-enum const enum XlActionType { xlActionTypeDrillthrough = 256, xlActionTypeReport = 128, @@ -198,80 +276,82 @@ declare namespace Excel { xlActionTypeUrl = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocation { xlAutomaticAllocation = 2, xlManualAllocation = 1, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationMethod { xlEqualAllocation = 1, xlWeightedAllocation = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAllocationValue { xlAllocateIncrement = 2, xlAllocateValue = 1, } - // tslint:disable-next-line:no-const-enum - const enum XlApplicationInternational { - xl24HourClock = 33, - xl4DigitYears = 43, + const enum XlApplicationInternationalStrings { xlAlternateArraySeparator = 16, xlColumnSeparator = 14, - xlCountryCode = 1, - xlCountrySetting = 2, - xlCurrencyBefore = 37, xlCurrencyCode = 25, - xlCurrencyDigits = 27, - xlCurrencyLeadingZeros = 40, - xlCurrencyMinusSign = 38, - xlCurrencyNegative = 28, - xlCurrencySpaceBefore = 36, - xlCurrencyTrailingZeros = 39, - xlDateOrder = 32, - xlDateSeparator = 17, - xlDayCode = 21, - xlDayLeadingZero = 42, xlDecimalSeparator = 3, xlGeneralFormatName = 26, - xlHourCode = 22, xlLeftBrace = 12, xlLeftBracket = 10, xlListSeparator = 5, xlLowerCaseColumnLetter = 9, xlLowerCaseRowLetter = 8, - xlMDY = 44, - xlMetric = 35, - xlMinuteCode = 23, - xlMonthCode = 20, - xlMonthLeadingZero = 41, - xlMonthNameChars = 30, - xlNoncurrencyDigits = 29, - xlNonEnglishFunctions = 34, xlRightBrace = 13, xlRightBracket = 11, + xlUpperCaseColumnLetter = 7, + xlUpperCaseRowLetter = 6, + xlDateSeparator = 17, + xlDayCode = 21, + xlHourCode = 22, + xlMinuteCode = 23, + xlMonthCode = 20, xlRowSeparator = 15, xlSecondCode = 24, xlThousandsSeparator = 4, - xlTimeLeadingZero = 45, xlTimeSeparator = 18, - xlUpperCaseColumnLetter = 7, - xlUpperCaseRowLetter = 6, - xlWeekdayNameChars = 31, xlYearCode = 19, } - // tslint:disable-next-line:no-const-enum + const enum XlApplicationInternationalNumbers { + xlCountryCode = 1, + xlCountrySetting = 2, + xlCurrencyDigits = 27, + xlCurrencyNegative = 28, + xlNoncurrencyDigits = 29, + xlDateOrder = 32, + xlMonthNameChars = 30, + xlWeekdayNameChars = 31, + } + + const enum XlApplicationInternationalBooleans { + xl24HourClock = 33, + xl4DigitYears = 43, + xlCurrencyBefore = 37, + xlCurrencyLeadingZeros = 40, + xlCurrencyMinusSign = 38, + xlCurrencySpaceBefore = 36, + xlCurrencyTrailingZeros = 39, + xlDayLeadingZero = 42, + xlMDY = 44, + xlMetric = 35, + xlMonthLeadingZero = 41, + xlNonEnglishFunctions = 34, + xlTimeLeadingZero = 45, + } + + type XlApplicationInternational = XlApplicationInternationalStrings | XlApplicationInternationalNumbers | XlApplicationInternationalBooleans; + const enum XlApplyNamesOrder { xlColumnThenRow = 2, xlRowThenColumn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArabicModes { xlArabicBothStrict = 3, xlArabicNone = 0, @@ -279,7 +359,6 @@ declare namespace Excel { xlArabicStrictFinalYaa = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrangeStyle { xlArrangeStyleCascade = 7, xlArrangeStyleHorizontal = -4128, @@ -287,14 +366,12 @@ declare namespace Excel { xlArrangeStyleVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadLength { xlArrowHeadLengthLong = 3, xlArrowHeadLengthMedium = -4138, xlArrowHeadLengthShort = 1, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadStyle { xlArrowHeadStyleClosed = 3, xlArrowHeadStyleDoubleClosed = 5, @@ -303,14 +380,12 @@ declare namespace Excel { xlArrowHeadStyleOpen = 2, } - // tslint:disable-next-line:no-const-enum const enum XlArrowHeadWidth { xlArrowHeadWidthMedium = -4138, xlArrowHeadWidthNarrow = 1, xlArrowHeadWidthWide = 3, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFillType { xlFillCopy = 1, xlFillDays = 5, @@ -325,7 +400,6 @@ declare namespace Excel { xlLinearTrend = 9, } - // tslint:disable-next-line:no-const-enum const enum XlAutoFilterOperator { xlAnd = 1, xlBottom10Items = 4, @@ -343,7 +417,6 @@ declare namespace Excel { xlTop10Percent = 5, } - // tslint:disable-next-line:no-const-enum const enum XlAxisCrosses { xlAxisCrossesAutomatic = -4105, xlAxisCrossesCustom = -4114, @@ -351,27 +424,23 @@ declare namespace Excel { xlAxisCrossesMinimum = 4, } - // tslint:disable-next-line:no-const-enum const enum XlAxisGroup { xlPrimary = 1, xlSecondary = 2, } - // tslint:disable-next-line:no-const-enum const enum XlAxisType { xlCategory = 1, xlSeriesAxis = 3, xlValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBackground { xlBackgroundAutomatic = -4105, xlBackgroundOpaque = 3, xlBackgroundTransparent = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBarShape { xlBox = 0, xlConeToMax = 5, @@ -381,7 +450,6 @@ declare namespace Excel { xlPyramidToPoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlBordersIndex { xlDiagonalDown = 5, xlDiagonalUp = 6, @@ -393,7 +461,6 @@ declare namespace Excel { xlInsideVertical = 11, } - // tslint:disable-next-line:no-const-enum const enum XlBorderWeight { xlHairline = 1, xlMedium = -4138, @@ -401,7 +468,6 @@ declare namespace Excel { xlThin = 2, } - // tslint:disable-next-line:no-const-enum const enum XlBuiltInDialog { _xlDialogChartSourceData = 541, _xlDialogPhonetic = 538, @@ -664,62 +730,53 @@ declare namespace Excel { xlDialogZoom = 256, } - // tslint:disable-next-line:no-const-enum const enum XlCalcFor { xlAllValues = 0, xlColGroups = 2, xlRowGroups = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculatedMemberType { xlCalculatedMember = 0, xlCalculatedSet = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCalculation { xlCalculationAutomatic = -4105, xlCalculationManual = -4135, xlCalculationSemiautomatic = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationInterruptKey { xlAnyKey = 2, xlEscKey = 1, xlNoKey = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCalculationState { xlCalculating = 1, xlDone = 0, xlPending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCategoryType { xlAutomaticScale = -4105, xlCategoryScale = 2, xlTimeScale = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCellChangedState { xlCellChangeApplied = 3, xlCellChanged = 2, xlCellNotChanged = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCellInsertionMode { xlInsertDeleteCells = 1, xlInsertEntireRows = 2, xlOverwriteCells = 0, } - // tslint:disable-next-line:no-const-enum const enum XlCellType { xlCellTypeAllFormatConditions = -4172, xlCellTypeAllValidation = -4174, @@ -733,20 +790,17 @@ declare namespace Excel { xlCellTypeVisible = 12, } - // tslint:disable-next-line:no-const-enum const enum XlChartElementPosition { xlChartElementPositionAutomatic = -4105, xlChartElementPositionCustom = -4114, } - // tslint:disable-next-line:no-const-enum const enum XlChartGallery { xlAnyGallery = 23, xlBuiltIn = 21, xlUserDefined = 22, } - // tslint:disable-next-line:no-const-enum const enum XlChartItem { xlAxis = 21, xlAxisTitle = 17, @@ -782,14 +836,12 @@ declare namespace Excel { xlYErrorBars = 11, } - // tslint:disable-next-line:no-const-enum const enum XlChartLocation { xlLocationAsNewSheet = 1, xlLocationAsObject = 2, xlLocationAutomatic = 3, } - // tslint:disable-next-line:no-const-enum const enum XlChartPicturePlacement { xlAllFaces = 7, xlEnd = 2, @@ -800,14 +852,12 @@ declare namespace Excel { xlSides = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartPictureType { xlStack = 2, xlStackScale = 3, xlStretch = 1, } - // tslint:disable-next-line:no-const-enum const enum XlChartSplitType { xlSplitByCustomSplit = 4, xlSplitByPercentValue = 3, @@ -815,7 +865,6 @@ declare namespace Excel { xlSplitByValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlChartType { xl3DArea = -4098, xl3DAreaStacked = 78, @@ -892,14 +941,12 @@ declare namespace Excel { xlXYScatterSmoothNoMarkers = 73, } - // tslint:disable-next-line:no-const-enum const enum XlCheckInVersionType { xlCheckInMajorVersion = 1, xlCheckInMinorVersion = 0, xlCheckInOverwriteVersion = 2, } - // tslint:disable-next-line:no-const-enum const enum XlClipboardFormat { xlClipboardFormatBIFF = 8, xlClipboardFormatBIFF12 = 63, @@ -937,7 +984,6 @@ declare namespace Excel { xlClipboardFormatWK1 = 10, } - // tslint:disable-next-line:no-const-enum const enum XlCmdType { xlCmdCube = 1, xlCmdDefault = 4, @@ -946,13 +992,11 @@ declare namespace Excel { xlCmdTable = 3, } - // tslint:disable-next-line:no-const-enum const enum XlColorIndex { xlColorIndexAutomatic = -4105, xlColorIndexNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlColumnDataType { xlDMYFormat = 4, xlDYMFormat = 7, @@ -966,21 +1010,18 @@ declare namespace Excel { xlYMDFormat = 5, } - // tslint:disable-next-line:no-const-enum const enum XlCommandUnderlines { xlCommandUnderlinesAutomatic = -4105, xlCommandUnderlinesOff = -4146, xlCommandUnderlinesOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCommentDisplayMode { xlCommentAndIndicator = 1, xlCommentIndicatorOnly = -1, xlNoIndicator = 0, } - // tslint:disable-next-line:no-const-enum const enum XlConditionValueTypes { xlConditionValueAutomaticMax = 7, xlConditionValueAutomaticMin = 6, @@ -993,7 +1034,6 @@ declare namespace Excel { xlConditionValuePercentile = 5, } - // tslint:disable-next-line:no-const-enum const enum XlConnectionType { xlConnectionTypeODBC = 2, xlConnectionTypeOLEDB = 1, @@ -1002,7 +1042,6 @@ declare namespace Excel { xlConnectionTypeXMLMAP = 3, } - // tslint:disable-next-line:no-const-enum const enum XlConsolidationFunction { xlAverage = -4106, xlCount = -4112, @@ -1018,7 +1057,6 @@ declare namespace Excel { xlVarP = -4165, } - // tslint:disable-next-line:no-const-enum const enum XlContainsOperator { xlBeginsWith = 2, xlContains = 0, @@ -1026,32 +1064,27 @@ declare namespace Excel { xlEndsWith = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCopyPictureFormat { xlBitmap = 2, xlPicture = -4147, } - // tslint:disable-next-line:no-const-enum const enum XlCorruptLoad { xlExtractData = 2, xlNormalLoad = 0, xlRepairFile = 1, } - // tslint:disable-next-line:no-const-enum const enum XlCreator { xlCreatorCode = 1480803660, } - // tslint:disable-next-line:no-const-enum const enum XlCredentialsMethod { xlCredentialsMethodIntegrated = 0, xlCredentialsMethodNone = 1, xlCredentialsMethodStored = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldSubType { xlCubeAttribute = 4, xlCubeCalculatedMeasure = 5, @@ -1065,20 +1098,17 @@ declare namespace Excel { xlCubeSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCubeFieldType { xlHierarchy = 1, xlMeasure = 2, xlSet = 3, } - // tslint:disable-next-line:no-const-enum const enum XlCutCopyMode { xlCopy = 1, xlCut = 2, } - // tslint:disable-next-line:no-const-enum const enum XlCVError { xlErrDiv0 = 2007, xlErrNA = 2042, @@ -1089,32 +1119,27 @@ declare namespace Excel { xlErrValue = 2015, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarAxisPosition { xlDataBarAxisAutomatic = 0, xlDataBarAxisMidpoint = 1, xlDataBarAxisNone = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarBorderType { xlDataBarBorderNone = 0, xlDataBarBorderSolid = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarFillType { xlDataBarFillGradient = 1, xlDataBarFillSolid = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDataBarNegativeColorType { xlDataBarColor = 0, xlDataBarSameAsPositive = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelPosition { xlLabelPositionAbove = 0, xlLabelPositionBelow = 1, @@ -1129,12 +1154,10 @@ declare namespace Excel { xlLabelPositionRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelSeparator { xlDataLabelSeparatorDefault = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDataLabelsType { xlDataLabelsShowBubbleSizes = 6, xlDataLabelsShowLabel = 4, @@ -1144,7 +1167,6 @@ declare namespace Excel { xlDataLabelsShowValue = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesDate { xlDay = 1, xlMonth = 3, @@ -1152,7 +1174,6 @@ declare namespace Excel { xlYear = 4, } - // tslint:disable-next-line:no-const-enum const enum XlDataSeriesType { xlAutoFill = 4, xlChronological = 3, @@ -1160,13 +1181,11 @@ declare namespace Excel { xlGrowth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDeleteShiftDirection { xlShiftToLeft = -4159, xlShiftUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDirection { xlDown = -4121, xlToLeft = -4159, @@ -1174,21 +1193,18 @@ declare namespace Excel { xlUp = -4162, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayBlanksAs { xlInterpolated = 3, xlNotPlotted = 1, xlZero = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayDrawingObjects { xlDisplayShapes = -4104, xlHide = 3, xlPlaceholders = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDisplayUnit { xlHundredMillions = -8, xlHundreds = -2, @@ -1201,20 +1217,17 @@ declare namespace Excel { xlThousands = -3, } - // tslint:disable-next-line:no-const-enum const enum XlDupeUnique { xlDuplicate = 1, xlUnique = 0, } - // tslint:disable-next-line:no-const-enum const enum XlDVAlertStyle { xlValidAlertInformation = 3, xlValidAlertStop = 1, xlValidAlertWarning = 2, } - // tslint:disable-next-line:no-const-enum const enum XlDVType { xlValidateCustom = 7, xlValidateDate = 4, @@ -1226,7 +1239,6 @@ declare namespace Excel { xlValidateWholeNumber = 1, } - // tslint:disable-next-line:no-const-enum const enum XlDynamicFilterCriteria { xlFilterAboveAverage = 33, xlFilterAllDatesInPeriodApril = 24, @@ -1264,7 +1276,6 @@ declare namespace Excel { xlFilterYesterday = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionFormat { xlBIFF = 2, xlPICT = 1, @@ -1272,7 +1283,6 @@ declare namespace Excel { xlVALU = 8, } - // tslint:disable-next-line:no-const-enum const enum XlEditionOptionsOption { xlAutomaticUpdate = 4, xlCancel = 1, @@ -1284,39 +1294,33 @@ declare namespace Excel { xlUpdateSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEditionType { xlPublisher = 1, xlSubscriber = 2, } - // tslint:disable-next-line:no-const-enum const enum XlEnableCancelKey { xlDisabled = 0, xlErrorHandler = 2, xlInterrupt = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEnableSelection { xlNoRestrictions = 0, xlNoSelection = -4142, xlUnlockedCells = 1, } - // tslint:disable-next-line:no-const-enum const enum XlEndStyleCap { xlCap = 1, xlNoCap = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarDirection { xlX = -4168, xlY = 1, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarInclude { xlErrorBarIncludeBoth = 1, xlErrorBarIncludeMinusValues = 3, @@ -1324,7 +1328,6 @@ declare namespace Excel { xlErrorBarIncludePlusValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlErrorBarType { xlErrorBarTypeCustom = -4114, xlErrorBarTypeFixedValue = 1, @@ -1333,7 +1336,6 @@ declare namespace Excel { xlErrorBarTypeStError = 4, } - // tslint:disable-next-line:no-const-enum const enum XlErrorChecks { xlEmptyCellReferences = 7, xlEvaluateToError = 1, @@ -1346,13 +1348,11 @@ declare namespace Excel { xlUnlockedFormulaCells = 6, } - // tslint:disable-next-line:no-const-enum const enum XlFileAccess { xlReadOnly = 3, xlReadWrite = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFileFormat { xlAddIn = 18, xlAddIn8 = 18, @@ -1410,27 +1410,23 @@ declare namespace Excel { xlXMLSpreadsheet = 46, } - // tslint:disable-next-line:no-const-enum const enum XlFileValidationPivotMode { xlFileValidationPivotDefault = 0, xlFileValidationPivotRun = 1, xlFileValidationPivotSkip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlFillWith { xlFillWithAll = -4104, xlFillWithContents = 2, xlFillWithFormats = -4122, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAction { xlFilterCopy = 2, xlFilterInPlace = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFilterAllDatesInPeriod { xlFilterAllDatesInPeriodDay = 2, xlFilterAllDatesInPeriodHour = 3, @@ -1440,26 +1436,22 @@ declare namespace Excel { xlFilterAllDatesInPeriodYear = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFindLookIn { xlComments = -4144, xlFormulas = -4123, xlValues = -4163, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatQuality { xlQualityMinimum = 1, xlQualityStandard = 0, } - // tslint:disable-next-line:no-const-enum const enum XlFixedFormatType { xlTypePDF = 0, xlTypeXPS = 1, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionOperator { xlBetween = 1, xlEqual = 3, @@ -1471,7 +1463,6 @@ declare namespace Excel { xlNotEqual = 4, } - // tslint:disable-next-line:no-const-enum const enum XlFormatConditionType { xlAboveAverageCondition = 12, xlBlanksCondition = 10, @@ -1489,7 +1480,6 @@ declare namespace Excel { xlUniqueValues = 8, } - // tslint:disable-next-line:no-const-enum const enum XlFormatFilterTypes { xlFilterBottom = 0, xlFilterBottomPercent = 2, @@ -1497,7 +1487,6 @@ declare namespace Excel { xlFilterTopPercent = 3, } - // tslint:disable-next-line:no-const-enum const enum XlFormControl { xlButtonControl = 0, xlCheckBox = 1, @@ -1511,7 +1500,6 @@ declare namespace Excel { xlSpinner = 9, } - // tslint:disable-next-line:no-const-enum const enum XlFormulaLabel { xlColumnLabels = 2, xlMixedLabels = 3, @@ -1519,19 +1507,16 @@ declare namespace Excel { xlRowLabels = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGenerateTableRefs { xlGenerateTableRefA1 = 0, xlGenerateTableRefStruct = 1, } - // tslint:disable-next-line:no-const-enum const enum XlGradientFillType { xlGradientFillLinear = 0, xlGradientFillPath = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHAlign { xlHAlignCenter = -4108, xlHAlignCenterAcrossSelection = 7, @@ -1543,7 +1528,6 @@ declare namespace Excel { xlHAlignRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlHebrewModes { xlHebrewFullScript = 0, xlHebrewMixedAuthorizedScript = 3, @@ -1551,14 +1535,12 @@ declare namespace Excel { xlHebrewPartialScript = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHighlightChangesTime { xlAllChanges = 2, xlNotYetReviewed = 3, xlSinceMyLastSave = 1, } - // tslint:disable-next-line:no-const-enum const enum XlHtmlType { xlHtmlCalc = 1, xlHtmlChart = 3, @@ -1566,7 +1548,6 @@ declare namespace Excel { xlHtmlStatic = 0, } - // tslint:disable-next-line:no-const-enum const enum XlIcon { xlIcon0Bars = 37, xlIcon0FilledBoxes = 52, @@ -1623,7 +1604,6 @@ declare namespace Excel { xlIconYellowUpInclineArrow = 25, } - // tslint:disable-next-line:no-const-enum const enum XlIconSet { xl3Arrows = 1, xl3ArrowsGray = 2, @@ -1648,7 +1628,6 @@ declare namespace Excel { xlCustomSet = -1, } - // tslint:disable-next-line:no-const-enum const enum XlIMEMode { xlIMEModeAlpha = 8, xlIMEModeAlphaFull = 7, @@ -1663,39 +1642,33 @@ declare namespace Excel { xlIMEModeOn = 1, } - // tslint:disable-next-line:no-const-enum const enum XlImportDataAs { xlPivotTableReport = 1, xlQueryTable = 0, xlTable = 2, } - // tslint:disable-next-line:no-const-enum const enum XlInsertFormatOrigin { xlFormatFromLeftOrAbove = 0, xlFormatFromRightOrBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlInsertShiftDirection { xlShiftDown = -4121, xlShiftToRight = -4161, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutFormType { xlOutline = 1, xlTabular = 0, } - // tslint:disable-next-line:no-const-enum const enum XlLayoutRowType { xlCompactRow = 0, xlOutlineRow = 2, xlTabularRow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLegendPosition { xlLegendPositionBottom = -4107, xlLegendPositionCorner = 2, @@ -1705,7 +1678,6 @@ declare namespace Excel { xlLegendPositionTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlLineStyle { xlContinuous = 1, xlDash = -4115, @@ -1717,7 +1689,6 @@ declare namespace Excel { xlSlantDashDot = 13, } - // tslint:disable-next-line:no-const-enum const enum XlLink { xlExcelLinks = 1, xlOLELinks = 2, @@ -1725,21 +1696,18 @@ declare namespace Excel { xlSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfo { xlEditionDate = 2, xlLinkInfoStatus = 3, xlUpdateState = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLinkInfoType { xlLinkInfoOLELinks = 2, xlLinkInfoPublishers = 5, xlLinkInfoSubscribers = 6, } - // tslint:disable-next-line:no-const-enum const enum XlLinkStatus { xlLinkStatusCopiedValues = 10, xlLinkStatusIndeterminate = 5, @@ -1754,13 +1722,11 @@ declare namespace Excel { xlLinkStatusSourceOpen = 9, } - // tslint:disable-next-line:no-const-enum const enum XlLinkType { xlLinkTypeExcelLinks = 1, xlLinkTypeOLELinks = 2, } - // tslint:disable-next-line:no-const-enum const enum XlListConflict { xlListConflictDialog = 0, xlListConflictDiscardAllConflicts = 2, @@ -1768,7 +1734,6 @@ declare namespace Excel { xlListConflictRetryAllConflicts = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListDataType { xlListDataTypeCheckbox = 9, xlListDataTypeChoice = 6, @@ -1785,7 +1750,6 @@ declare namespace Excel { xlListDataTypeText = 1, } - // tslint:disable-next-line:no-const-enum const enum XlListObjectSourceType { xlSrcExternal = 0, xlSrcQuery = 3, @@ -1793,7 +1757,6 @@ declare namespace Excel { xlSrcXml = 2, } - // tslint:disable-next-line:no-const-enum const enum XlLocationInTable { xlColumnHeader = -4110, xlColumnItem = 5, @@ -1806,27 +1769,23 @@ declare namespace Excel { xlTableBody = 8, } - // tslint:disable-next-line:no-const-enum const enum XlLookAt { xlPart = 2, xlWhole = 1, } - // tslint:disable-next-line:no-const-enum const enum XlLookFor { xlLookForBlanks = 0, xlLookForErrors = 1, xlLookForFormulas = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMailSystem { xlMAPI = 1, xlNoMailSystem = 0, xlPowerTalk = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMarkerStyle { xlMarkerStyleAutomatic = -4105, xlMarkerStyleCircle = 8, @@ -1842,21 +1801,18 @@ declare namespace Excel { xlMarkerStyleX = -4168, } - // tslint:disable-next-line:no-const-enum const enum XlMeasurementUnits { xlCentimeters = 1, xlInches = 0, xlMillimeters = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMouseButton { xlNoButton = 0, xlPrimaryButton = 1, xlSecondaryButton = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMousePointer { xlDefault = -4143, xlIBeam = 3, @@ -1864,7 +1820,6 @@ declare namespace Excel { xlWait = 2, } - // tslint:disable-next-line:no-const-enum const enum XlMSApplication { xlMicrosoftAccess = 4, xlMicrosoftFoxPro = 5, @@ -1875,46 +1830,39 @@ declare namespace Excel { xlMicrosoftWord = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOartHorizontalOverflow { xlOartHorizontalOverflowClip = 1, xlOartHorizontalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOartVerticalOverflow { xlOartVerticalOverflowClip = 1, xlOartVerticalOverflowEllipsis = 2, xlOartVerticalOverflowOverflow = 0, } - // tslint:disable-next-line:no-const-enum const enum XlObjectSize { xlFitToPage = 2, xlFullPage = 3, xlScreenSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOLEType { xlOLEControl = 2, xlOLEEmbed = 1, xlOLELink = 0, } - // tslint:disable-next-line:no-const-enum const enum XlOLEVerb { xlVerbOpen = 2, xlVerbPrimary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlOrder { xlDownThenOver = 1, xlOverThenDown = 2, } - // tslint:disable-next-line:no-const-enum const enum XlOrientation { xlDownward = -4170, xlHorizontal = -4128, @@ -1922,26 +1870,22 @@ declare namespace Excel { xlVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreak { xlPageBreakAutomatic = -4105, xlPageBreakManual = -4135, xlPageBreakNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlPageBreakExtent { xlPageBreakFull = 1, xlPageBreakPartial = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPageOrientation { xlLandscape = 2, xlPortrait = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPaperSize { xlPaper10x14 = 16, xlPaper11x17 = 17, @@ -1987,7 +1931,6 @@ declare namespace Excel { xlPaperUser = 256, } - // tslint:disable-next-line:no-const-enum const enum XlParameterDataType { xlParamTypeBigInt = -5, xlParamTypeBinary = -2, @@ -2012,14 +1955,12 @@ declare namespace Excel { xlParamTypeWChar = -8, } - // tslint:disable-next-line:no-const-enum const enum XlParameterType { xlConstant = 1, xlPrompt = 0, xlRange = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPasteSpecialOperation { xlPasteSpecialOperationAdd = 2, xlPasteSpecialOperationDivide = 5, @@ -2028,7 +1969,6 @@ declare namespace Excel { xlPasteSpecialOperationSubtract = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPasteType { xlPasteAll = -4104, xlPasteAllExceptBorders = 7, @@ -2044,7 +1984,6 @@ declare namespace Excel { xlPasteValuesAndNumberFormats = 12, } - // tslint:disable-next-line:no-const-enum const enum XlPattern { xlPatternAutomatic = -4105, xlPatternChecker = 9, @@ -2070,7 +2009,6 @@ declare namespace Excel { xlPatternVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticAlignment { xlPhoneticAlignCenter = 2, xlPhoneticAlignDistributed = 3, @@ -2078,7 +2016,6 @@ declare namespace Excel { xlPhoneticAlignNoControl = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPhoneticCharacterType { xlHiragana = 2, xlKatakana = 1, @@ -2086,13 +2023,11 @@ declare namespace Excel { xlNoConversion = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPictureAppearance { xlPrinter = 2, xlScreen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPictureConvertorType { xlBMP = 1, xlCGM = 7, @@ -2109,7 +2044,6 @@ declare namespace Excel { xlWPG = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceIndex { xlCenterPoint = 5, xlInnerCenterPoint = 8, @@ -2122,13 +2056,11 @@ declare namespace Excel { xlOuterCounterClockwisePoint = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPieSliceLocation { xlHorizontalCoordinate = 1, xlVerticalCoordinate = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotCellType { xlPivotCellBlankCell = 9, xlPivotCellCustomSubtotal = 7, @@ -2142,14 +2074,12 @@ declare namespace Excel { xlPivotCellValue = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotConditionScope { xlDataFieldScope = 2, xlFieldsScope = 1, xlSelectionScope = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldCalculation { xlDifferenceFrom = 2, xlIndex = 9, @@ -2168,14 +2098,12 @@ declare namespace Excel { xlRunningTotal = 5, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldDataType { xlDate = 2, xlNumber = -4145, xlText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldOrientation { xlColumnField = 2, xlDataField = 4, @@ -2184,13 +2112,11 @@ declare namespace Excel { xlRowField = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFieldRepeatLabels { xlDoNotRepeatLabels = 1, xlRepeatLabels = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFilterType { xlAfter = 33, xlAfterOrEqualTo = 34, @@ -2262,7 +2188,6 @@ declare namespace Excel { xlYearToDate = 52, } - // tslint:disable-next-line:no-const-enum const enum XlPivotFormatType { xlPTClassic = 20, xlPTNone = 21, @@ -2288,7 +2213,6 @@ declare namespace Excel { xlTable9 = 18, } - // tslint:disable-next-line:no-const-enum const enum XlPivotLineType { xlPivotLineBlank = 3, xlPivotLineGrandTotal = 2, @@ -2296,7 +2220,6 @@ declare namespace Excel { xlPivotLineSubtotal = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableMissingItems { xlMissingItemsDefault = -1, xlMissingItemsMax = 32500, @@ -2304,7 +2227,6 @@ declare namespace Excel { xlMissingItemsNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableSourceType { xlConsolidation = 3, xlDatabase = 1, @@ -2313,7 +2235,6 @@ declare namespace Excel { xlScenario = 4, } - // tslint:disable-next-line:no-const-enum const enum XlPivotTableVersionList { xlPivotTableVersion10 = 1, xlPivotTableVersion11 = 2, @@ -2323,28 +2244,24 @@ declare namespace Excel { xlPivotTableVersionCurrent = -1, } - // tslint:disable-next-line:no-const-enum const enum XlPlacement { xlFreeFloating = 3, xlMove = 2, xlMoveAndSize = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPlatform { xlMacintosh = 1, xlMSDOS = 3, xlWindows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlPortugueseReform { xlPortugueseBoth = 3, xlPortuguesePostReform = 2, xlPortuguesePreReform = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPrintErrors { xlPrintErrorsBlank = 1, xlPrintErrorsDash = 2, @@ -2352,42 +2269,36 @@ declare namespace Excel { xlPrintErrorsNA = 3, } - // tslint:disable-next-line:no-const-enum const enum XlPrintLocation { xlPrintInPlace = 16, xlPrintNoComments = -4142, xlPrintSheetEnd = 1, } - // tslint:disable-next-line:no-const-enum const enum XlPriority { xlPriorityHigh = -4127, xlPriorityLow = -4134, xlPriorityNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlPropertyDisplayedIn { xlDisplayPropertyInPivotTable = 1, xlDisplayPropertyInPivotTableAndTooltip = 3, xlDisplayPropertyInTooltip = 2, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewCloseReason { xlProtectedViewCloseEdit = 1, xlProtectedViewCloseForced = 2, xlProtectedViewCloseNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlProtectedViewWindowState { xlProtectedViewWindowMaximized = 2, xlProtectedViewWindowMinimized = 1, xlProtectedViewWindowNormal = 0, } - // tslint:disable-next-line:no-const-enum const enum XlPTSelectionMode { xlBlanks = 4, xlButton = 15, @@ -2398,7 +2309,6 @@ declare namespace Excel { xlOrigin = 3, } - // tslint:disable-next-line:no-const-enum const enum XlQueryType { xlADORecordset = 7, xlDAORecordset = 2, @@ -2408,7 +2318,6 @@ declare namespace Excel { xlWebQuery = 4, } - // tslint:disable-next-line:no-const-enum const enum XlRangeAutoFormat { xlRangeAutoFormat3DEffects1 = 13, xlRangeAutoFormat3DEffects2 = 14, @@ -2455,20 +2364,17 @@ declare namespace Excel { xlRangeAutoFormatTable9 = 40, } - // tslint:disable-next-line:no-const-enum const enum XlRangeValueDataType { xlRangeValueDefault = 10, xlRangeValueMSPersistXML = 12, xlRangeValueXMLSpreadsheet = 11, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceStyle { xlA1 = 1, xlR1C1 = -4150, } - // tslint:disable-next-line:no-const-enum const enum XlReferenceType { xlAbsolute = 1, xlAbsRowRelColumn = 2, @@ -2476,7 +2382,6 @@ declare namespace Excel { xlRelRowAbsColumn = 3, } - // tslint:disable-next-line:no-const-enum const enum XlRemoveDocInfoType { xlRDIAll = 99, xlRDIComments = 1, @@ -2497,7 +2402,6 @@ declare namespace Excel { xlRDISendForReview = 7, } - // tslint:disable-next-line:no-const-enum const enum XlRgbColor { rgbAliceBlue = 16775408, rgbAntiqueWhite = 14150650, @@ -2645,33 +2549,28 @@ declare namespace Excel { rgbYellowGreen = 3329434, } - // tslint:disable-next-line:no-const-enum const enum XlRobustConnect { xlAlways = 1, xlAsRequired = 0, xlNever = 2, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipDelivery { xlAllAtOnce = 2, xlOneAfterAnother = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRoutingSlipStatus { xlNotYetRouted = 0, xlRoutingComplete = 2, xlRoutingInProgress = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRowCol { xlColumns = 2, xlRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlRunAutoMacro { xlAutoActivate = 3, xlAutoClose = 2, @@ -2679,51 +2578,43 @@ declare namespace Excel { xlAutoOpen = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAction { xlDoNotSaveChanges = 2, xlSaveChanges = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSaveAsAccessMode { xlExclusive = 3, xlNoChange = 1, xlShared = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSaveConflictResolution { xlLocalSessionChanges = 2, xlOtherSessionChanges = 3, xlUserResolution = 1, } - // tslint:disable-next-line:no-const-enum const enum XlScaleType { xlScaleLinear = -4132, xlScaleLogarithmic = -4133, } - // tslint:disable-next-line:no-const-enum const enum XlSearchDirection { xlNext = 1, xlPrevious = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSearchOrder { xlByColumns = 2, xlByRows = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSearchWithin { xlWithinSheet = 1, xlWithinWorkbook = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSheetType { xlChart = -4109, xlDialogSheet = -4116, @@ -2732,34 +2623,29 @@ declare namespace Excel { xlWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlSheetVisibility { xlSheetHidden = 0, xlSheetVeryHidden = 2, xlSheetVisible = -1, } - // tslint:disable-next-line:no-const-enum const enum XlSizeRepresents { xlSizeIsArea = 1, xlSizeIsWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerCrossFilterType { xlSlicerCrossFilterShowItemsWithDataAtTop = 2, xlSlicerCrossFilterShowItemsWithNoData = 3, xlSlicerNoCrossFilter = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSlicerSort { xlSlicerSortAscending = 2, xlSlicerSortDataSourceOrder = 1, xlSlicerSortDescending = 3, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagControlType { xlSmartTagControlActiveX = 13, xlSmartTagControlButton = 6, @@ -2777,32 +2663,27 @@ declare namespace Excel { xlSmartTagControlTextbox = 10, } - // tslint:disable-next-line:no-const-enum const enum XlSmartTagDisplayMode { xlButtonOnly = 2, xlDisplayNone = 1, xlIndicatorAndButton = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortDataOption { xlSortNormal = 0, xlSortTextAsNumbers = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethod { xlPinYin = 1, xlStroke = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortMethodOld { xlCodePage = 2, xlSyllabary = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSortOn { xlSortOnCellColor = 1, xlSortOnFontColor = 2, @@ -2810,25 +2691,21 @@ declare namespace Excel { xlSortOnValues = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrder { xlAscending = 1, xlDescending = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortOrientation { xlSortColumns = 1, xlSortRows = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSortType { xlSortLabels = 2, xlSortValues = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSourceType { xlSourceAutoFilter = 3, xlSourceChart = 5, @@ -2840,41 +2717,35 @@ declare namespace Excel { xlSourceWorkbook = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpanishModes { xlSpanishTuteoAndVoseo = 1, xlSpanishTuteoOnly = 0, xlSpanishVoseoOnly = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparklineRowCol { xlSparklineColumnsSquare = 2, xlSparklineNonSquare = 0, xlSparklineRowsSquare = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSparkScale { xlSparkScaleCustom = 3, xlSparkScaleGroup = 1, xlSparkScaleSingle = 2, } - // tslint:disable-next-line:no-const-enum const enum XlSparkType { xlSparkColumn = 2, xlSparkColumnStacked100 = 3, xlSparkLine = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSpeakDirection { xlSpeakByColumns = 1, xlSpeakByRows = 0, } - // tslint:disable-next-line:no-const-enum const enum XlSpecialCellsValue { xlErrors = 16, xlLogical = 4, @@ -2882,7 +2753,6 @@ declare namespace Excel { xlTextValues = 2, } - // tslint:disable-next-line:no-const-enum const enum XlStdColorScale { xlColorScaleBlackWhite = 3, xlColorScaleGYR = 2, @@ -2890,37 +2760,31 @@ declare namespace Excel { xlColorScaleWhiteBlack = 4, } - // tslint:disable-next-line:no-const-enum const enum XlSubscribeToFormat { xlSubscribeToPicture = -4147, xlSubscribeToText = -4158, } - // tslint:disable-next-line:no-const-enum const enum XlSubtototalLocationType { xlAtBottom = 2, xlAtTop = 1, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryColumn { xlSummaryOnLeft = -4131, xlSummaryOnRight = -4152, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryReportType { xlStandardSummary = 1, xlSummaryPivotTable = -4148, } - // tslint:disable-next-line:no-const-enum const enum XlSummaryRow { xlSummaryAbove = 0, xlSummaryBelow = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTableStyleElementType { xlBlankRow = 19, xlColumnStripe1 = 7, @@ -2962,32 +2826,27 @@ declare namespace Excel { xlWholeTable = 0, } - // tslint:disable-next-line:no-const-enum const enum XlTabPosition { xlTabPositionFirst = 0, xlTabPositionLast = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTextParsingType { xlDelimited = 1, xlFixedWidth = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextQualifier { xlTextQualifierDoubleQuote = 1, xlTextQualifierNone = -4142, xlTextQualifierSingleQuote = 2, } - // tslint:disable-next-line:no-const-enum const enum XlTextVisualLayoutType { xlTextVisualLTR = 1, xlTextVisualRTL = 2, } - // tslint:disable-next-line:no-const-enum const enum XlThemeColor { xlThemeColorAccent1 = 5, xlThemeColorAccent2 = 6, @@ -3003,20 +2862,17 @@ declare namespace Excel { xlThemeColorLight2 = 4, } - // tslint:disable-next-line:no-const-enum const enum XlThemeFont { xlThemeFontMajor = 1, xlThemeFontMinor = 2, xlThemeFontNone = 0, } - // tslint:disable-next-line:no-const-enum const enum XlThreadMode { xlThreadModeAutomatic = 0, xlThreadModeManual = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelOrientation { xlTickLabelOrientationAutomatic = -4105, xlTickLabelOrientationDownward = -4170, @@ -3025,7 +2881,6 @@ declare namespace Excel { xlTickLabelOrientationVertical = -4166, } - // tslint:disable-next-line:no-const-enum const enum XlTickLabelPosition { xlTickLabelPositionHigh = -4127, xlTickLabelPositionLow = -4134, @@ -3033,7 +2888,6 @@ declare namespace Excel { xlTickLabelPositionNone = -4142, } - // tslint:disable-next-line:no-const-enum const enum XlTickMark { xlTickMarkCross = 4, xlTickMarkInside = 2, @@ -3041,7 +2895,6 @@ declare namespace Excel { xlTickMarkOutside = 3, } - // tslint:disable-next-line:no-const-enum const enum XlTimePeriods { xlLast7Days = 2, xlLastMonth = 5, @@ -3055,14 +2908,12 @@ declare namespace Excel { xlYesterday = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTimeUnit { xlDays = 0, xlMonths = 1, xlYears = 2, } - // tslint:disable-next-line:no-const-enum const enum XlToolbarProtection { xlNoButtonChanges = 1, xlNoChanges = 4, @@ -3071,13 +2922,11 @@ declare namespace Excel { xlToolbarProtectionNone = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlTopBottom { xlTop10Bottom = 0, xlTop10Top = 1, } - // tslint:disable-next-line:no-const-enum const enum XlTotalsCalculation { xlTotalsCalculationAverage = 2, xlTotalsCalculationCount = 3, @@ -3091,7 +2940,6 @@ declare namespace Excel { xlTotalsCalculationVar = 8, } - // tslint:disable-next-line:no-const-enum const enum XlTrendlineType { xlExponential = 5, xlLinear = -4132, @@ -3101,7 +2949,6 @@ declare namespace Excel { xlPower = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUnderlineStyle { xlUnderlineStyleDouble = -4119, xlUnderlineStyleDoubleAccounting = 5, @@ -3110,14 +2957,12 @@ declare namespace Excel { xlUnderlineStyleSingleAccounting = 4, } - // tslint:disable-next-line:no-const-enum const enum XlUpdateLinks { xlUpdateLinksAlways = 3, xlUpdateLinksNever = 2, xlUpdateLinksUserSetting = 1, } - // tslint:disable-next-line:no-const-enum const enum XlVAlign { xlVAlignBottom = -4107, xlVAlignCenter = -4108, @@ -3126,7 +2971,6 @@ declare namespace Excel { xlVAlignTop = -4160, } - // tslint:disable-next-line:no-const-enum const enum XlWBATemplate { xlWBATChart = -4109, xlWBATExcel4IntlMacroSheet = 4, @@ -3134,28 +2978,24 @@ declare namespace Excel { xlWBATWorksheet = -4167, } - // tslint:disable-next-line:no-const-enum const enum XlWebFormatting { xlWebFormattingAll = 1, xlWebFormattingNone = 3, xlWebFormattingRTF = 2, } - // tslint:disable-next-line:no-const-enum const enum XlWebSelectionType { xlAllTables = 2, xlEntirePage = 1, xlSpecifiedTables = 3, } - // tslint:disable-next-line:no-const-enum const enum XlWindowState { xlMaximized = -4137, xlMinimized = -4140, xlNormal = -4143, } - // tslint:disable-next-line:no-const-enum const enum XlWindowType { xlChartAsWindow = 5, xlChartInPlace = 4, @@ -3164,34 +3004,29 @@ declare namespace Excel { xlWorkbook = 1, } - // tslint:disable-next-line:no-const-enum const enum XlWindowView { xlNormalView = 1, xlPageBreakPreview = 2, xlPageLayoutView = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXLMMacroType { xlCommand = 2, xlFunction = 1, xlNotXLM = 3, } - // tslint:disable-next-line:no-const-enum const enum XlXmlExportResult { xlXmlExportSuccess = 0, xlXmlExportValidationFailed = 1, } - // tslint:disable-next-line:no-const-enum const enum XlXmlImportResult { xlXmlImportElementsTruncated = 1, xlXmlImportSuccess = 0, xlXmlImportValidationFailed = 2, } - // tslint:disable-next-line:no-const-enum const enum XlXmlLoadOption { xlXmlLoadImportToList = 2, xlXmlLoadMapXml = 3, @@ -3199,13 +3034,37 @@ declare namespace Excel { xlXmlLoadPromptUser = 0, } - // tslint:disable-next-line:no-const-enum const enum XlYesNoGuess { xlGuess = 0, xlNo = 2, xlYes = 1, } + class AboveAverage { + private 'Excel.AboveAverage_typekey': AboveAverage; + private constructor(); + AboveBelow: XlAboveBelow; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + NumStdDev: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: number; + } + class Action { private 'Excel.Action_typekey': Action; private constructor(); @@ -3220,15 +3079,14 @@ declare namespace Excel { readonly Type: XlActionType; } - class Actions { - private 'Excel.Actions_typekey': Actions; - private constructor(); - _Default(Index: any): Action; + interface Actions { + _Default(Index: number | string): Action; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Action; + Item(Index: number | string): Action; readonly Parent: any; + (Index: number | string): Action; } class AddIn { @@ -3251,38 +3109,26 @@ declare namespace Excel { readonly Title: string; } - class AddIns { - private 'Excel.AddIns_typekey': AddIns; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; + interface AddIns { + _Default(Index: number | string): AddIn; + Add(Filename: string, CopyFile?: boolean): AddIn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): AddIn; + Item(Index: number | string): AddIn; readonly Parent: any; + (Index: number | string): AddIn; } - class AddIns2 { - private 'Excel.AddIns2_typekey': AddIns2; - private constructor(); - _Default(Index: any): AddIn; - Add(Filename: string, CopyFile?: any): AddIn; - readonly Application: Application; - readonly Count: number; - readonly Creator: XlCreator; - Item(Index: any): AddIn; - readonly Parent: any; - } + type AddIns2 = AddIns; - class Adjustments { - private 'Excel.Adjustments_typekey': Adjustments; - private constructor(); + interface Adjustments { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): number; readonly Parent: any; + (Index: number): number; } class AllowEditRange { @@ -3292,17 +3138,16 @@ declare namespace Excel { Delete(): void; Range: Range; Title: string; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly Users: UserAccessList; } - class AllowEditRanges { - private 'Excel.AllowEditRanges_typekey': AllowEditRanges; - private constructor(); - _Default(Index: any): AllowEditRange; - Add(Title: string, Range: Range, Password?: any): AllowEditRange; + interface AllowEditRanges { + _Default(Index: number | string): AllowEditRange; + Add(Title: string, Range: Range, Password?: string): AllowEditRange; readonly Count: number; - Item(Index: any): AllowEditRange; + Item(Index: number | string): AllowEditRange; + (Index: number | string): AllowEditRange; } class Application { @@ -3311,17 +3156,10 @@ declare namespace Excel { readonly _Default: string; _Evaluate(Name: any): any; _FindFile(): void; - _MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _MacroOptions(Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, HelpFile?: any): void; + _Run2(Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; _Wait(Time: any): void; - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; ActivateMicrosoftApp(Index: XlMSApplication): void; readonly ActiveCell: Range; readonly ActiveChart: Chart; @@ -3330,11 +3168,11 @@ declare namespace Excel { readonly ActiveMenuBar: MenuBar; ActivePrinter: string; readonly ActiveProtectedViewWindow: ProtectedViewWindow; - readonly ActiveSheet: Worksheet | Chart | DialogSheet; + readonly ActiveSheet: Sheet; readonly ActiveWindow: Window; readonly ActiveWorkbook: Workbook; AddChartAutoFormat(Chart: any, Name: string, Description?: any): void; - AddCustomList(ListArray: any, ByRow?: any): void; + AddCustomList(ListArray: SafeArray | Range, ByRow?: boolean): void; readonly AddIns: AddIns; readonly AddIns2: AddIns2; AlertBeforeOverwriting: boolean; @@ -3361,17 +3199,17 @@ declare namespace Excel { CalculationInterruptKey: XlCalculationInterruptKey; readonly CalculationState: XlCalculationState; readonly CalculationVersion: number; - Caller(Index?: any): any; + Caller(Index?: number): Range | string | Error; readonly CanPlaySounds: boolean; readonly CanRecordSounds: boolean; Caption: string; CellDragAndDrop: boolean; readonly Cells: Range; CentimetersToPoints(Centimeters: number): number; - readonly Charts: Sheets; - CheckAbort(KeepAbort?: any): void; - CheckSpelling(Word: string, CustomDictionary?: any, IgnoreUppercase?: any): boolean; - ClipboardFormats(Index?: any): any; + readonly Charts: Sheets; + CheckAbort(KeepAbort?: boolean): void; + CheckSpelling(Word: string, CustomDictionary?: string, IgnoreUppercase?: boolean): boolean; + ClipboardFormats: SafeArray & ((Index: number) => XlClipboardFormat); ClusterConnector: string; ColorButtons: boolean; readonly Columns: Range; @@ -3380,7 +3218,7 @@ declare namespace Excel { CommandUnderlines: XlCommandUnderlines; ConstrainNumeric: boolean; ControlCharacters: boolean; - ConvertFormula(Formula: any, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: any, ToAbsolute?: any, RelativeTo?: any): any; + ConvertFormula(Formula: string, FromReferenceStyle: XlReferenceStyle, ToReferenceStyle?: XlReferenceStyle, ToAbsolute?: XlReferenceType, RelativeTo?: Range): string; CopyObjectsWithCells: boolean; readonly Creator: XlCreator; Cursor: XlMousePointer; @@ -3403,7 +3241,7 @@ declare namespace Excel { DeleteChartAutoFormat(Name: string): void; DeleteCustomList(ListNum: number): void; readonly Dialogs: Dialogs; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayAlerts: boolean; DisplayClipboardWindow: boolean; DisplayCommentIndicator: XlCommentDisplayMode; @@ -3421,26 +3259,21 @@ declare namespace Excel { DisplayRecentFiles: boolean; DisplayScrollBars: boolean; DisplayStatusBar: boolean; - DisplayXMLSourcePane(XmlMap?: any): void; + DisplayXMLSourcePane(XmlMap?: XmlMap): void; DoubleClick(): void; Dummy1(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Dummy10(arg?: any): boolean; readonly Dummy101: any; Dummy11(): void; Dummy12(p1: PivotTable, p2: PivotTable): void; - Dummy13( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy13(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy14(): void; Dummy2(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any): any; Dummy20(grfCompareFunctions: number): any; Dummy22: boolean; Dummy23: boolean; Dummy3(): any; - Dummy4( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any): any; + Dummy4(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any): any; Dummy5(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any): any; Dummy6(): any; Dummy7(): any; @@ -3456,13 +3289,13 @@ declare namespace Excel { EnableSound: boolean; EnableTipWizard: boolean; readonly ErrorCheckingOptions: ErrorCheckingOptions; - Evaluate(Name: any): any; + Evaluate(Name: string): any; readonly Excel4IntlMacroSheets: Sheets; readonly Excel4MacroSheets: Sheets; ExecuteExcel4Macro(String: string): any; ExtendList: boolean; FeatureInstall: Office.MsoFeatureInstall; - FileConverters(Index1?: any, Index2?: any): any; + FileConverters(Index1?: string, Index2?: string): SafeArray; FileDialog(fileDialogType: Office.MsoFileDialogType): Office.FileDialog; readonly FileExportConverters: FileExportConverters; readonly FileFind: Office.IFind; @@ -3476,27 +3309,31 @@ declare namespace Excel { FormulaBarHeight: number; GenerateGetPivotData: boolean; GenerateTableRefs: XlGenerateTableRefs; - GetCustomListContents(ListNum: number): any; - GetCustomListNum(ListArray: any): number; - GetOpenFilename(FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any, MultiSelect?: any): any; - GetPhonetic(Text?: any): string; - GetSaveAsFilename(InitialFilename?: any, FileFilter?: any, FilterIndex?: any, Title?: any, ButtonText?: any): any; - Goto(Reference?: any, Scroll?: any): void; + GetCustomListContents(ListNum: number): SafeArray; + GetCustomListNum(ListArray: SafeArray): number; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: null, MultiSelect?: false): string; + + /** @param ButtonText Macintosh only */ + GetOpenFilename(FileFilter: string | null, FilterIndex: number | null, Title: string | null, ButtonText: null, MultiSelect: true): SafeArray; + GetPhonetic(Text?: string): string; + + /** @param ButtonText Macintosh only */ + GetSaveAsFilename(InitialFilename?: string, FileFilter?: string, FilterIndex?: number, Title?: string, ButtonText?: undefined): string; + Goto(Reference?: Range | string, Scroll?: boolean): void; Height: number; - Help(HelpFile?: any, HelpContextID?: any): void; + Help(HelpFile?: string, HelpContextID?: number): void; HighQualityModeForGraphics: boolean; readonly Hinstance: number; - readonly HinstancePtr: any; + readonly HinstancePtr: number; readonly Hwnd: number; IgnoreRemoteRequests: boolean; InchesToPoints(Inches: number): number; - InputBox(Prompt: string, Title?: any, Default?: any, Left?: any, Top?: any, HelpFile?: any, HelpContextID?: any, Type?: any): any; + InputBox(Prompt: string, Title?: string, Default?: string, Left?: number, Top?: number, HelpFile?: string, HelpContextID?: number, Type?: InputBoxReturnType): string | number | boolean | Range | Error | SafeArray | SafeArray | SafeArray; Interactive: boolean; - International(Index?: any): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, - Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, - Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; + International: SafeArray & ((Index: T) => InternationalResult); + Intersect(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly IsSandboxed: boolean; Iteration: boolean; readonly LanguageSettings: Office.LanguageSettings; @@ -3504,12 +3341,10 @@ declare namespace Excel { LargeOperationCellThousandCount: number; Left: number; readonly LibraryPath: string; - MacroOptions( - Macro?: any, Description?: any, HasMenu?: any, MenuText?: any, HasShortcutKey?: any, ShortcutKey?: any, Category?: any, StatusBar?: any, HelpContextID?: any, - HelpFile?: any, ArgumentDescriptions?: any): void; + MacroOptions(Macro?: string, Description?: string, HasMenu?: undefined, MenuText?: undefined, HasShortcutKey?: boolean, ShortcutKey?: string, Category?: FunctionCategory | string, StatusBar?: string, HelpContextID?: number, HelpFile?: string, ArgumentDescriptions?: SafeArray): void; MailLogoff(): void; - MailLogon(Name?: any, Password?: any, DownloadNewMail?: any): void; - readonly MailSession: any; + MailLogon(Name?: string, Password?: string, DownloadNewMail?: boolean): void; + readonly MailSession: string | null; readonly MailSystem: XlMailSystem; MapPaperSize: boolean; readonly MathCoprocessorAvailable: boolean; @@ -3537,11 +3372,11 @@ declare namespace Excel { OnData: string; OnDoubleClick: string; OnEntry: string; - OnKey(Key: string, Procedure?: any): void; + OnKey(Key: string, Procedure?: string): void; OnRepeat(Text: string, Procedure: string): void; OnSheetActivate: string; OnSheetDeactivate: string; - OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: any): void; + OnTime(EarliestTime: any, Procedure: string, LatestTime?: any, Schedule?: boolean): void; OnUndo(Text: string, Procedure: string): void; OnWindow: string; readonly OperatingSystem: string; @@ -3550,7 +3385,7 @@ declare namespace Excel { readonly Path: string; readonly PathSeparator: string; PivotTableSelection: boolean; - PreviousSelections(Index?: any): any; + PreviousSelections(Index: 1 | 2 | 3 | 4): Range | null; PrintCommunication: boolean; readonly ProductCode: string; PromptForSummaryInfo: boolean; @@ -3560,10 +3395,13 @@ declare namespace Excel { Range(Cell1: string | Range, Cell2?: string | Range): Range; readonly Ready: boolean; readonly RecentFiles: RecentFiles; - RecordMacro(BasicCode?: any, XlmCode?: any): void; + RecordMacro(BasicCode: string): void; + + /** This overload prevents recording */ + RecordMacro(BasicCode: '', XlmCode: ''): void; readonly RecordRelative: boolean; ReferenceStyle: XlReferenceStyle; - RegisteredFunctions(Index1?: any, Index2?: any): any; + RegisteredFunctions(Index1: string | undefined, Index2?: string): SafeArray | null; RegisterXLL(Filename: string): boolean; Repeat(): void; ReplaceFormat: CellFormat; @@ -3571,16 +3409,15 @@ declare namespace Excel { RollZoom: boolean; readonly Rows: Range; readonly RTD: RTD; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Macro?: string | Range | number, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Save(Filename?: any): void; SaveISO8601Dates: boolean; + + /** @deprecated */ SaveWorkspace(Filename?: any): void; ScreenUpdating: boolean; readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; + SendKeys(Keys: string, Wait?: boolean): void; SetDefaultChart(FormatName?: any, Gallery?: any): void; SharePointVersion(bstrUrl: string): number; readonly Sheets: Sheets; @@ -3603,7 +3440,15 @@ declare namespace Excel { StandardFont: string; StandardFontSize: number; readonly StartupPath: string; - StatusBar: any; + + /** + * Get or set the text of the status bar + * + * Returns `false` if Microsoft Excel has control of the status bar. + * + * To restore the default status bar text, set the property to False ; this works even if the status bar is hidden. + */ + StatusBar: string | false; Support(Object: any, ID: number, arg?: any): any; readonly TemplatesPath: string; readonly ThisCell: Range; @@ -3616,10 +3461,7 @@ declare namespace Excel { TransitionNavigKeys: boolean; UILanguage: number; Undo(): void; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; + Union(Arg1: Range, Arg2: Range, Arg3?: Range, Arg4?: Range, Arg5?: Range, Arg6?: Range, Arg7?: Range, Arg8?: Range, Arg9?: Range, Arg10?: Range, Arg11?: Range, Arg12?: Range, Arg13?: Range, Arg14?: Range, Arg15?: Range, Arg16?: Range, Arg17?: Range, Arg18?: Range, Arg19?: Range, Arg20?: Range, Arg21?: Range, Arg22?: Range, Arg23?: Range, Arg24?: Range, Arg25?: Range, Arg26?: Range, Arg27?: Range, Arg28?: Range, Arg29?: Range, Arg30?: Range): Range; readonly UsableHeight: number; readonly UsableWidth: number; UseClusterConnector: boolean; @@ -3632,7 +3474,11 @@ declare namespace Excel { readonly VBE: VBIDE.VBE; readonly Version: string; Visible: boolean; - Volatile(Volatile?: any): void; + + /** + * @param Volatile [Volatile=true] + */ + Volatile(Volatile?: boolean): void; Wait(Time: any): boolean; WarnOnFunctionNameConflict: boolean; readonly Watches: Watches; @@ -3642,24 +3488,25 @@ declare namespace Excel { WindowState: XlWindowState; readonly Workbooks: Workbooks; readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; } - class Areas { - private 'Excel.Areas_typekey': Areas; - private constructor(); + interface Areas { _Default(Index: number): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Range; readonly Parent: any; + (Index: number): Range; } class AutoCorrect { private 'Excel.AutoCorrect_typekey': AutoCorrect; private constructor(); - AddReplacement(What: string, Replacement: string): any; + + /** @returns The string to be replaced */ + AddReplacement(What: string, Replacement: string): string; readonly Application: Application; AutoExpandListRange: boolean; AutoFillFormulasInLists: boolean; @@ -3667,10 +3514,12 @@ declare namespace Excel { CorrectCapsLock: boolean; CorrectSentenceCap: boolean; readonly Creator: XlCreator; - DeleteReplacement(What: string): any; + + /** @returns The string to be replaced */ + DeleteReplacement(What: string): string; DisplayAutoCorrectOptions: boolean; readonly Parent: any; - ReplacementList(Index?: any): any; + ReplacementList(Index: number): SafeArray; ReplaceText: boolean; TwoInitialCapitals: boolean; } @@ -3700,62 +3549,172 @@ declare namespace Excel { Time: number; } + interface Axes { + /** @param AxisGroup [AxisGroup=1] */ + _Default(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + + /** @param AxisGroup [AxisGroup=1] */ + Item(Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + readonly Parent: any; + + /** @param AxisGroup [AxisGroup=1] */ + (Type: XlAxisType, AxisGroup?: XlAxisGroup): Axis; + } + + class Axis { + private 'Excel.Axis_typekey': Axis; + private constructor(); + readonly Application: Application; + AxisBetweenCategories: boolean; + readonly AxisGroup: XlAxisGroup; + readonly AxisTitle: AxisTitle; + BaseUnit: XlTimeUnit; + BaseUnitIsAuto: boolean; + readonly Border: Border; + CategoryNames: SafeArray | Range; + CategoryType: XlCategoryType; + readonly Creator: XlCreator; + Crosses: XlAxisCrosses; + CrossesAt: number; + Delete(): any; + DisplayUnit: XlDisplayUnit; + DisplayUnitCustom: number; + readonly DisplayUnitLabel: DisplayUnitLabel; + readonly Format: ChartFormat; + HasDisplayUnitLabel: boolean; + HasMajorGridlines: boolean; + HasMinorGridlines: boolean; + HasTitle: boolean; + readonly Height: number; + readonly Left: number; + LogBase: number; + readonly MajorGridlines: Gridlines; + MajorTickMark: XlTickMark; + MajorUnit: number; + MajorUnitIsAuto: boolean; + MajorUnitScale: XlTimeUnit; + MaximumScale: number; + MaximumScaleIsAuto: boolean; + MinimumScale: number; + MinimumScaleIsAuto: boolean; + readonly MinorGridlines: Gridlines; + MinorTickMark: XlTickMark; + MinorUnit: number; + MinorUnitIsAuto: boolean; + MinorUnitScale: XlTimeUnit; + readonly Parent: any; + ReversePlotOrder: boolean; + ScaleType: XlScaleType; + Select(): any; + TickLabelPosition: XlTickLabelPosition; + readonly TickLabels: TickLabels; + TickLabelSpacing: number; + TickLabelSpacingIsAuto: boolean; + TickMarkSpacing: number; + readonly Top: number; + Type: XlAxisType; + readonly Width: number; + } + + class AxisTitle { + private 'Excel.AxisTitle_typekey': AxisTitle; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + IncludeInLayout: boolean; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: number | XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + class Border { private 'Excel.Border_typekey': Border; private constructor(); readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - LineStyle: XlLineStyle | Constants.xlGray25 | Constants.xlGray50 | Constants.xlGray75 | Constants.xlAutomatic; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Weight: XlBorderWeight; } - class Borders { - private 'Excel.Borders_typekey': Borders; - private constructor(); + interface Borders { _Default(Index: XlBordersIndex): Border; readonly Application: Application; - Color: any; - ColorIndex: any; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex | null; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBordersIndex): Border; - LineStyle: any; + LineStyle: LineStyle; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; - Value: any; - Weight: any; + ThemeColor: XlThemeColor; + TintAndShade: number; + Value: LineStyle; + Weight: XlBorderWeight; + (Index: XlBordersIndex): Border; } - class CalculatedFields { - private 'Excel.CalculatedFields_typekey': CalculatedFields; - private constructor(); + interface CalculatedFields { _Add(Name: string, Formula: string): PivotField; _Default(Field: any): PivotField; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotField; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotField; + Item(Index: number | string): PivotField; readonly Parent: any; + (Field: number | string): PivotField; } - class CalculatedItems { - private 'Excel.CalculatedItems_typekey': CalculatedItems; - private constructor(); + interface CalculatedItems { _Add(Name: string, Formula: string): PivotItem; - _Default(Field: any): PivotItem; - Add(Name: string, Formula: string, UseStandardFormula?: any): PivotItem; + _Default(Field: number | string): PivotItem; + + /** + * @param UseStandardFormula [UseStandardFormula=false] + */ + Add(Name: string, Formula: string, UseStandardFormula?: boolean): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } class CalculatedMember { @@ -3778,17 +3737,19 @@ declare namespace Excel { readonly Type: XlCalculatedMemberType; } - class CalculatedMembers { - private 'Excel.CalculatedMembers_typekey': CalculatedMembers; - private constructor(); + interface CalculatedMembers { _Add(Name: string, Formula: string, SolveOrder?: any, Type?: any): CalculatedMember; _Default(Index: any): CalculatedMember; - Add(Name: string, Formula: any, SolveOrder?: any, Type?: any, Dynamic?: any, DisplayFolder?: any, HierarchizeDistinct?: any): CalculatedMember; + Add(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, Dynamic?: boolean, DisplayFolder?: string, HierarchizeDistinct?: boolean): CalculatedMember; + + /** @version 2013 */ + AddCalculatedMember(Name: string, Formula: string, SolveOrder?: number, Type?: XlCalculatedMemberType, DisplayFolder?: string, MeasureGroup?: any, ParentMember?: any, NumberFormat?: any): CalculatedMember; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CalculatedMember; + Item(Index: number | string): CalculatedMember; readonly Parent: any; + (Index: number | string): CalculatedMember; } class CalloutFormat { @@ -3816,25 +3777,25 @@ declare namespace Excel { class CellFormat { private 'Excel.CellFormat_typekey': CellFormat; private constructor(); - AddIndent: any; + AddIndent: boolean; readonly Application: Application; Borders: Borders; Clear(): void; readonly Creator: XlCreator; Font: Font; - FormulaHidden: any; - HorizontalAlignment: any; - IndentLevel: any; + FormulaHidden: boolean | null; + HorizontalAlignment: HorizontalAlignments; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; Interior: Interior; - Locked: any; - MergeCells: any; - NumberFormat: any; - NumberFormatLocal: any; - Orientation: any; + Locked: boolean | null; + MergeCells: boolean; + NumberFormat: string | null; + NumberFormatLocal: string | null; + Orientation: number | XlOrientation; readonly Parent: any; - ShrinkToFit: any; - VerticalAlignment: any; - WrapText: any; + ShrinkToFit: boolean | null; + VerticalAlignment: VerticalAlignments; + WrapText: boolean | null; } class Characters { @@ -3844,9 +3805,9 @@ declare namespace Excel { Caption: string; readonly Count: number; readonly Creator: XlCreator; - Delete(): any; + Delete(): null; readonly Font: Font; - Insert(String: string): any; + Insert(String: string | null): string; readonly Parent: any; PhoneticCharacters: string; Text: string; @@ -3857,67 +3818,62 @@ declare namespace Excel { private constructor(); __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ + /** @param Type [Type=2] */ _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): void; _CodeName: string; _Evaluate(Name: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; ApplyChartTemplate(Filename: string): void; ApplyCustomType(ChartType: XlChartType, TypeName?: any): void; - /** @param Excel.XlDataLabelsType [Type=2] */ - ApplyDataLabels( - Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, - ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; - ApplyLayout(Layout: number, ChartType?: any): void; + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): void; + ApplyLayout(Layout: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, ChartType?: XlChartType): void; Arcs(Index?: any): any; readonly Area3DGroup: ChartGroup; AreaGroups(Index?: any): any; AutoFormat(Gallery: number, Format?: any): void; AutoScaling: boolean; - /** @param Excel.XlAxisGroup [AxisGroup=1] */ - Axes(Type: any, AxisGroup?: XlAxisGroup): any; + /** @param AxisGroup [AxisGroup=1] */ + Axes(Type?: XlAxisType, AxisGroup?: XlAxisGroup): Axes | Axis; readonly BackWall: Walls; readonly Bar3DGroup: ChartGroup; BarGroups(Index?: any): any; BarShape: XlBarShape; Buttons(Index?: any): any; readonly ChartArea: ChartArea; - ChartGroups(Index?: any): any; - ChartObjects(Index?: any): any; - ChartStyle: any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; + ChartStyle: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48; readonly ChartTitle: ChartTitle; ChartType: XlChartType; - ChartWizard( - Source?: any, Gallery?: any, Format?: any, PlotBy?: any, CategoryLabels?: any, SeriesLabels?: any, HasLegend?: any, Title?: any, CategoryTitle?: any, - ValueTitle?: any, ExtraTitle?: any): void; + ChartWizard(Source?: Range, Gallery?: XlChartType, Format?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, PlotBy?: XlRowCol, CategoryLabels?: number, SeriesLabels?: number, HasLegend?: boolean, Title?: string, CategoryTitle?: string, ValueTitle?: string, ExtraTitle?: string): void; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; ClearToMatchStyle(): void; readonly CodeName: string; readonly Column3DGroup: ChartGroup; ColumnGroups(Index?: any): any; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; CopyChartBuild(): void; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] - * @param Excel.XlPictureAppearance [Size=2] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] + * @param Size [Size=2] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat, Size?: XlPictureAppearance): void; readonly Corners: Corners; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [Size=1] + * @param Appearance [Appearance=1] + * @param Size [Size=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, Size?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): void; readonly Creator: XlCreator; @@ -3933,17 +3889,15 @@ declare namespace Excel { Dummy24: boolean; Dummy25: boolean; Elevation: number; - Evaluate(Name: any): any; - Export(Filename: string, FilterName?: any, Interactive?: any): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + Export(Filename: string, FilterName?: string, Interactive?: boolean): boolean; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly Floor: Floor; GapDepth: number; GetChartElement(x: number, y: number, ElementID: number, Arg1: number, Arg2: number): void; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; - HasAxis(Index1?: any, Index2?: any): any; + HasAxis(Index1?: XlAxisType, Index2?: XlAxisGroup): boolean; HasDataTable: boolean; HasLegend: boolean; HasPivotFields: boolean; @@ -3957,12 +3911,14 @@ declare namespace Excel { LineGroups(Index?: any): any; Lines(Index?: any): any; ListBoxes(Index?: any): any; - Location(Where: XlChartLocation, Name?: any): Chart; + Location(Where: XlChartLocation.xlLocationAsObject, Name: string): Chart; + Location(Where: XlChartLocation, Name?: string): Chart; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Sheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnDoubleClick: string; OnSheetActivate: string; OnSheetDeactivate: string; @@ -3970,7 +3926,7 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Type?: any): void; + Paste(Type?: XlPasteType.xlPasteAll | XlPasteType.xlPasteFormats | XlPasteType.xlPasteFormulas): void; Perspective: number; Pictures(Index?: any): any; readonly Pie3DGroup: ChartGroup; @@ -3979,11 +3935,13 @@ declare namespace Excel { readonly PlotArea: PlotArea; PlotBy: XlRowCol; PlotVisibleOnly: boolean; - readonly Previous: any; + readonly Previous: Sheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): void; + + /** @param Scenarios Passing `true` for this argument is only valid on worksheets */ + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: false, UserInterfaceOnly?: boolean): void; readonly ProtectContents: boolean; ProtectData: boolean; readonly ProtectDrawingObjects: boolean; @@ -3994,20 +3952,20 @@ declare namespace Excel { RadarGroups(Index?: any): any; Rectangles(Index?: any): any; Refresh(): void; - RightAngleAxes: any; - Rotation: any; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + + /** `true` if the chart axes are at right angles, independent of chart rotation or elevation. Applies only to 3-D line, column, and bar charts. */ + RightAngleAxes: boolean; + Rotation: number; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; SaveChartTemplate(Filename: string): void; readonly Scripts: Office.Scripts; ScrollBars(Index?: any): any; - Select(Replace?: any): void; - SeriesCollection(Index?: any): any; + Select(Replace?: boolean): void; + SeriesCollection(Index?: number | string): SeriesCollection | Series; SetBackgroundPicture(Filename: string): void; SetDefaultChart(Name: any): void; SetElement(Element: Office.MsoChartElementType): void; - SetSourceData(Source: Range, PlotBy?: any): void; + SetSourceData(Source: Range, PlotBy?: XlRowCol): void; readonly Shapes: Shapes; ShowAllFieldButtons: boolean; ShowAxisFieldButtons: boolean; @@ -4024,7 +3982,7 @@ declare namespace Excel { readonly Tab: Tab; TextBoxes(Index?: any): any; Type: number; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; Visible: XlSheetVisibility; readonly Walls: Walls; WallsAndGridlines2D: boolean; @@ -4138,18 +4096,114 @@ declare namespace Excel { readonly Parent: any; readonly RadarAxisLabels: TickLabels; SecondPlotSize: number; - SeriesCollection(Index?: any): any; + SeriesCollection(Index?: number | string): SeriesCollection | Series; readonly SeriesLines: SeriesLines; ShowNegativeBubbles: boolean; SizeRepresents: XlSizeRepresents; SplitType: XlChartSplitType; - SplitValue: any; + SplitValue: number; SubType: number; Type: number; readonly UpBars: UpBars; VaryByCategories: boolean; } + interface ChartGroups { + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): ChartGroup; + readonly Parent: any; + (Index: number): ChartGroup; + } + + class ChartObject { + private 'Excel.ChartObject_typekey': ChartObject; + private constructor(); + _Copy(): any; + Activate(): any; + readonly Application: Application; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + readonly Chart: Chart; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Height: number; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface ChartObjects { + _Copy(): any; + _Default(Index: any): any; + Add(Left: number, Top: number, Width: number, Height: number): ChartObject; + readonly Application: Application; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): ChartObject; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: XlPlacement; + PrintObject: boolean; + ProtectChartObject: boolean; + RoundedCorners: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + Visible: boolean; + Width: number; + (Index: number | string): any; + } + class ChartTitle { private 'Excel.ChartTitle_typekey': ChartTitle; private constructor(); @@ -4157,7 +4211,7 @@ declare namespace Excel { AutoScaleFont: any; readonly Border: Border; Caption: string; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; Delete(): any; readonly Fill: ChartFillFormat; @@ -4168,7 +4222,7 @@ declare namespace Excel { FormulaR1C1: string; FormulaR1C1Local: string; readonly Height: number; - HorizontalAlignment: any; + HorizontalAlignment: HorizontalAlignments; IncludeInLayout: boolean; readonly Interior: Interior; Left: number; @@ -4181,7 +4235,7 @@ declare namespace Excel { Shadow: boolean; Text: string; Top: number; - VerticalAlignment: any; + VerticalAlignment: VerticalAlignments; readonly Width: number; } @@ -4199,6 +4253,42 @@ declare namespace Excel { readonly Type: Office.MsoColorType; } + class ColorScale { + private 'Excel.ColorScale_typekey': ColorScale; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly ColorScaleCriteria: ColorScaleCriteria; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + interface ColorScaleCriteria { + _Default(Index: any): ColorScaleCriterion; + readonly Count: number; + Item(Index: number): ColorScaleCriterion; + (Index: number): ColorScaleCriterion; + } + + class ColorScaleCriterion { + private 'Excel.ColorScaleCriterion_typekey': ColorScaleCriterion; + private constructor(); + readonly FormatColor: FormatColor; + readonly Index: number; + Type: XlConditionValueTypes; + Value: any; + } + class Comment { private 'Excel.Comment_typekey': Comment; private constructor(); @@ -4210,32 +4300,44 @@ declare namespace Excel { readonly Parent: any; Previous(): Comment; readonly Shape: Shape; - Text(Text?: any, Start?: any, Overwrite?: any): string; + Text(Text?: string, Start?: number, Overwrite?: boolean): string; Visible: boolean; } - class Comments { - private 'Excel.Comments_typekey': Comments; - private constructor(); + interface Comments { _Default(Index: number): Comment; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Comment; readonly Parent: any; + (Index: number): Comment; } - class Connections { - private 'Excel.Connections_typekey': Connections; + class ConditionValue { + private 'Excel.ConditionValue_typekey': ConditionValue; private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + Modify(newtype: XlConditionValueTypes.xlConditionValueLowestValue | XlConditionValueTypes.xlConditionValueHighestValue): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueNumber | XlConditionValueTypes.xlConditionValuePercent | XlConditionValueTypes.xlConditionValuePercentile, newvalue: number): void; + Modify(newtype: XlConditionValueTypes.xlConditionValueFormula, newvalue: string): void; + Modify(newtype: XlConditionValueTypes, newvalue?: any): void; + readonly Parent: any; + readonly Type: XlConditionValueTypes; + Value: number | string; + } + + interface Connections { _Default(Index: any): WorkbookConnection; - Add(Name: string, Description: string, ConnectionString: any, CommandText: any, lCmdtype?: any): WorkbookConnection; + Add(Name: string, Description: string, ConnectionString: string, CommandText: string, lCmdtype?: any): WorkbookConnection; AddFromFile(Filename: string): WorkbookConnection; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): WorkbookConnection; + Item(Index: number): WorkbookConnection; readonly Parent: any; + (Index: number): WorkbookConnection; } class ConnectorFormat { @@ -4261,14 +4363,15 @@ declare namespace Excel { private 'Excel.ControlFormat_typekey': ControlFormat; private constructor(); _Default: number; - AddItem(Text: string, Index?: any): void; + AddItem(Text: string, Index?: number): void; readonly Application: Application; readonly Creator: XlCreator; DropDownLines: number; Enabled: boolean; LargeChange: number; LinkedCell: string; - List(Index?: any): any; + List(Index: number): string; + List(): SafeArray; ListCount: number; ListFillRange: string; ListIndex: number; @@ -4279,7 +4382,7 @@ declare namespace Excel { readonly Parent: any; PrintObject: boolean; RemoveAllItems(): void; - RemoveItem(Index: number, Count?: any): void; + RemoveItem(Index: number, Count?: number): void; SmallChange: number; Value: number; } @@ -4299,7 +4402,7 @@ declare namespace Excel { private constructor(); _AddMemberPropertyField(Property: string, PropertyOrder?: any): void; readonly _Caption: string; - AddMemberPropertyField(Property: string, PropertyOrder?: any, PropertyDisplayedIn?: any): void; + AddMemberPropertyField(Property: string, PropertyOrder?: number, PropertyDisplayedIn?: XlPropertyDisplayedIn): void; readonly AllItemsVisible: boolean; readonly Application: Application; Caption: string; @@ -4334,28 +4437,26 @@ declare namespace Excel { readonly Value: string; } - class CubeFields { - private 'Excel.CubeFields_typekey': CubeFields; - private constructor(); + interface CubeFields { _Default(Index: any): CubeField; AddSet(Name: string, Caption: string): CubeField; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CubeField; + Item(Index: number | string): CubeField; readonly Parent: any; + (Index: number | string): CubeField; } - class CustomProperties { - private 'Excel.CustomProperties_typekey': CustomProperties; - private constructor(); + interface CustomProperties { _Default(Index: any): CustomProperty; Add(Name: string, Value: any): CustomProperty; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): CustomProperty; + Item(Index: number | string): CustomProperty; readonly Parent: any; + (Index: number | string): CustomProperty; } class CustomProperty { @@ -4383,16 +4484,139 @@ declare namespace Excel { Show(): void; } - class CustomViews { - private 'Excel.CustomViews_typekey': CustomViews; - private constructor(); + interface CustomViews { _Default(ViewName: any): CustomView; - Add(ViewName: string, PrintSettings?: any, RowColSettings?: any): CustomView; + Add(ViewName: string, PrintSettings?: boolean, RowColSettings?: boolean): CustomView; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(ViewName: any): CustomView; + Item(ViewName: number | string): CustomView; readonly Parent: any; + (ViewName: number | string): CustomView; + } + + class Databar { + private 'Excel.Databar_typekey': Databar; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly AxisColor: FormatColor; + AxisPosition: XlDataBarAxisPosition; + readonly BarBorder: DataBarBorder; + readonly BarColor: FormatColor; + BarFillType: XlDataBarFillType; + readonly Creator: XlCreator; + Delete(): void; + Direction: number; + Formula: string; + readonly MaxPoint: ConditionValue; + readonly MinPoint: ConditionValue; + ModifyAppliesToRange(Range: Range): void; + readonly NegativeBarFormat: NegativeBarFormat; + readonly Parent: any; + PercentMax: number; + PercentMin: number; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowValue: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + class DataBarBorder { + private 'Excel.DataBarBorder_typekey': DataBarBorder; + private constructor(); + readonly Application: Application; + readonly Color: FormatColor; + readonly Creator: XlCreator; + readonly Parent: any; + Type: XlDataBarBorderType; + } + + class DataLabel { + private 'Excel.DataLabel_typekey': DataLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Text: string; + Top: number; + Type: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; + } + + interface DataLabels { + _Default(Index: any): DataLabel; + readonly Application: Application; + AutoScaleFont: any; + AutoText: boolean; + readonly Border: Border; + readonly Count: number; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Item(Index: number): DataLabel; + readonly Name: string; + NumberFormat: string; + NumberFormatLinked: boolean; + NumberFormatLocal: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlDataLabelPosition; + ReadingOrder: number; + Select(): any; + Separator: string | XlDataLabelSeparator; + Shadow: boolean; + ShowBubbleSize: boolean; + ShowCategoryName: boolean; + ShowLegendKey: boolean; + ShowPercentage: boolean; + ShowSeriesName: boolean; + ShowValue: boolean; + Type: any; + VerticalAlignment: VerticalAlignments; + (Index: number): DataLabel; } class DataTable { @@ -4460,14 +4684,14 @@ declare namespace Excel { private constructor(); /** - * @param Office.MsoRelativeNodePosition [pos=2] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param pos [pos=2] + * @param nodeType [nodeType=1] */ AddNode(pos?: Office.MsoRelativeNodePosition, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; readonly Children: DiagramNodeChildren; - /** @param Office.MsoRelativeNodePosition [pos=2] */ + /** @param pos [pos=2] */ CloneNode(copyChildren: boolean, pTargetNode: DiagramNode, pos?: Office.MsoRelativeNodePosition): DiagramNode; readonly Creator: number; Delete(): void; @@ -4481,19 +4705,16 @@ declare namespace Excel { readonly Root: DiagramNode; readonly Shape: Shape; - /** @param boolean [swapChildren=true] */ + /** @param swapChildren [swapChildren=true] */ SwapNode(pTargetNode: DiagramNode, swapChildren?: boolean): void; readonly TextShape: Shape; TransferChildren(pReceivingNode: DiagramNode): void; } - class DiagramNodeChildren { - private 'Excel.DiagramNodeChildren_typekey': DiagramNodeChildren; - private constructor(); - + interface DiagramNodeChildren { /** - * @param any [Index=-1] - * @param Office.MsoDiagramNodeType [nodeType=1] + * @param Index [Index=-1] + * @param nodeType [nodeType=1] */ AddNode(Index?: any, nodeType?: Office.MsoDiagramNodeType): DiagramNode; readonly Application: any; @@ -4504,17 +4725,17 @@ declare namespace Excel { readonly LastChild: DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } - class DiagramNodes { - private 'Excel.DiagramNodes_typekey': DiagramNodes; - private constructor(); + interface DiagramNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } class Dialog { @@ -4523,10 +4744,7 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Parent: any; - Show( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Show(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; } class DialogFrame { @@ -4538,8 +4756,8 @@ declare namespace Excel { CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -4557,15 +4775,14 @@ declare namespace Excel { Width: number; } - class Dialogs { - private 'Excel.Dialogs_typekey': Dialogs; - private constructor(); + interface Dialogs { _Default(Index: XlBuiltInDialog): Dialog; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlBuiltInDialog): Dialog; readonly Parent: any; + (Index: XlBuiltInDialog): Dialog; } class DialogSheet { @@ -4579,9 +4796,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -4594,7 +4809,8 @@ declare namespace Excel { ClearCircles(): void; readonly CodeName: string; readonly Comments: Comments; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; DefaultButton: any; @@ -4614,9 +4830,7 @@ declare namespace Excel { EnablePivotTable: boolean; EnableSelection: XlEnableSelection; Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, FixedFormatExtClassPtr?: any): void; Focus: any; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -4628,7 +4842,7 @@ declare namespace Excel { Lines(Index?: any): any; ListBoxes(Index?: any): any; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; readonly Next: any; @@ -4645,12 +4859,9 @@ declare namespace Excel { Pictures(Index?: any): any; readonly Previous: any; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -4659,9 +4870,7 @@ declare namespace Excel { readonly QueryTables: QueryTables; Rectangles(Index?: any): any; ResetAllPageBreaks(): void; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any, Local?: any): void; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; @@ -4678,30 +4887,73 @@ declare namespace Excel { readonly VPageBreaks: VPageBreaks; } + class DialogSheetView { + private 'Excel.DialogSheetView_typekey': DialogSheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + readonly Parent: any; + readonly Sheet: DialogSheet; + } + class DisplayFormat { private 'Excel.DisplayFormat_typekey': DisplayFormat; private constructor(); - readonly AddIndent: any; + readonly AddIndent: boolean | null; readonly Application: Application; readonly Borders: Borders; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; readonly Font: Font; - readonly FormulaHidden: any; + readonly FormulaHidden: boolean | null; readonly HorizontalAlignment: any; readonly IndentLevel: any; readonly Interior: Interior; - readonly Locked: any; - readonly MergeCells: any; - readonly NumberFormat: any; - readonly NumberFormatLocal: any; + readonly Locked: boolean | null; + readonly MergeCells: boolean; + readonly NumberFormat: string | null; + readonly NumberFormatLocal: string | null; readonly Orientation: any; readonly Parent: any; readonly ReadingOrder: number; - readonly ShrinkToFit: any; - readonly Style: any; + readonly ShrinkToFit: boolean; + readonly Style: Style; readonly VerticalAlignment: any; - readonly WrapText: any; + readonly WrapText: boolean; + } + + class DisplayUnitLabel { + private 'Excel.DisplayUnitLabel_typekey': DisplayUnitLabel; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Border: Border; + Caption: string; + Characters(Start?: number, Length?: number): Characters; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Font: Font; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + readonly Height: number; + HorizontalAlignment: HorizontalAlignments; + readonly Interior: Interior; + Left: number; + readonly Name: string; + Orientation: XlOrientation; + readonly Parent: any; + Position: XlChartElementPosition; + ReadingOrder: number; + Select(): any; + Shadow: boolean; + Text: string; + Top: number; + VerticalAlignment: VerticalAlignments; + readonly Width: number; } class DownBars { @@ -4742,6 +4994,21 @@ declare namespace Excel { readonly Value: boolean; } + class ErrorBars { + private 'Excel.ErrorBars_typekey': ErrorBars; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + EndStyle: XlEndStyleCap; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + class ErrorCheckingOptions { private 'Excel.ErrorCheckingOptions_typekey': ErrorCheckingOptions; private constructor(); @@ -4761,14 +5028,13 @@ declare namespace Excel { UnlockedFormulaCells: boolean; } - class Errors { - private 'Excel.Errors_typekey': Errors; - private constructor(); + interface Errors { _Default(Index: any): Error; readonly Application: Application; readonly Creator: XlCreator; - Item(Index: any): Error; + Item(Index: number | XlErrorChecks): Error; readonly Parent: any; + (Index: number | XlErrorChecks): Error; } class FileExportConverter { @@ -4782,15 +5048,14 @@ declare namespace Excel { readonly Parent: any; } - class FileExportConverters { - private 'Excel.FileExportConverters_typekey': FileExportConverters; - private constructor(); + interface FileExportConverters { _Default(Index: any): FileExportConverter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): FileExportConverter; + Item(Index: number): FileExportConverter; readonly Parent: any; + (Index: number): FileExportConverter; } class FillFormat { @@ -4848,15 +5113,14 @@ declare namespace Excel { readonly Parent: any; } - class Filters { - private 'Excel.Filters_typekey': Filters; - private constructor(); + interface Filters { _Default(Index: number): Filter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Filter; readonly Parent: any; + (Index: number): Filter; } class Floor { @@ -4872,7 +5136,7 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; + PictureType: XlChartPictureType; Select(): any; Thickness: number; } @@ -4881,133 +5145,103 @@ declare namespace Excel { private 'Excel.Font_typekey': Font; private constructor(); readonly Application: Application; - Background: any; - Bold: any; - Color: any; - ColorIndex: any; + Background: XlBackground; + Bold: boolean; + Color: XlRgbColor | number; + ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; - FontStyle: any; - Italic: any; - Name: any; + FontStyle: 'Regular' | 'Italic' | 'Bold' | 'Bold Italic'; + Italic: boolean; + Name: string; OutlineFont: any; readonly Parent: any; Shadow: any; - Size: any; - Strikethrough: any; - Subscript: any; - Superscript: any; - ThemeColor: any; + Size: number; + Strikethrough: boolean; + Subscript: boolean; + Superscript: boolean; + ThemeColor: XlThemeColor; ThemeFont: XlThemeFont; - TintAndShade: any; - Underline: any; + TintAndShade: number; + Underline: XlUnderlineStyle; } class FormatColor { private 'Excel.FormatColor_typekey': FormatColor; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; - ThemeColor: any; - TintAndShade: any; + ThemeColor: XlThemeColor; + TintAndShade: number; } - class FormatConditions { - private 'Excel.FormatConditions_typekey': FormatConditions; + class FormatCondition { + private 'Excel.FormatCondition_typekey': FormatCondition; private constructor(); + _Modify(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any): void; + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + DateOperator: XlTimePeriods; + Delete(): void; + readonly Font: Font; + readonly Formula1: string; + readonly Formula2: string; + readonly Interior: Interior; + Modify(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): void; + Modify(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): void; + Modify(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, Operator2?: any): void; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Operator: number; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + Text: string; + TextOperator: XlContainsOperator; + readonly Type: number; + } + + interface FormatConditions { _Default(Index: any): any; - Add(Type: XlFormatConditionType, Operator?: any, Formula1?: any, Formula2?: any, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): any; - AddAboveAverage(): any; - AddColorScale(ColorScaleType: number): any; - AddDatabar(): any; - AddIconSetCondition(): any; - AddTop10(): any; - AddUniqueValues(): any; + Add(Type: XlFormatConditionType.xlExpression, Operator: undefined, Formula1: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1: string, Formula2: string): FormatCondition; + Add(Type: XlFormatConditionType, Operator?: XlFormatConditionOperator, Formula1?: string, Formula2?: string, String?: any, TextOperator?: any, DateOperator?: any, ScopeType?: any): FormatCondition; + AddAboveAverage(): AboveAverage; + AddColorScale(ColorScaleType: number): ColorScale; + AddDatabar(): Databar; + AddIconSetCondition(): IconSetCondition; + AddTop10(): Top10; + AddUniqueValues(): UniqueValues; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): any; + Item(Index: number | string): FormatCondition; readonly Parent: any; + (Index: number | string): FormatCondition; } class FreeformBuilder { private 'Excel.FreeformBuilder_typekey': FreeformBuilder; private constructor(); - AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: any, Y2?: any, X3?: any, Y3?: any): void; + AddNodes(SegmentType: Office.MsoSegmentType.msoSegmentCurve, EditingType: Office.MsoEditingType.msoEditingCorner, X1: number, Y1: number, X2: number, Y2: number, X3: number, Y3: number): void; + AddNodes(SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType.msoEditingAuto, X1: number, Y1: number): void; readonly Application: Application; ConvertToShape(): Shape; readonly Creator: XlCreator; readonly Parent: any; } - class Global { - private 'Excel.Global_typekey': Global; - private constructor(); - _Evaluate(Name: any): any; - _Run2( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly ActiveCell: Range; - readonly ActiveChart: Chart; - readonly ActiveDialog: DialogSheet; - readonly ActiveMenuBar: MenuBar; - ActivePrinter: string; - readonly ActiveSheet: any; - readonly ActiveWindow: Window; - readonly ActiveWorkbook: Workbook; - readonly AddIns: AddIns; - readonly Application: Application; - readonly Assistant: Office.Assistant; - Calculate(): void; - readonly Cells: Range; - readonly Charts: Sheets; - readonly Columns: Range; - readonly CommandBars: Office.CommandBars; - readonly Creator: XlCreator; - readonly DDEAppReturnCode: number; - DDEExecute(Channel: number, String: string): void; - DDEInitiate(App: string, Topic: string): number; - DDEPoke(Channel: number, Item: any, Data: any): void; - DDERequest(Channel: number, Item: string): any; - DDETerminate(Channel: number): void; - readonly DialogSheets: Sheets; - Evaluate(Name: any): any; - readonly Excel4IntlMacroSheets: Sheets; - readonly Excel4MacroSheets: Sheets; - ExecuteExcel4Macro(String: string): any; - Intersect( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly MenuBars: MenuBars; - readonly Modules: Modules; - readonly Names: Names; - readonly Parent: Application; - Range(Cell1: any, Cell2?: any): Range; - readonly Rows: Range; - Run( - Macro?: any, Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - readonly Selection: any; - SendKeys(Keys: any, Wait?: any): void; - readonly Sheets: Sheets; - ShortcutMenus(Index: number): Menu; - readonly ThisWorkbook: Workbook; - readonly Toolbars: Toolbars; - Union( - Arg1: Range, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): Range; - readonly Windows: Windows; - readonly Workbooks: Workbooks; - readonly WorksheetFunction: WorksheetFunction; - readonly Worksheets: Sheets; - } + // there is no way to use the Globals class from within Javascript class Graphic { private 'Excel.Graphic_typekey': Graphic; @@ -5028,16 +5262,82 @@ declare namespace Excel { Width: number; } - class GroupShapes { - private 'Excel.GroupShapes_typekey': GroupShapes; + class Gridlines { + private 'Excel.Gridlines_typekey': Gridlines; private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): any; + readonly Format: ChartFormat; + readonly Name: string; + readonly Parent: any; + Select(): any; + } + + class GroupObject { + private 'Excel.GroupObject_typekey': GroupObject; + private constructor(); + _Default: number; + AddIndent: boolean; + readonly Application: Application; + ArrowHeadLength: any; + ArrowHeadStyle: any; + ArrowHeadWidth: any; + AutoSize: boolean; + readonly Border: Border; + readonly BottomRightCell: Range; + BringToFront(): any; + CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + readonly Font: Font; + Height: number; + HorizontalAlignment: any; + readonly Index: number; + readonly Interior: Interior; + Left: number; + Locked: boolean; + Name: string; + OnAction: string; + Orientation: any; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + ReadingOrder: number; + RoundedCorners: boolean; + Select(Replace?: any): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + Top: number; + readonly TopLeftCell: Range; + Ungroup(): any; + VerticalAlignment: any; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + + interface GroupShapes { _Default(Index: any): Shape; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; + (Index: number | string): Shape; } class HeaderFooter { @@ -5073,16 +5373,15 @@ declare namespace Excel { Type: XlPageBreak; } - class HPageBreaks { - private 'Excel.HPageBreaks_typekey': HPageBreaks; - private constructor(); + interface HPageBreaks { _Default(Index: number): HPageBreak; - Add(Before: any): HPageBreak; + Add(Before: Range): HPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): HPageBreak; readonly Parent: any; + (Index: number): HPageBreak; } class Hyperlink { @@ -5095,7 +5394,7 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; EmailSubject: string; - Follow(NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + Follow(NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; readonly Name: string; readonly Parent: any; readonly Range: Range; @@ -5106,17 +5405,16 @@ declare namespace Excel { readonly Type: number; } - class Hyperlinks { - private 'Excel.Hyperlinks_typekey': Hyperlinks; - private constructor(); + interface Hyperlinks { _Default(Index: any): Hyperlink; - Add(Anchor: any, Address: string, SubAddress?: any, ScreenTip?: any, TextToDisplay?: any): any; + Add(Anchor: Range | Shape, Address: string, SubAddress?: string, ScreenTip?: string, TextToDisplay?: string): Hyperlink; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Hyperlink; + Item(Index: number | string): Hyperlink; readonly Parent: any; + (Index: number | string): Hyperlink; } class Icon { @@ -5128,46 +5426,100 @@ declare namespace Excel { readonly Parent: IconSet; } - class IconSet { - private 'Excel.IconSet_typekey': IconSet; - private constructor(); + // tslint:disable-next-line:interface-name + interface IconSet { _Default(Index: any): Icon; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly ID: XlIconSet; - Item(Index: any): Icon; + Item(Index: number): Icon; readonly Parent: any; + (Index: number): Icon; } - class IconSets { - private 'Excel.IconSets_typekey': IconSets; + class IconSetCondition { + private 'Excel.IconSetCondition_typekey': IconSetCondition; private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Creator: XlCreator; + Delete(): void; + Formula: string; + readonly IconCriteria: IconCriteria; + IconSet: IconSets; + ModifyAppliesToRange(Range: Range): void; + readonly Parent: any; + PercentileValues: boolean; + Priority: number; + readonly PTCondition: boolean; + ReverseOrder: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + ShowIconOnly: boolean; + readonly StopIfTrue: boolean; + readonly Type: number; + } + + // tslint:disable-next-line:interface-name + interface IconCriteria { + _Default(Index: any): IconCriterion; + readonly Count: number; + Item(Index: number): IconCriterion; + (Index: number): IconCriterion; + } + + class IconCriterion { + private 'Excel.IconCriterion_typekey': IconCriterion; + private constructor(); + Icon: XlIcon; + readonly Index: number; + Operator: number; + Type: XlConditionValueTypes; + Value: number | string; + } + + // tslint:disable-next-line:interface-name + interface IconSets { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number): IconSet; readonly Parent: any; + (Index: number): IconSet; } class Interior { private 'Excel.Interior_typekey': Interior; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: number | XlColorIndex; readonly Creator: XlCreator; readonly Gradient: any; - InvertIfNegative: any; + InvertIfNegative: boolean; readonly Parent: any; - Pattern: any; - PatternColor: any; - PatternColorIndex: any; - PatternThemeColor: any; - PatternTintAndShade: any; - ThemeColor: any; - TintAndShade: any; + Pattern: XlPattern; + PatternColor: XlRgbColor | number; + PatternColorIndex: number | XlColorIndex; + PatternThemeColor: XlThemeColor; + PatternTintAndShade: number; + ThemeColor: XlThemeColor; + TintAndShade: number; + } + + class LeaderLines { + private 'Excel.LeaderLines_typekey': LeaderLines; + private constructor(); + readonly Application: Application; + readonly Border: Border; + readonly Creator: XlCreator; + Delete(): void; + readonly Format: ChartFormat; + readonly Parent: any; + Select(): void; } class Legend { @@ -5186,7 +5538,7 @@ declare namespace Excel { IncludeInLayout: boolean; readonly Interior: Interior; Left: number; - LegendEntries(Index?: any): any; + LegendEntries: LegendEntries & ((Index: number) => LegendEntry); readonly Name: string; readonly Parent: any; Position: XlLegendPosition; @@ -5196,6 +5548,66 @@ declare namespace Excel { Width: number; } + interface LegendEntries { + _Default(Index: any): LegendEntry; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): LegendEntry; + readonly Parent: any; + (Index: number): LegendEntry; + } + + class LegendEntry { + private 'Excel.LegendEntry_typekey': LegendEntry; + private constructor(); + readonly Application: Application; + AutoScaleFont: any; + readonly Creator: XlCreator; + Delete(): any; + readonly Font: Font; + readonly Format: ChartFormat; + readonly Height: number; + readonly Index: number; + readonly Left: number; + readonly LegendKey: LegendKey; + readonly Parent: any; + Select(): any; + readonly Top: number; + readonly Width: number; + } + + class LegendKey { + private 'Excel.LegendKey_typekey': LegendKey; + private constructor(); + readonly Application: Application; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + Delete(): any; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Parent: any; + PictureType: number; + PictureUnit: number; + PictureUnit2: number; + Select(): any; + Shadow: boolean; + Smooth: boolean; + readonly Top: number; + readonly Width: number; + } + class LineFormat { private 'Excel.LineFormat_typekey': LineFormat; private constructor(); @@ -5249,16 +5661,15 @@ declare namespace Excel { readonly XPath: XPath; } - class ListColumns { - private 'Excel.ListColumns_typekey': ListColumns; - private constructor(); + interface ListColumns { _Default(Index: any): ListColumn; - Add(Position?: any): ListColumn; + Add(Position?: number): ListColumn; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListColumn; + Item(Index: number | string): ListColumn; readonly Parent: any; + (Index: number | string): ListColumn; } class ListDataFormat { @@ -5267,15 +5678,15 @@ declare namespace Excel { readonly _Default: XlListDataType; readonly AllowFillIn: boolean; readonly Application: Application; - readonly Choices: any; + readonly Choices: SafeArray; readonly Creator: XlCreator; readonly DecimalPlaces: number; readonly DefaultValue: any; readonly IsPercent: boolean; readonly lcid: number; readonly MaxCharacters: number; - readonly MaxNumber: any; - readonly MinNumber: any; + readonly MaxNumber: number | null; + readonly MinNumber: number | null; readonly Parent: any; readonly ReadOnly: boolean; readonly Required: boolean; @@ -5303,7 +5714,7 @@ declare namespace Excel { readonly ListRows: ListRows; Name: string; readonly Parent: any; - Publish(Target: any, LinkSource: boolean): string; + Publish(Target: SafeArray, LinkSource: boolean): string; readonly QueryTable: QueryTable; readonly Range: Range; Refresh(): void; @@ -5324,32 +5735,33 @@ declare namespace Excel { Unlink(): void; Unlist(): void; - /** @param Excel.XlListConflict [iConflictType=0] */ + /** @param iConflictType [iConflictType=0] */ UpdateChanges(iConflictType?: XlListConflict): void; readonly XmlMap: XmlMap; } - class ListObjects { - private 'Excel.ListObjects_typekey': ListObjects; - private constructor(); - + interface ListObjects { /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ _Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any): ListObject; _Default(Index: any): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcRange, Source?: Range, LinkSource?: undefined, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: undefined, TableStyleName?: string): ListObject; + Add(SourceType: XlListObjectSourceType.xlSrcExternal, Source: SafeArray, LinkSource: boolean, XlListObjectHasHeaders: XlYesNoGuess, Destination: Range, TableStyleName?: string): ListObject; + /** - * @param Excel.XlListObjectSourceType [SourceType=1] - * @param Excel.XlYesNoGuess [XlListObjectHasHeaders=0] + * @param SourceType [SourceType=1] + * @param XlListObjectHasHeaders [XlListObjectHasHeaders=0] */ - Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: any, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: any, TableStyleName?: any): ListObject; + Add(SourceType?: XlListObjectSourceType, Source?: any, LinkSource?: boolean, XlListObjectHasHeaders?: XlYesNoGuess, Destination?: Range, TableStyleName?: string): ListObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListObject; + Item(Index: number | string): ListObject; readonly Parent: any; + (Index: number | string): ListObject; } class ListRow { @@ -5364,19 +5776,19 @@ declare namespace Excel { readonly Range: Range; } - class ListRows { - private 'Excel.ListRows_typekey': ListRows; - private constructor(); + interface ListRows { _Add(Position?: any): ListRow; _Default(Index: any): ListRow; - Add(Position?: any, AlwaysInsert?: any): ListRow; + Add(Position?: number, AlwaysInsert?: boolean): ListRow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ListRow; + Item(Index: number | string): ListRow; readonly Parent: any; + (Index: number | string): ListRow; } + /** Macintosh only */ class Mailer { private 'Excel.Mailer_typekey': Mailer; private constructor(); @@ -5422,9 +5834,7 @@ declare namespace Excel { Reset(): void; } - class MenuBars { - private 'Excel.MenuBars_typekey': MenuBars; - private constructor(); + interface MenuBars { _Default(Index: any): MenuBar; Add(Name?: any): MenuBar; readonly Application: Application; @@ -5432,6 +5842,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): MenuBar; readonly Parent: any; + (Index: any): MenuBar; } class MenuItem { @@ -5451,9 +5862,7 @@ declare namespace Excel { StatusBar: string; } - class MenuItems { - private 'Excel.MenuItems_typekey': MenuItems; - private constructor(); + interface MenuItems { _Default(Index: any): any; Add(Caption: string, OnAction?: any, ShortcutKey?: any, Before?: any, Restore?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): MenuItem; AddMenu(Caption: string, Before?: any, Restore?: any): Menu; @@ -5462,11 +5871,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): any; readonly Parent: any; + (Index: any): any; } - class Menus { - private 'Excel.Menus_typekey': Menus; - private constructor(); + interface Menus { _Default(Index: any): Menu; Add(Caption: string, Before?: any, Restore?: any): Menu; readonly Application: Application; @@ -5474,6 +5882,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Menu; readonly Parent: any; + (Index: any): Menu; } class Module { @@ -5483,9 +5892,7 @@ declare namespace Excel { _CodeName: string; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; readonly CodeName: string; @@ -5507,18 +5914,14 @@ declare namespace Excel { Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; readonly ProtectContents: boolean; readonly ProtectionMode: boolean; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Select(Replace?: any): void; readonly Shapes: Shapes; Unprotect(Password?: any): void; Visible: XlSheetVisibility; } - class Modules { - private 'Excel.Modules_typekey': Modules; - private constructor(); + interface Modules { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; @@ -5536,6 +5939,7 @@ declare namespace Excel { Select(Replace?: any): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: any): any; } class MultiThreadedCalculation { @@ -5564,10 +5968,10 @@ declare namespace Excel { Name: string; NameLocal: string; readonly Parent: any; - RefersTo: any; - RefersToLocal: any; - RefersToR1C1: any; - RefersToR1C1Local: any; + RefersTo: string; + RefersToLocal: string; + RefersToR1C1: string; + RefersToR1C1Local: string; readonly RefersToRange: Range; ShortcutKey: string; readonly ValidWorkbookParameter: boolean; @@ -5576,17 +5980,30 @@ declare namespace Excel { WorkbookParameter: boolean; } - class Names { - private 'Excel.Names_typekey': Names; - private constructor(); + interface Names { _Default(Index?: any, IndexLocal?: any, RefersTo?: any): Name; - Add( - Name?: any, RefersTo?: any, Visible?: any, MacroType?: any, ShortcutKey?: any, Category?: any, NameLocal?: any, RefersToLocal?: any, CategoryLocal?: any, - RefersToR1C1?: any, RefersToR1C1Local?: any): Name; + Add(Name?: string, RefersTo?: string, Visible?: boolean, MacroType?: 1 | 2 | 3, ShortcutKey?: string, Category?: FunctionCategory | string, NameLocal?: string, RefersToLocal?: string, CategoryLocal?: string, RefersToR1C1?: string, RefersToR1C1Local?: string): Name; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index?: any, IndexLocal?: any, RefersTo?: any): Name; + Item(Index: number | string): Name; + Item(Index: undefined, IndexLocal: string): Name; + Item(Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + readonly Parent: any; + (Index: number | string): Name; + (Index: undefined, IndexLocal: string): Name; + (Index: undefined, IndexLocal: undefined, RefersTo: string): Name; + } + + class NegativeBarFormat { + private 'Excel.NegativeBarFormat_typekey': NegativeBarFormat; + private constructor(); + readonly Application: Application; + readonly BorderColor: FormatColor; + BorderColorType: XlDataBarNegativeColorType; + readonly Color: FormatColor; + ColorType: XlDataBarNegativeColorType; + readonly Creator: XlCreator; readonly Parent: any; } @@ -5597,9 +6014,9 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Parent: any; @@ -5609,12 +6026,12 @@ declare namespace Excel { RefreshOnFileOpen: boolean; RefreshPeriod: number; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerSSOApplicationID: string; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; SourceDataFile: string; } @@ -5628,33 +6045,32 @@ declare namespace Excel { readonly SqlState: string; } - class ODBCErrors { - private 'Excel.ODBCErrors_typekey': ODBCErrors; - private constructor(); + interface ODBCErrors { _Default(Index: number): ODBCError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): ODBCError; readonly Parent: any; + (Index: number): ODBCError; } class OLEDBConnection { private 'Excel.OLEDBConnection_typekey': OLEDBConnection; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; AlwaysUseConnectionFile: boolean; readonly Application: Application; BackgroundQuery: boolean; readonly CalculatedMembers: CalculatedMembers; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; EnableRefresh: boolean; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; LocaleID: number; MaintainConnection: boolean; MakeConnection(): void; @@ -5669,7 +6085,7 @@ declare namespace Excel { RefreshPeriod: number; RetrieveInOfficeUILang: boolean; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; ServerCredentialsMethod: XlCredentialsMethod; ServerFillColor: boolean; @@ -5695,15 +6111,14 @@ declare namespace Excel { readonly Stage: number; } - class OLEDBErrors { - private 'Excel.OLEDBErrors_typekey': OLEDBErrors; - private constructor(); + interface OLEDBErrors { _Default(Index: number): OLEDBError; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): OLEDBError; readonly Parent: any; + (Index: number): OLEDBError; } class OLEFormat { @@ -5715,7 +6130,7 @@ declare namespace Excel { readonly Object: any; readonly Parent: any; readonly progID: string; - Verb(Verb?: any): void; + Verb(Verb?: XlOLEVerb): void; } class OLEObject { @@ -5732,8 +6147,8 @@ declare namespace Excel { Copy(): any; /** - * @param Excel.XlPictureAppearance [Appearance=2] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Creator: XlCreator; @@ -5750,13 +6165,13 @@ declare namespace Excel { Locked: boolean; Name: string; readonly Object: any; - readonly OLEType: any; + readonly OLEType: XlOLEType.xlOLELink | XlOLEType.xlOLEEmbed; OnAction: string; readonly Parent: any; - Placement: any; + Placement: XlPlacement; PrintObject: boolean; readonly progID: string; - Select(Replace?: any): any; + Select(Replace?: boolean): any; SendToBack(): any; Shadow: boolean; readonly ShapeRange: ShapeRange; @@ -5765,13 +6180,58 @@ declare namespace Excel { readonly TopLeftCell: Range; Update(): any; - /** @param Excel.XlOLEVerb [Verb=1] */ + /** @param Verb [Verb=1] */ Verb(Verb?: XlOLEVerb): any; Visible: boolean; Width: number; readonly ZOrder: number; } + class OLEObjects { + private 'Excel.OLEObjects_typekey': OLEObjects; + private constructor(); + Add(ClassType: string, Filename: undefined, Link: undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: string, Filename?: undefined, Link?: undefined, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link: boolean, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + Add(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: false, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, Left?: number, Top?: number, Width?: number, Height?: number): OLEObject; + readonly Application: Application; + AutoLoad: boolean; + readonly Border: Border; + BringToFront(): any; + Copy(): any; + + /** + * @param Appearance [Appearance=2] + * @param Format [Format=-4147] + */ + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; + readonly Count: number; + readonly Creator: XlCreator; + Cut(): any; + Delete(): any; + Duplicate(): any; + Enabled: boolean; + Group(): GroupObject; + Height: number; + readonly Interior: Interior; + Item(Index: number | string): any; + Left: number; + Locked: boolean; + OnAction: string; + readonly Parent: any; + Placement: any; + PrintObject: boolean; + Select(Replace?: boolean): any; + SendToBack(): any; + Shadow: boolean; + readonly ShapeRange: ShapeRange; + SourceName: string; + Top: number; + Visible: boolean; + Width: number; + readonly ZOrder: number; + } + class Outline { private 'Excel.Outline_typekey': Outline; private constructor(); @@ -5779,7 +6239,7 @@ declare namespace Excel { AutomaticStyles: boolean; readonly Creator: XlCreator; readonly Parent: any; - ShowLevels(RowLevels?: any, ColumnLevels?: any): any; + ShowLevels(RowLevels?: number, ColumnLevels?: number): any; SummaryColumn: XlSummaryColumn; SummaryRow: XlSummaryRow; } @@ -5795,12 +6255,11 @@ declare namespace Excel { readonly RightHeader: HeaderFooter; } - class Pages { - private 'Excel.Pages_typekey': Pages; - private constructor(); + interface Pages { _Default(Index: any): Page; readonly Count: number; - Item(Index: any): Page; + Item(Index: number): Page; + (Index: number): Page; } class PageSetup { @@ -5823,8 +6282,8 @@ declare namespace Excel { readonly EvenPage: Page; readonly FirstPage: Page; FirstPageNumber: number; - FitToPagesTall: any; - FitToPagesWide: any; + FitToPagesTall: number | false; + FitToPagesWide: number | false; FooterMargin: number; HeaderMargin: number; LeftFooter: string; @@ -5844,7 +6303,7 @@ declare namespace Excel { PrintGridlines: boolean; PrintHeadings: boolean; PrintNotes: boolean; - PrintQuality(Index?: any): any; + PrintQuality: SafeArray & ((Index: 1 | 2) => number); PrintTitleColumns: string; PrintTitleRows: string; RightFooter: string; @@ -5854,7 +6313,9 @@ declare namespace Excel { RightMargin: number; ScaleWithDocHeaderFooter: boolean; TopMargin: number; - Zoom: any; + + /** Represents a percentage between 10 and 400 */ + Zoom: number; } class Pane { @@ -5864,26 +6325,25 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; readonly VisibleRange: Range; } - class Panes { - private 'Excel.Panes_typekey': Panes; - private constructor(); + interface Panes { _Default(Index: number): Pane; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): Pane; readonly Parent: any; + (Index: number): Pane; } class Parameter { @@ -5902,17 +6362,16 @@ declare namespace Excel { readonly Value: any; } - class Parameters { - private 'Excel.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { _Default(Index: any): Parameter; - Add(Name: string, iDataType?: any): Parameter; + Add(Name: string, iDataType?: XlParameterDataType): Parameter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Parameter; + Item(Index: number | string): Parameter; readonly Parent: any; + (Index: number | string): Parameter; } class Phonetic { @@ -5928,9 +6387,7 @@ declare namespace Excel { Visible: boolean; } - class Phonetics { - private 'Excel.Phonetics_typekey': Phonetics; - private constructor(); + interface Phonetics { _Default(Index: number): any; Add(Start: number, Length: number, Text: string): void; Alignment: number; @@ -5940,12 +6397,13 @@ declare namespace Excel { readonly Creator: XlCreator; Delete(): void; readonly Font: Font; - Item(Index: number): any; + Item(Index: number): Phonetic; readonly Length: number; readonly Parent: any; readonly Start: number; Text: string; Visible: boolean; + (Index: number): Phonetic; } class PictureFormat { @@ -5980,18 +6438,18 @@ declare namespace Excel { class PivotCache { private 'Excel.PivotCache_typekey': PivotCache; private constructor(); - readonly ADOConnection: any; + readonly ADOConnection: ADODB.Connection; readonly Application: Application; BackgroundQuery: boolean; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; - CreatePivotTable(TableDestination: any, TableName?: any, ReadData?: any, DefaultVersion?: any): PivotTable; + Connection: string; + CreatePivotTable(TableDestination: Range, TableName?: string, ReadData?: boolean, DefaultVersion?: any): PivotTable; readonly Creator: XlCreator; EnableRefresh: boolean; readonly Index: number; readonly IsConnected: boolean; - LocalConnection: any; + LocalConnection: string; MaintainConnection: boolean; MakeConnection(): void; readonly MemoryUsed: number; @@ -6001,7 +6459,7 @@ declare namespace Excel { readonly Parent: any; readonly QueryType: XlQueryType; readonly RecordCount: number; - Recordset: any; + Recordset: ADODB.Recordset; Refresh(): void; readonly RefreshDate: VarDate; readonly RefreshName: string; @@ -6009,10 +6467,10 @@ declare namespace Excel { RefreshPeriod: number; ResetTimer(): void; RobustConnect: XlRobustConnect; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SavePassword: boolean; SourceConnectionFile: string; - SourceData: any; + SourceData: string | SafeArray | PivotTable; readonly SourceDataFile: string; readonly SourceType: XlPivotTableSourceType; Sql: any; @@ -6022,17 +6480,17 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class PivotCaches { - private 'Excel.PivotCaches_typekey': PivotCaches; - private constructor(); + interface PivotCaches { _Default(Index: any): PivotCache; Add(SourceType: XlPivotTableSourceType, SourceData?: any): PivotCache; readonly Application: Application; readonly Count: number; - Create(SourceType: XlPivotTableSourceType, SourceData?: any, Version?: any): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlDatabase | XlPivotTableSourceType.xlConsolidation, SourceData: string, Version?: XlPivotTableVersionList): PivotCache; + Create(SourceType: XlPivotTableSourceType.xlExternal, SourceData: WorkbookConnection, Version?: XlPivotTableVersionList): PivotCache; readonly Creator: XlCreator; - Item(Index: any): PivotCache; + Item(Index: number): PivotCache; readonly Parent: any; + (Index: number): PivotCache; } class PivotCell { @@ -6065,7 +6523,7 @@ declare namespace Excel { private constructor(); _AutoSort(Order: number, Field: string): void; _Default: string; - AddPageItem(Item: string, ClearList?: any): void; + AddPageItem(Item: string, ClearList?: boolean): void; readonly AllItemsVisible: boolean; readonly Application: Application; AutoShow(Type: number, Range: number, Count: number, Field: string): void; @@ -6084,15 +6542,15 @@ declare namespace Excel { Calculation: XlPivotFieldCalculation; Caption: string; readonly ChildField: PivotField; - ChildItems(Index?: any): any; + readonly ChildItems: PivotItemsResult; ClearAllFilters(): void; ClearLabelFilters(): void; ClearManualFilter(): void; ClearValueFilters(): void; readonly Creator: XlCreator; readonly CubeField: CubeField; - CurrentPage: any; - CurrentPageList: any; + CurrentPage: PivotItem; + CurrentPageList: SafeArray; CurrentPageName: string; DatabaseSort: boolean; readonly DataRange: Range; @@ -6112,10 +6570,10 @@ declare namespace Excel { EnableMultiplePageItems: boolean; Formula: string; Function: XlConsolidationFunction; - readonly GroupLevel: any; + readonly GroupLevel: number; Hidden: boolean; - HiddenItems(Index?: any): any; - HiddenItemsList: any; + readonly HiddenItems: PivotItemsResult; + HiddenItemsList: SafeArray; IncludeNewItemsInFilter: boolean; readonly IsCalculated: boolean; readonly IsMemberProperty: boolean; @@ -6132,9 +6590,9 @@ declare namespace Excel { Orientation: XlPivotFieldOrientation; readonly Parent: any; readonly ParentField: PivotField; - ParentItems(Index?: any): any; + readonly ParentItems: PivotItemsResult; readonly PivotFilters: PivotFilters; - PivotItems(Index?: any): any; + readonly PivotItems: PivotItemsResult; Position: any; PropertyOrder: number; readonly PropertyParentField: PivotField; @@ -6147,12 +6605,12 @@ declare namespace Excel { readonly SourceName: string; StandardFormula: string; SubtotalName: string; - Subtotals(Index?: any): any; - readonly TotalLevels: any; + readonly Subtotals: SafeArray & ((Index: PivotFieldSubtotal) => boolean); + readonly TotalLevels: number; UseMemberPropertyAsCaption: boolean; Value: string; - VisibleItems(Index?: any): any; - VisibleItemsList: any; + readonly VisibleItems: PivotItemsResult; + VisibleItemsList: SafeArray; } class PivotFields { @@ -6161,10 +6619,12 @@ declare namespace Excel { readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): PivotField; readonly Parent: PivotTable; } + type PivotFieldsResult = PivotFields & ((Index: number | string) => PivotField) & ((Indexes: SafeArray) => PivotFields); + class PivotFilter { private 'Excel.PivotFilter_typekey': PivotFilter; private constructor(); @@ -6186,16 +6646,15 @@ declare namespace Excel { readonly Value2: any; } - class PivotFilters { - private 'Excel.PivotFilters_typekey': PivotFilters; - private constructor(); + interface PivotFilters { _Default(Index: any): PivotFilter; Add(Type: XlPivotFilterType, DataField?: any, Value1?: any, Value2?: any, Order?: any, Name?: any, Description?: any, MemberPropertyField?: any): PivotFilter; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFilter; + Item(Index: number): PivotFilter; readonly Parent: any; + (Index: number): PivotFilter; } class PivotFormula { @@ -6212,17 +6671,16 @@ declare namespace Excel { Value: string; } - class PivotFormulas { - private 'Excel.PivotFormulas_typekey': PivotFormulas; - private constructor(); + interface PivotFormulas { _Add(Formula: string): PivotFormula; _Default(Index: any): PivotFormula; Add(Formula: string, UseStandardFormula?: any): PivotFormula; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotFormula; + Item(Index: number | string): PivotFormula; readonly Parent: any; + (Index: number | string): PivotFormula; } class PivotItem { @@ -6231,7 +6689,7 @@ declare namespace Excel { _Default: string; readonly Application: Application; Caption: string; - ChildItems(Index?: any): any; + ChildItems: PivotItemsResult; readonly Creator: XlCreator; readonly DataRange: Range; Delete(): void; @@ -6254,17 +6712,29 @@ declare namespace Excel { Visible: boolean; } - class PivotItemList { - private 'Excel.PivotItemList_typekey': PivotItemList; - private constructor(); + interface PivotItemList { _Default(Field: any): PivotItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotItem; + Item(Index: number | string): PivotItem; readonly Parent: any; + (Field: number | string): PivotItem; } + class PivotItems { + private 'Excel.PivotItems_typekey': PivotItems; + private constructor(); + Add(Name: string): void; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number | string): any; + readonly Parent: PivotField; + } + + type PivotItemsResult = PivotItems & ((Index: number | string) => PivotItem) & ((Indexes: SafeArray) => PivotItems); + class PivotLayout { private 'Excel.PivotLayout_typekey': PivotLayout; private constructor(); @@ -6296,26 +6766,24 @@ declare namespace Excel { readonly Position: number; } - class PivotLineCells { - private 'Excel.PivotLineCells_typekey': PivotLineCells; - private constructor(); + interface PivotLineCells { _Default(Index: any): PivotCell; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotCell; + Item(Index: number): PivotCell; readonly Parent: any; + (Index: number): PivotCell; } - class PivotLines { - private 'Excel.PivotLines_typekey': PivotLines; - private constructor(); + interface PivotLines { _Default(Index: any): PivotLine; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotLine; + Item(Index: number): PivotLine; readonly Parent: any; + (Index: number): PivotLine; } class PivotTable { @@ -6323,11 +6791,11 @@ declare namespace Excel { private constructor(); _Default: string; - /** @param Excel.XlPTSelectionMode [Mode=0] */ + /** @param Mode [Mode=0] */ _PivotSelect(Name: string, Mode?: XlPTSelectionMode): void; readonly ActiveFilters: PivotFilters; AddDataField(Field: any, Caption?: any, Function?: any): PivotField; - AddFields(RowFields?: any, ColumnFields?: any, PageFields?: any, AddToTable?: any): any; + AddFields(RowFields?: string | SafeArray, ColumnFields?: string | SafeArray, PageFields?: string | SafeArray, AddToTable?: boolean): any; AllocateChanges(): void; Allocation: XlAllocation; AllocationMethod: XlAllocationMethod; @@ -6342,10 +6810,10 @@ declare namespace Excel { CalculatedMembersInFilters: boolean; ChangeConnection(conn: WorkbookConnection): void; readonly ChangeList: PivotTableChangeList; - ChangePivotCache(PivotCache: any): void; + ChangePivotCache(PivotCache: string): void; ClearAllFilters(): void; ClearTable(): void; - ColumnFields(Index?: any): any; + ColumnFields: PivotFieldsResult; ColumnGrand: boolean; readonly ColumnRange: Range; CommitChanges(): void; @@ -6353,11 +6821,11 @@ declare namespace Excel { CompactLayoutRowHeader: string; CompactRowIndent: number; ConvertToFormulas(ConvertFilters: boolean): void; - CreateCubeFile(File: string, Measures?: any, Levels?: any, Members?: any, Properties?: any): string; + CreateCubeFile(File: string, Measures?: SafeArray, Levels?: SafeArray, Members?: SafeArray>, Properties?: boolean): string; readonly Creator: XlCreator; readonly CubeFields: CubeFields; readonly DataBodyRange: Range; - DataFields(Index?: any): any; + DataFields: PivotFieldsResult; readonly DataLabelRange: Range; readonly DataPivotField: PivotField; DiscardChanges(): void; @@ -6369,10 +6837,7 @@ declare namespace Excel { DisplayImmediateItems: boolean; DisplayMemberPropertyTooltips: boolean; DisplayNullString: boolean; - Dummy15( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy15(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; EnableDataValueEditing: boolean; EnableDrilldown: boolean; EnableFieldDialog: boolean; @@ -6383,13 +6848,10 @@ declare namespace Excel { FieldListSortAscending: boolean; Format(Format: XlPivotFormatType): void; GetData(Name: string): number; - GetPivotData( - DataField?: any, Field1?: any, Item1?: any, Field2?: any, Item2?: any, Field3?: any, Item3?: any, Field4?: any, Item4?: any, Field5?: any, Item5?: any, - Field6?: any, Item6?: any, Field7?: any, Item7?: any, Field8?: any, Item8?: any, Field9?: any, Item9?: any, Field10?: any, Item10?: any, Field11?: any, - Item11?: any, Field12?: any, Item12?: any, Field13?: any, Item13?: any, Field14?: any, Item14?: any): Range; + GetPivotData(DataField?: string, Field1?: string, Item1?: string, Field2?: string, Item2?: string, Field3?: string, Item3?: string, Field4?: string, Item4?: string, Field5?: string, Item5?: string, Field6?: string, Item6?: string, Field7?: string, Item7?: string, Field8?: string, Item8?: string, Field9?: string, Item9?: string, Field10?: string, Item10?: string, Field11?: string, Item11?: string, Field12?: string, Item12?: string, Field13?: string, Item13?: string, Field14?: string, Item14?: string): Range; GrandTotalName: string; HasAutoFormat: boolean; - HiddenFields(Index?: any): any; + HiddenFields: PivotFieldsResult; InGridDropZones: boolean; InnerDetail: string; LayoutRowDefault: XlLayoutRowType; @@ -6401,7 +6863,7 @@ declare namespace Excel { Name: string; NullString: string; PageFieldOrder: number; - PageFields(Index?: any): any; + PageFields: PivotFieldsResult; PageFieldStyle: string; PageFieldWrapCount: number; readonly PageRange: Range; @@ -6409,17 +6871,16 @@ declare namespace Excel { readonly Parent: any; PivotCache(): PivotCache; readonly PivotColumnAxis: PivotAxis; - PivotFields(Index?: any): any; + PivotFields: PivotFieldsResult; readonly PivotFormulas: PivotFormulas; readonly PivotRowAxis: PivotAxis; - /** @param Excel.XlPTSelectionMode [Mode=0] */ - PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: any): void; + /** @param Mode [Mode=0] */ + PivotSelect(Name: string, Mode?: XlPTSelectionMode, UseStandardName?: boolean): void; PivotSelection: string; PivotSelectionStandard: string; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; PreserveFormatting: boolean; PrintDrillIndicators: boolean; PrintTitles: boolean; @@ -6430,7 +6891,7 @@ declare namespace Excel { RepeatAllLabels(Repeat: XlPivotFieldRepeatLabels): void; RepeatItemsOnEachPrintedPage: boolean; RowAxisLayout(RowLayout: XlLayoutRowType): void; - RowFields(Index?: any): any; + RowFields: PivotFieldsResult; RowGrand: boolean; readonly RowRange: Range; SaveData: boolean; @@ -6438,7 +6899,7 @@ declare namespace Excel { ShowCellBackgroundFromOLAP: boolean; ShowDrillIndicators: boolean; ShowPageMultipleItemLabel: boolean; - ShowPages(PageField?: any): any; + ShowPages(PageField?: string): any; ShowTableStyleColumnHeaders: boolean; ShowTableStyleColumnStripes: boolean; ShowTableStyleLastColumn: boolean; @@ -6463,21 +6924,20 @@ declare namespace Excel { Value: string; readonly Version: XlPivotTableVersionList; ViewCalculatedMembers: boolean; - VisibleFields(Index?: any): any; + VisibleFields: PivotFieldsResult; VisualTotals: boolean; VisualTotalsForSets: boolean; } - class PivotTableChangeList { - private 'Excel.PivotTableChangeList_typekey': PivotTableChangeList; - private constructor(); + interface PivotTableChangeList { _Default(Index: any): ValueChange; Add(Tuple: string, Value: number, AllocationValue?: any, AllocationMethod?: any, AllocationWeightExpression?: any): ValueChange; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ValueChange; + Item(Index: number | string): ValueChange; readonly Parent: any; + (Index: number | string): ValueChange; } class PlotArea { @@ -6508,6 +6968,66 @@ declare namespace Excel { Width: number; } + class Point { + private 'Excel.Point_typekey': Point; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + readonly Border: Border; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Has3DEffect: boolean; + HasDataLabel: boolean; + readonly Height: number; + readonly Interior: Interior; + InvertIfNegative: boolean; + readonly Left: number; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + readonly Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + + /** @param Index [Index=2] */ + PieSliceLocation(loc: XlPieSliceLocation, Index?: XlPieSliceIndex): number; + SecondaryPlot: boolean; + Select(): any; + Shadow: boolean; + readonly Top: number; + readonly Width: number; + } + + interface Points { + _Default(Index: number): Point; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Point; + readonly Parent: any; + (Index: number): Point; + } + class ProtectedViewWindow { private 'Excel.ProtectedViewWindow_typekey': ProtectedViewWindow; private constructor(); @@ -6515,7 +7035,7 @@ declare namespace Excel { Activate(): void; Caption: string; Close(): boolean; - Edit(WriteResPassword?: any, UpdateLinks?: any): Workbook; + Edit(WriteResPassword?: string, UpdateLinks?: 0 | 1): Workbook; EnableResize: boolean; Height: number; Left: number; @@ -6528,16 +7048,15 @@ declare namespace Excel { readonly Workbook: Workbook; } - class ProtectedViewWindows { - private 'Excel.ProtectedViewWindows_typekey': ProtectedViewWindows; - private constructor(); + interface ProtectedViewWindows { _Default(Index: any): ProtectedViewWindow; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): ProtectedViewWindow; - Open(Filename: string, Password?: any, AddToMru?: any, RepairMode?: any): ProtectedViewWindow; + Item(Index: number | string): ProtectedViewWindow; + Open(Filename: string, Password?: string, AddToMru?: boolean, RepairMode?: boolean): ProtectedViewWindow; readonly Parent: any; + (Index: number | string): ProtectedViewWindow; } class Protection { @@ -6568,25 +7087,24 @@ declare namespace Excel { Filename: string; HtmlType: XlHtmlType; readonly Parent: any; - Publish(Create?: any): void; + Publish(Create?: boolean): void; readonly Sheet: string; readonly Source: string; readonly SourceType: XlSourceType; Title: string; } - class PublishObjects { - private 'Excel.PublishObjects_typekey': PublishObjects; - private constructor(); + interface PublishObjects { _Default(Index: any): PublishObject; - Add(SourceType: XlSourceType, Filename: string, Sheet?: any, Source?: any, HtmlType?: any, DivID?: any, Title?: any): PublishObject; + Add(SourceType: XlSourceType, Filename: string, Sheet?: string, Source?: XlSourceType.xlSourceAutoFilter | XlSourceType.xlSourceChart | XlSourceType.xlSourcePivotTable | XlSourceType.xlSourcePrintArea | XlSourceType.xlSourceQuery | XlSourceType.xlSourceRange, HtmlType?: XlHtmlType, DivID?: string, Title?: string): PublishObject; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): PublishObject; + Item(Index: number | string): PublishObject; readonly Parent: any; Publish(): void; + (Index: number | string): PublishObject; } class QueryTable { @@ -6596,13 +7114,13 @@ declare namespace Excel { readonly Application: Application; BackgroundQuery: boolean; CancelRefresh(): void; - CommandText: any; + CommandText: string; CommandType: XlCmdType; - Connection: any; + Connection: string; readonly Creator: XlCreator; Delete(): void; readonly Destination: Range; - EditWebPage: any; + EditWebPage: string; EnableEditing: boolean; EnableRefresh: boolean; readonly FetchedRowOverflow: boolean; @@ -6618,8 +7136,8 @@ declare namespace Excel { PreserveColumnInfo: boolean; PreserveFormatting: boolean; readonly QueryType: XlQueryType; - Recordset: any; - Refresh(BackgroundQuery?: any): boolean; + Recordset: DAO.Recordset | ADODB.Recordset; + Refresh(BackgroundQuery?: boolean): boolean; readonly Refreshing: boolean; RefreshOnFileOpen: boolean; RefreshPeriod: number; @@ -6628,7 +7146,7 @@ declare namespace Excel { readonly ResultRange: Range; RobustConnect: XlRobustConnect; RowNumbers: boolean; - SaveAsODC(ODCFileName: string, Description?: any, Keywords?: any): void; + SaveAsODC(ODCFileName: string, Description?: string, Keywords?: string): void; SaveData: boolean; SavePassword: boolean; readonly Sort: Sort; @@ -6636,11 +7154,11 @@ declare namespace Excel { SourceDataFile: string; Sql: any; TablesOnlyFromHTML: boolean; - TextFileColumnDataTypes: any; + TextFileColumnDataTypes: SafeArray; TextFileCommaDelimiter: boolean; TextFileConsecutiveDelimiter: boolean; TextFileDecimalSeparator: string; - TextFileFixedColumnWidths: any; + TextFileFixedColumnWidths: SafeArray; TextFileOtherDelimiter: string; TextFileParseType: XlTextParsingType; TextFilePlatform: number; @@ -6664,79 +7182,77 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class QueryTables { - private 'Excel.QueryTables_typekey': QueryTables; - private constructor(); + interface QueryTables { _Default(Index: any): QueryTable; - Add(Connection: any, Destination: Range, Sql?: any): QueryTable; + Add(Connection: QueryTable | DAO.Recordset | ADODB.Recordset, Destination: Range): QueryTable; + Add(Connection: string, Destination: Range, Sql?: string): QueryTable; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): QueryTable; + Item(Index: number | string): QueryTable; readonly Parent: any; + (Index: number | string): QueryTable; } - class Range { - private 'Excel.Range_typekey': Range; - private constructor(); + interface Range { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ _BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any): any; _Default(RowIndex?: any, ColumnIndex?: any): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ _PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; Activate(): any; - AddComment(Text?: any): Comment; - AddIndent: any; + AddComment(Text?: string): Comment; + AddIndent: boolean; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ + /** @param ReferenceStyle [ReferenceStyle=1] */ Address(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; - /** @param Excel.XlReferenceStyle [ReferenceStyle=1] */ - AddressLocal(RowAbsolute: any, ColumnAbsolute: any, ReferenceStyle?: XlReferenceStyle, External?: any, RelativeTo?: any): string; + /** @param ReferenceStyle [ReferenceStyle=1] */ + AddressLocal(RowAbsolute?: boolean, ColumnAbsolute?: boolean, ReferenceStyle?: XlReferenceStyle, External?: boolean, RelativeTo?: Range): string; AdvancedFilter(Action: XlFilterAction.xlFilterCopy, CriteriaRange?: Range, CopyToRange?: Range, Unique?: boolean): any; AdvancedFilter(Action: XlFilterAction, CriteriaRange?: Range, CopyToRange?: undefined, Unique?: boolean): any; AllocateChanges(): void; readonly AllowEdit: boolean; readonly Application: Application; - /** @param Excel.XlApplyNamesOrder [Order=1] */ - ApplyNames(Names: any, IgnoreRelativeAbsolute: any, UseRowColumnNames: any, OmitColumn: any, OmitRow: any, Order?: XlApplyNamesOrder, AppendLast?: any): any; + /** @param Order [Order=1] */ + ApplyNames(Names?: SafeArray, IgnoreRelativeAbsolute?: boolean, UseRowColumnNames?: boolean, OmitColumn?: boolean, OmitRow?: boolean, Order?: XlApplyNamesOrder, AppendLast?: boolean): any; ApplyOutlineStyles(): any; readonly Areas: Areas; AutoComplete(String: string): string; - /** @param Excel.XlAutoFillType [Type=0] */ + /** @param Type [Type=0] */ AutoFill(Destination: Range, Type?: XlAutoFillType): any; - /** @param Excel.XlAutoFilterOperator [Operator=1] */ - AutoFilter(Field: any, Criteria1: any, Operator?: XlAutoFilterOperator, Criteria2?: any, VisibleDropDown?: any): any; + /** @param Operator [Operator=1] */ + AutoFilter(Field: number, Criteria1: string, Operator?: XlAutoFilterOperator, Criteria2?: string, VisibleDropDown?: boolean): any; AutoFit(): any; - /** @param Excel.XlRangeAutoFormat [Format=1] */ + /** @param Format [Format=1] */ AutoFormat(Format?: XlRangeAutoFormat, Number?: any, Font?: any, Alignment?: any, Border?: any, Pattern?: any, Width?: any): any; AutoOutline(): any; /** - * @param Excel.XlBorderWeight [Weight=2] - * @param Excel.XlColorIndex [ColorIndex=-4105] + * @param Weight [Weight=2] + * @param ColorIndex [ColorIndex=-4105] */ - BorderAround(LineStyle: any, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: any, ThemeColor?: any): any; + BorderAround(LineStyle?: XlLineStyle, Weight?: XlBorderWeight, ColorIndex?: XlColorIndex, Color?: number, ThemeColor?: number | XlThemeColor): any; readonly Borders: Borders; Calculate(): any; CalculateRowMajorOrder(): any; readonly Cells: Range; - Characters(Start?: any, Length?: any): Characters; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): any; + Characters(Start?: number, Length?: number): Characters; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): any; Clear(): any; ClearComments(): void; ClearContents(): any; @@ -6745,38 +7261,39 @@ declare namespace Excel { ClearNotes(): any; ClearOutline(): any; readonly Column: number; - ColumnDifferences(Comparison: any): Range; + ColumnDifferences(Comparison: Range): Range; readonly Columns: Range; - ColumnWidth: any; + ColumnWidth: number | null; readonly Comment: Comment; - Consolidate(Sources?: any, Function?: any, TopRow?: any, LeftColumn?: any, CreateLinks?: any): any; - Copy(Destination?: any): any; - CopyFromRecordset(Data: any, MaxRows?: any, MaxColumns?: any): number; + Consolidate(Sources?: SafeArray, Function?: XlConsolidationFunction, TopRow?: boolean, LeftColumn?: boolean, CreateLinks?: boolean): any; + Copy(Destination?: Range): any; + CopyFromRecordset(Data: DAO.Recordset | ADODB.Recordset, MaxRows?: number, MaxColumns?: number): number; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlCopyPictureFormat [Format=-4147] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] */ CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): any; readonly Count: number; - readonly CountLarge: any; - CreateNames(Top?: any, Left?: any, Bottom?: any, Right?: any): any; + readonly CountLarge: number; + CreateNames(Top?: boolean, Left?: boolean, Bottom?: boolean, Right?: boolean): any; - /** @param Excel.XlPictureAppearance [Appearance=1] */ + /** @param Appearance [Appearance=1] */ CreatePublisher(Edition: any, Appearance?: XlPictureAppearance, ContainsPICT?: any, ContainsBIFF?: any, ContainsRTF?: any, ContainsVALU?: any): any; readonly Creator: XlCreator; readonly CurrentArray: Range; readonly CurrentRegion: Range; - Cut(Destination?: any): any; + Cut(Destination?: Range): any; /** - * @param Excel.XlDataSeriesType [Type=-4132] - * @param Excel.XlDataSeriesDate [Date=1] + * @param Type [Type=-4132] + * @param Date [Date=1] + * @param Step [Step=1] */ - DataSeries(Rowcol: any, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: any, Stop?: any, Trend?: any): any; - Delete(Shift?: any): any; + DataSeries(Rowcol: XlRowCol, Type?: XlDataSeriesType, Date?: XlDataSeriesDate, Step?: number, Stop?: number, Trend?: boolean): any; + Delete(Shift?: XlDeleteShiftDirection): any; readonly Dependents: Range; - DialogBox(): any; + DialogBox(): number | false; readonly DirectDependents: Range; readonly DirectPrecedents: Range; Dirty(): void; @@ -6784,81 +7301,78 @@ declare namespace Excel { readonly DisplayFormat: DisplayFormat; /** - * @param Excel.XlPictureAppearance [Appearance=1] - * @param Excel.XlPictureAppearance [ChartSize=1] + * @param Appearance [Appearance=1] + * @param ChartSize [ChartSize=1] */ EditionOptions(Type: XlEditionType, Option: XlEditionOptionsOption, Name: any, Reference: any, Appearance?: XlPictureAppearance, ChartSize?: XlPictureAppearance, Format?: any): any; End(Direction: XlDirection): Range; readonly EntireColumn: Range; readonly EntireRow: Range; readonly Errors: Errors; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; FillDown(): any; FillLeft(): any; FillRight(): any; FillUp(): any; - /** @param Excel.XlSearchDirection [SearchDirection=1] */ - Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, - MatchByte?: boolean, SearchFormat?: any): Range; + /** @param SearchDirection [SearchDirection=1] */ + Find(What: any, After?: any, LookIn?: XlFindLookIn, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, SearchDirection?: XlSearchDirection, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: any): Range; FindNext(After?: any): Range; FindPrevious(After?: any): Range; readonly Font: Font; readonly FormatConditions: FormatConditions; - Formula: any; - FormulaArray: any; - FormulaHidden: any; + Formula: string | SafeArray; + FormulaArray: string | SafeArray | null; + FormulaHidden: boolean | null; FormulaLabel: XlFormulaLabel; - FormulaLocal: any; - FormulaR1C1: any; - FormulaR1C1Local: any; + FormulaLocal: string | SafeArray; + FormulaR1C1: string | SafeArray; + FormulaR1C1Local: string | SafeArray; FunctionWizard(): any; GoalSeek(Goal: any, ChangingCell: Range): boolean; - Group(Start?: any, End?: any, By?: any, Periods?: any): any; - readonly HasArray: any; - readonly HasFormula: any; - readonly Height: any; - Hidden: any; - HorizontalAlignment: any; + Group(Start?: any, End?: any, By?: number, Periods?: SafeArray): any; + readonly HasArray: boolean; + readonly HasFormula: boolean | null; + Height: number; + Hidden: boolean; + HorizontalAlignment: HorizontalAlignments; readonly Hyperlinks: Hyperlinks; ID: string; - IndentLevel: any; - Insert(Shift?: any, CopyOrigin?: any): any; + IndentLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; + Insert(Shift?: XlInsertShiftDirection, CopyOrigin?: any): any; InsertIndent(InsertAmount: number): void; readonly Interior: Interior; Item(RowIndex: number, ColumnIndex?: number): Range; Item(Address: string): Range; Justify(): any; - readonly Left: any; + readonly Left: number; readonly ListHeaderRows: number; ListNames(): any; readonly ListObject: ListObject; readonly LocationInTable: XlLocationInTable; - Locked: any; + Locked: boolean | null; readonly MDX: string; - Merge(Across?: any): void; + Merge(Across?: boolean): void; readonly MergeArea: Range; - MergeCells: any; - Name: any; - NavigateArrow(TowardPrecedent?: any, ArrowNumber?: any, LinkNumber?: any): any; + MergeCells: boolean; + Name: string | Name; + NavigateArrow(TowardPrecedent?: boolean, ArrowNumber?: number, LinkNumber?: number): any; readonly Next: Range; - NoteText(Text?: any, Start?: any, Length?: any): string; - NumberFormat: any; - NumberFormatLocal: any; + NoteText(Text?: string, Start?: number, Length?: number): string; + NumberFormat: string | null; + NumberFormatLocal: string | null; Offset(RowOffset?: number, ColumnOffset?: number): Range; - Orientation: any; - OutlineLevel: any; + Orientation: number | XlOrientation; + OutlineLevel: number; PageBreak: number; readonly Parent: any; - Parse(ParseLine?: any, Destination?: any): any; + Parse(ParseLine?: string, Destination?: Range): any; /** - * @param Excel.XlPasteType [Paste=-4104] - * @param Excel.XlPasteSpecialOperation [Operation=-4142] + * @param Paste [Paste=-4104] + * @param Operation [Operation=-4142] */ - PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: any, Transpose?: any): any; + PasteSpecial(Paste?: XlPasteType, Operation?: XlPasteSpecialOperation, SkipBlanks?: boolean, Transpose?: boolean): any; readonly Phonetic: Phonetic; readonly Phonetics: Phonetics; readonly PivotCell: PivotCell; @@ -6866,114 +7380,108 @@ declare namespace Excel { readonly PivotItem: PivotItem; readonly PivotTable: PivotTable; readonly Precedents: Range; - readonly PrefixCharacter: any; + readonly PrefixCharacter: "'" | '"' | '^' | '\\' | ''; readonly Previous: Range; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; readonly QueryTable: QueryTable; - Range(Cell1: any, Cell2?: any): Range; + Range(Cell1: string | Range, Cell2?: string | Range): Range; ReadingOrder: number; - /** @param Excel.XlYesNoGuess [Header=2] */ - RemoveDuplicates(Columns: any, Header?: XlYesNoGuess): void; + /** @param Header [Header=2] */ + RemoveDuplicates(Columns: SafeArray, Header?: XlYesNoGuess): void; RemoveSubtotal(): any; - Replace(What: any, Replacement: any, LookAt?: any, SearchOrder?: any, MatchCase?: any, MatchByte?: any, SearchFormat?: any, ReplaceFormat?: any): boolean; - Resize(RowSize?: any, ColumnSize?: any): Range; + Replace(What: string, Replacement: string, LookAt?: XlLookAt, SearchOrder?: XlSearchOrder, MatchCase?: boolean, MatchByte?: boolean, SearchFormat?: boolean, ReplaceFormat?: boolean): boolean; + Resize(RowSize?: number, ColumnSize?: number): Range; readonly Row: number; - RowDifferences(Comparison: any): Range; - RowHeight: any; + RowDifferences(Comparison: Range): Range; + RowHeight: number | null; readonly Rows: Range; - Run( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Run(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Select(): any; readonly ServerActions: Actions; SetPhonetic(): void; Show(): any; - ShowDependents(Remove?: any): any; + ShowDependents(Remove?: boolean): any; ShowDetail: any; ShowErrors(): any; - ShowPrecedents(Remove?: any): any; - ShrinkToFit: any; + ShowPrecedents(Remove?: boolean): any; + ShrinkToFit: boolean | null; readonly SmartTags: SmartTags; /** - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param SortMethod [SortMethod=1] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - Sort( - Key1: any, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: any, - MatchCase?: any, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; + Sort(Key1: string | Range, Order1?: XlSortOrder, Key2?: any, Type?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, SortMethod?: XlSortMethod, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; /** - * @param Excel.XlSortMethod [SortMethod=1] - * @param Excel.XlSortOrder [Order1=1] - * @param Excel.XlSortOrder [Order2=1] - * @param Excel.XlSortOrder [Order3=1] - * @param Excel.XlYesNoGuess [Header=2] - * @param Excel.XlSortOrientation [Orientation=2] - * @param Excel.XlSortDataOption [DataOption1=0] - * @param Excel.XlSortDataOption [DataOption2=0] - * @param Excel.XlSortDataOption [DataOption3=0] + * @param SortMethod [SortMethod=1] + * @param Order1 [Order1=1] + * @param Order2 [Order2=1] + * @param Order3 [Order3=1] + * @param Header [Header=2] + * @param Orientation [Orientation=2] + * @param DataOption1 [DataOption1=0] + * @param DataOption2 [DataOption2=0] + * @param DataOption3 [DataOption3=0] */ - SortSpecial( - SortMethod?: XlSortMethod, Key1?: any, Order1?: XlSortOrder, Type?: any, Key2?: any, Order2?: XlSortOrder, Key3?: any, Order3?: XlSortOrder, - Header?: XlYesNoGuess, OrderCustom?: any, MatchCase?: any, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, - DataOption3?: XlSortDataOption): any; + SortSpecial(SortMethod?: XlSortMethod, Key1?: string | Range, Order1?: XlSortOrder, Type?: any, Key2?: string | Range, Order2?: XlSortOrder, Key3?: string | Range, Order3?: XlSortOrder, Header?: XlYesNoGuess, OrderCustom?: number, MatchCase?: boolean, Orientation?: XlSortOrientation, DataOption1?: XlSortDataOption, DataOption2?: XlSortDataOption, DataOption3?: XlSortDataOption): any; readonly SoundNote: SoundNote; readonly SparklineGroups: SparklineGroups; - Speak(SpeakDirection?: any, SpeakFormulas?: any): void; - SpecialCells(Type: XlCellType, Value?: any): Range; - Style: any; + Speak(SpeakDirection?: XlSpeakDirection, SpeakFormulas?: boolean): void; + SpecialCells(Type: XlCellType.xlCellTypeConstants | XlCellType.xlCellTypeFormulas, Value?: XlSpecialCellsValue): Range; + SpecialCells(Type: XlCellType): Range; + Style: Style; - /** @param Excel.XlSubscribeToFormat [Format=-4158] */ + /** @param Format [Format=-4158] */ SubscribeTo(Edition: string, Format?: XlSubscribeToFormat): any; - /** @param Excel.XlSummaryRow [SummaryBelowData=1] */ - Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: any, Replace: any, PageBreaks: any, SummaryBelowData?: XlSummaryRow): any; - readonly Summary: any; - Table(RowInput?: any, ColumnInput?: any): any; - readonly Text: any; + /** @param SummaryBelowData [SummaryBelowData=1] */ + Subtotal(GroupBy: number, Function: XlConsolidationFunction, TotalList: SafeArray, Replace: boolean, PageBreaks: boolean, SummaryBelowData?: XlSummaryRow): any; + readonly Summary: boolean; + Table(RowInput?: Range, ColumnInput?: Range): any; + readonly Text: string; /** - * @param Excel.XlTextParsingType [DataType=1] - * @param Excel.XlTextQualifier [TextQualifier=1] + * @param DataType [DataType=1] + * @param TextQualifier [TextQualifier=1] */ - TextToColumns( - Destination: any, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, - Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, DecimalSeparator?: any, ThousandsSeparator?: any, TrailingMinusNumbers?: any): any; - readonly Top: any; + TextToColumns(Destination: Range, DataType?: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: string, FieldInfo?: SafeArray, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: any): any; + readonly Top: number; Ungroup(): any; UnMerge(): void; - UseStandardHeight: any; - UseStandardWidth: any; + UseStandardHeight: boolean | null; + UseStandardWidth: boolean | null; readonly Validation: Validation; - Value(RangeValueDataType?: XlRangeValueDataType): any; + + // tslint:disable-next-line: ban-types + Value: Exclude & ((RangeValueDataType?: XlRangeValueDataType) => any); Value2: any; - VerticalAlignment: any; - readonly Width: any; + VerticalAlignment: VerticalAlignments; + readonly Width: number; readonly Worksheet: Worksheet; - WrapText: any; + WrapText: boolean | null; readonly XPath: XPath; + (RowIndex: number, ColumnIndex?: number): Range; + (Address: string): Range; } - class Ranges { - private 'Excel.Ranges_typekey': Ranges; - private constructor(); + interface Ranges { _Default(Index: any): Range; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): Range; readonly Parent: any; + (Index: any): Range; } class RecentFile { @@ -6989,9 +7497,7 @@ declare namespace Excel { readonly Path: string; } - class RecentFiles { - private 'Excel.RecentFiles_typekey': RecentFiles; - private constructor(); + interface RecentFiles { _Default(Index: number): RecentFile; Add(Name: string): RecentFile; readonly Application: Application; @@ -7000,6 +7506,7 @@ declare namespace Excel { Item(Index: number): RecentFile; Maximum: number; readonly Parent: any; + (Index: number): RecentFile; } class Research { @@ -7009,7 +7516,7 @@ declare namespace Excel { readonly Creator: XlCreator; IsResearchService(ServiceID: string): boolean; readonly Parent: any; - Query(ServiceID: string, QueryString?: any, QueryLanguage?: any, UseSelection?: any, LaunchQuery?: any): any; + Query(ServiceID: string, QueryString?: string, QueryLanguage?: any, UseSelection?: boolean, LaunchQuery?: boolean): any; SetLanguagePair(LanguageFrom: number, LanguageTo: number): any; } @@ -7037,6 +7544,123 @@ declare namespace Excel { ThrottleInterval: number; } + class Scenario { + private 'Excel.Scenario_typekey': Scenario; + private constructor(); + readonly Application: Application; + ChangeScenario(ChangingCells: Range, Values?: SafeArray): any; + readonly ChangingCells: Range; + Comment: string; + readonly Creator: XlCreator; + Delete(): any; + Hidden: boolean; + readonly Index: number; + Locked: boolean; + Name: string; + readonly Parent: any; + Show(): any; + Values(): SafeArray; + Values(Index: number): any; + } + + interface Scenarios { + Add(Name: string, ChangingCells: Range, Values?: SafeArray, Comment?: string, Locked?: boolean, Hidden?: boolean): Scenario; + readonly Application: Application; + readonly Count: number; + + /** @param ReportType [ReportType=1] */ + CreateSummary(ReportType?: XlSummaryReportType, ResultCells?: Range): any; + readonly Creator: XlCreator; + Item(Index: number | string): Scenario; + Merge(Source: string | Worksheet): any; + readonly Parent: any; + (Index: number | string): Scenario; + } + + class Series { + private 'Excel.Series_typekey': Series; + private constructor(); + + /** @param Type [Type=2] */ + _ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: any, AutoText?: any, HasLeaderLines?: any): any; + readonly Application: Application; + ApplyCustomType(ChartType: XlChartType): void; + + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, LegendKey?: boolean, AutoText?: boolean, HasLeaderLines?: boolean, ShowSeriesName?: boolean, ShowCategoryName?: boolean, ShowValue?: boolean, ShowPercentage?: boolean, ShowBubbleSize?: boolean, Separator?: string): any; + ApplyPictToEnd: boolean; + ApplyPictToFront: boolean; + ApplyPictToSides: boolean; + AxisGroup: XlAxisGroup; + BarShape: XlBarShape; + readonly Border: Border; + BubbleSizes: string; + ChartType: XlChartType; + ClearFormats(): any; + Copy(): any; + readonly Creator: XlCreator; + DataLabels: DataLabels & ((Index: number) => DataLabel); + Delete(): any; + ErrorBar(Direction: XlErrorBarDirection, Include: XlErrorBarInclude, Type: XlErrorBarType, Amount?: any, MinusValues?: any): any; + readonly ErrorBars: ErrorBars; + Explosion: number; + readonly Fill: ChartFillFormat; + readonly Format: ChartFormat; + Formula: string; + FormulaLocal: string; + FormulaR1C1: string; + FormulaR1C1Local: string; + Has3DEffect: boolean; + HasDataLabels: boolean; + HasErrorBars: boolean; + HasLeaderLines: boolean; + readonly Interior: Interior; + InvertColor: number; + InvertColorIndex: number; + InvertIfNegative: boolean; + readonly LeaderLines: LeaderLines; + MarkerBackgroundColor: number; + MarkerBackgroundColorIndex: XlColorIndex; + MarkerForegroundColor: number; + MarkerForegroundColorIndex: XlColorIndex; + MarkerSize: number; + MarkerStyle: XlMarkerStyle; + Name: string; + readonly Parent: any; + Paste(): any; + PictureType: XlChartPictureType; + PictureUnit: number; + PictureUnit2: number; + readonly PlotColorIndex: number; + PlotOrder: number; + Points: Points & ((Index: number) => Point); + Select(): any; + Shadow: boolean; + Smooth: boolean; + Trendlines: Trendlines & ((Index: number | string) => Trendline); + Type: number; + Values: Range | SafeArray; + XValues: Range | SafeArray; + } + + interface SeriesCollection { + _Default(Index: any): Series; + + /** @param Rowcol [Rowcol=-4105] */ + Add(Source: Range, Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean): Series; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Extend(Source: Range, Rowcol?: XlRowCol, CategoryLabels?: boolean): any; + Item(Index: number | string): Series; + NewSeries(): Series; + readonly Parent: any; + + /** @param Rowcol [Rowcol=-4105] */ + Paste(Rowcol?: XlRowCol, SeriesLabels?: boolean, CategoryLabels?: boolean, Replace?: boolean, NewSeries?: boolean): any; + (Index: number | string): Series; + } + class SeriesLines { private 'Excel.SeriesLines_typekey': SeriesLines; private constructor(); @@ -7050,18 +7674,17 @@ declare namespace Excel { Select(): any; } - class ServerViewableItems { - private 'Excel.ServerViewableItems_typekey': ServerViewableItems; - private constructor(); + interface ServerViewableItems { _Default(Index: any): any; Add(Obj: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Delete(Index: any): void; + Delete(Index: number): void; DeleteAll(): void; - Item(Index: any): any; + Item(Index: number): any; readonly Parent: any; + (Index: number): any; } class ShadowFormat { @@ -7109,7 +7732,7 @@ declare namespace Excel { readonly ConnectorFormat: ConnectorFormat; readonly ControlFormat: ControlFormat; Copy(): void; - CopyPicture(Appearance?: any, Format?: any): void; + CopyPicture(Appearance?: XlPictureAppearance, Format?: XlCopyPictureFormat): void; readonly Creator: XlCreator; Cut(): void; Delete(): void; @@ -7150,10 +7773,10 @@ declare namespace Excel { readonly Reflection: Office.ReflectionFormat; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; readonly Script: Office.Script; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7169,7 +7792,7 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; @@ -7183,35 +7806,32 @@ declare namespace Excel { readonly Creator: number; readonly EditingType: Office.MsoEditingType; readonly Parent: any; - readonly Points: any; + readonly Points: SafeArray; readonly SegmentType: Office.MsoSegmentType; } - class ShapeNodes { - private 'Excel.ShapeNodes_typekey': ShapeNodes; - private constructor(); + interface ShapeNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Delete(Index: number): void; /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ Insert(Index: number, SegmentType: Office.MsoSegmentType, EditingType: Office.MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; - Item(Index: any): ShapeNode; + Item(Index: number | string): ShapeNode; readonly Parent: any; SetEditingType(Index: number, EditingType: Office.MsoEditingType): void; SetPosition(Index: number, X1: number, Y1: number): void; SetSegmentType(Index: number, SegmentType: Office.MsoSegmentType): void; + (Index: number | string): ShapeNode; } - class ShapeRange { - private 'Excel.ShapeRange_typekey': ShapeRange; - private constructor(); + interface ShapeRange { _Default(Index: any): Shape; readonly Adjustments: Adjustments; Align(AlignCmd: Office.MsoAlignCmd, RelativeTo: Office.MsoTriState): void; @@ -7253,7 +7873,7 @@ declare namespace Excel { IncrementLeft(Increment: number): void; IncrementRotation(Increment: number): void; IncrementTop(Increment: number): void; - Item(Index: any): Shape; + Item(Index: number | string): Shape; Left: number; readonly Line: LineFormat; LockAspectRatio: Office.MsoTriState; @@ -7267,9 +7887,9 @@ declare namespace Excel { Regroup(): Shape; RerouteConnections(): void; Rotation: number; - ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: any): void; - Select(Replace?: any): void; + ScaleHeight(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + ScaleWidth(Factor: number, RelativeToOriginalSize: Office.MsoTriState, Scale?: Office.MsoScaleFrom): void; + Select(Replace?: boolean): void; SetShapesDefaultProperties(): void; readonly Shadow: ShadowFormat; ShapeStyle: Office.MsoShapeStyleIndex; @@ -7283,82 +7903,81 @@ declare namespace Excel { readonly Type: Office.MsoShapeType; Ungroup(): ShapeRange; readonly VerticalFlip: Office.MsoTriState; - readonly Vertices: any; + readonly Vertices: SafeArray; Visible: Office.MsoTriState; Width: number; ZOrder(ZOrderCmd: Office.MsoZOrderCmd): void; readonly ZOrderPosition: number; + (Index: number | string): Shape; } - class Shapes { - private 'Excel.Shapes_typekey': Shapes; - private constructor(); + interface Shapes { _Default(Index: any): Shape; AddCallout(Type: Office.MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddCanvas(Left: number, Top: number, Width: number, Height: number): Shape; - AddChart(XlChartType?: any, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddChart(XlChartType?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number, NewLayout?: boolean): Shape; AddConnector(Type: Office.MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddCurve(SafeArrayOfPoints: any): Shape; + AddCurve(SafeArrayOfPoints: SafeArray): Shape; AddDiagram(Type: Office.MsoDiagramType, Left: number, Top: number, Width: number, Height: number): Shape; AddFormControl(Type: XlFormControl, Left: number, Top: number, Width: number, Height: number): Shape; AddLabel(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddOLEObject(ClassType?: any, Filename?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, Left?: any, Top?: any, Width?: any, - Height?: any): Shape; + AddOLEObject(ClassType: string, Filename?: undefined, Link?: false, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; + AddOLEObject(ClassType: undefined, Filename: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: string, IconIndex?: number, IconLabel?: string, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddPicture(Filename: string, LinkToFile: Office.MsoTriState, SaveWithDocument: Office.MsoTriState, Left: number, Top: number, Width: number, Height: number): Shape; - AddPolyline(SafeArrayOfPoints: any): Shape; + AddPolyline(SafeArrayOfPoints: SafeArray): Shape; AddShape(Type: Office.MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; - AddSmartArt(Layout: Office.SmartArtLayout, Left?: any, Top?: any, Width?: any, Height?: any): Shape; + AddSmartArt(Layout: Office.SmartArtLayout, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddTextbox(Orientation: Office.MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; - AddTextEffect( - PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, - Left: number, Top: number): Shape; + AddTextEffect(PresetTextEffect: Office.MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: Office.MsoTriState, FontItalic: Office.MsoTriState, Left: number, Top: number): Shape; readonly Application: Application; BuildFreeform(EditingType: Office.MsoEditingType, X1: number, Y1: number): FreeformBuilder; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; - Range(Index: any): ShapeRange; + Range(Index: number | string | SafeArray): ShapeRange; SelectAll(): void; + (Index: number | string): Shape; } - class Sheets { - private 'Excel.Sheets_typekey': Sheets; - private constructor(); + interface Sheets { __PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any): void; _Default(Index: any): any; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; - Add(Before?: any, After?: any, Count?: any, Type?: any): any; + Add(Before?: Sheet, After?: Sheet, Count?: number, Type?: T): AddSheetResult; readonly Application: Application; - Copy(Before?: any, After?: any): void; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - /** @param Excel.XlFillWith [Type=-4104] */ + /** @param Type [Type=-4104] */ FillAcrossSheets(Range: Range, Type?: XlFillWith): void; readonly HPageBreaks: HPageBreaks; - Item(Index: string | number): Worksheet | Chart | DialogSheet; - Item(Indexes: SafeArray): Sheets; - Move(Before?: any, After?: any): void; + Item(Index: string | number): TSheet; + Item(Indexes: SafeArray): Sheets; + Move(Before?: Sheet | number): void; + Move(Before: undefined, After: Sheet | number): void; readonly Parent: any; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; Select(Replace?: boolean): void; Visible: any; readonly VPageBreaks: VPageBreaks; + (Index: string | number): TSheet; + (Indexes: SafeArray): Sheets; } - class SheetViews { - private 'Excel.SheetViews_typekey': SheetViews; - private constructor(); + interface SheetViews { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: any): SheetView; readonly Parent: any; + (Index: any): SheetView; } class Slicer { @@ -7430,27 +8049,25 @@ declare namespace Excel { readonly VisibleSlicerItemsList: any; } - class SlicerCacheLevels { - private 'Excel.SlicerCacheLevels_typekey': SlicerCacheLevels; - private constructor(); + interface SlicerCacheLevels { _Default(Level?: any): SlicerCacheLevel; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Level?: any): SlicerCacheLevel; + Item(Level?: number | string): SlicerCacheLevel; readonly Parent: any; + (Level?: number | string): SlicerCacheLevel; } - class SlicerCaches { - private 'Excel.SlicerCaches_typekey': SlicerCaches; - private constructor(); + interface SlicerCaches { _Default(Index: any): SlicerCache; - Add(Source: any, SourceField: any, Name?: any): SlicerCache; + Add(Source: WorkbookConnection | PivotTable | string, SourceField: any, Name?: any): SlicerCache; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerCache; + Item(Index: number | string): SlicerCache; readonly Parent: any; + (Index: number | string): SlicerCache; } class SlicerItem { @@ -7468,40 +8085,37 @@ declare namespace Excel { readonly Value: string; } - class SlicerItems { - private 'Excel.SlicerItems_typekey': SlicerItems; - private constructor(); + interface SlicerItems { _Default(Index: any): SlicerItem; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): SlicerItem; + Item(Index: number | string): SlicerItem; readonly Parent: any; + (Index: number | string): SlicerItem; } - class SlicerPivotTables { - private 'Excel.SlicerPivotTables_typekey': SlicerPivotTables; - private constructor(); + interface SlicerPivotTables { _Default(Index: any): PivotTable; AddPivotTable(PivotTable: PivotTable): void; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): PivotTable; + Item(Index: number | string): PivotTable; readonly Parent: any; - RemovePivotTable(PivotTable: any): void; + RemovePivotTable(PivotTable: PivotTable | number | string): void; + (Index: number | string): PivotTable; } - class Slicers { - private 'Excel.Slicers_typekey': Slicers; - private constructor(); + interface Slicers { _Default(Index: any): Slicer; - Add(SlicerDestination: any, Level?: any, Name?: any, Caption?: any, Top?: any, Left?: any, Width?: any, Height?: any): Slicer; + Add(SlicerDestination: string | Worksheet, Level?: any, Name?: string, Caption?: string, Top?: number, Left?: number, Width?: number, Height?: number): Slicer; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Slicer; + Item(Index: number | string): Slicer; readonly Parent: any; + (Index: number | string): Slicer; } class SmartTag { @@ -7539,15 +8153,14 @@ declare namespace Excel { readonly Type: XlSmartTagControlType; } - class SmartTagActions { - private 'Excel.SmartTagActions_typekey': SmartTagActions; - private constructor(); + interface SmartTagActions { _Default(Index: any): SmartTagAction; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: any): SmartTagAction; readonly Parent: any; + (Index: any): SmartTagAction; } class SmartTagOptions { @@ -7572,9 +8185,7 @@ declare namespace Excel { readonly progID: string; } - class SmartTagRecognizers { - private 'Excel.SmartTagRecognizers_typekey': SmartTagRecognizers; - private constructor(); + interface SmartTagRecognizers { _Default(Index: any): SmartTagRecognizer; readonly Application: Application; readonly Count: number; @@ -7582,17 +8193,17 @@ declare namespace Excel { Item(Index: any): SmartTagRecognizer; readonly Parent: any; Recognize: boolean; + (Index: any): SmartTagRecognizer; } - class SmartTags { - private 'Excel.SmartTags_typekey': SmartTags; - private constructor(); + interface SmartTags { _Default(Index: any): SmartTag; Add(SmartTagType: string): SmartTag; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; readonly Parent: any; + (Index: any): SmartTag; } class Sort { @@ -7629,9 +8240,7 @@ declare namespace Excel { readonly SortOnValue: any; } - class SortFields { - private 'Excel.SortFields_typekey': SortFields; - private constructor(); + interface SortFields { _Default(Index: any): SortField; Add(Key: Range, SortOn?: any, Order?: any, CustomOrder?: any, DataOption?: any): SortField; readonly Application: Application; @@ -7640,6 +8249,7 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): SortField; readonly Parent: any; + (Index: any): SortField; } class SoundNote { @@ -7723,9 +8333,7 @@ declare namespace Excel { Type: XlSparkType; } - class SparklineGroups { - private 'Excel.SparklineGroups_typekey': SparklineGroups; - private constructor(); + interface SparklineGroups { _Default(Index: any): SparklineGroup; Add(Type: XlSparkType, SourceData: string): SparklineGroup; readonly Application: Application; @@ -7734,9 +8342,10 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Group(Location: Range): void; - Item(Index: any): SparklineGroup; + Item(Index: number): SparklineGroup; readonly Parent: any; Ungroup(): void; + (Index: number): SparklineGroup; } class SparkPoints { @@ -7769,7 +8378,7 @@ declare namespace Excel { private 'Excel.Speech_typekey': Speech; private constructor(); Direction: XlSpeakDirection; - Speak(Text: string, SpeakAsync?: any, SpeakXML?: any, Purge?: any): void; + Speak(Text: string, SpeakAsync?: boolean, SpeakXML?: boolean, Purge?: boolean): void; SpeakCellOnEnter: boolean; } @@ -7819,7 +8428,7 @@ declare namespace Excel { IndentLevel: number; readonly Interior: Interior; Locked: boolean; - MergeCells: any; + MergeCells: boolean; readonly Name: string; readonly NameLocal: string; NumberFormat: string; @@ -7833,29 +8442,28 @@ declare namespace Excel { WrapText: boolean; } - class Styles { - private 'Excel.Styles_typekey': Styles; - private constructor(); + interface Styles { _Default(Index: any): Style; Add(Name: string, BasedOn?: any): Style; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Style; - Merge(Workbook: any): any; + Item(Index: number | string): Style; + Merge(Workbook: Workbook): any; readonly Parent: any; + (Index: any): Style; } class Tab { private 'Excel.Tab_typekey': Tab; private constructor(); readonly Application: Application; - Color: any; + Color: XlRgbColor | number; ColorIndex: XlColorIndex; readonly Creator: XlCreator; readonly Parent: any; ThemeColor: XlThemeColor; - TintAndShade: any; + TintAndShade: number; } class TableStyle { @@ -7866,7 +8474,7 @@ declare namespace Excel { readonly BuiltIn: boolean; readonly Creator: XlCreator; Delete(): void; - Duplicate(NewTableStyleName?: any): TableStyle; + Duplicate(NewTableStyleName?: string): TableStyle; readonly Name: string; readonly NameLocal: string; readonly Parent: any; @@ -7890,27 +8498,25 @@ declare namespace Excel { StripeSize: number; } - class TableStyleElements { - private 'Excel.TableStyleElements_typekey': TableStyleElements; - private constructor(); + interface TableStyleElements { _Default(Index: XlTableStyleElementType): TableStyleElement; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: XlTableStyleElementType): TableStyleElement; readonly Parent: any; + (Index: XlTableStyleElementType): TableStyleElement; } - class TableStyles { - private 'Excel.TableStyles_typekey': TableStyles; - private constructor(); + interface TableStyles { _Default(Index: any): TableStyle; Add(TableStyleName: string): TableStyle; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): TableStyle; + Item(Index: number | string): TableStyle; readonly Parent: any; + (Index: number | string): TableStyle; } class TextEffectFormat { @@ -7940,7 +8546,7 @@ declare namespace Excel { readonly Application: Application; AutoMargins: boolean; AutoSize: boolean; - Characters(Start?: any, Length?: any): Characters; + Characters(Start?: number, Length?: number): Characters; readonly Creator: XlCreator; HorizontalAlignment: XlHAlign; HorizontalOverflow: XlOartHorizontalOverflow; @@ -8041,7 +8647,7 @@ declare namespace Excel { readonly Name: string; NumberFormat: string; NumberFormatLinked: boolean; - NumberFormatLocal: any; + NumberFormatLocal: string; Offset: number; Orientation: XlTickLabelOrientation; readonly Parent: any; @@ -8096,9 +8702,7 @@ declare namespace Excel { Width: number; } - class ToolbarButtons { - private 'Excel.ToolbarButtons_typekey': ToolbarButtons; - private constructor(); + interface ToolbarButtons { _Default(Index: number): ToolbarButton; Add(Button?: any, Before?: any, OnAction?: any, Pushed?: any, Enabled?: any, StatusBar?: any, HelpFile?: any, HelpContextID?: any): ToolbarButton; readonly Application: Application; @@ -8106,11 +8710,10 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: number): ToolbarButton; readonly Parent: any; + (Index: number): ToolbarButton; } - class Toolbars { - private 'Excel.Toolbars_typekey': Toolbars; - private constructor(); + interface Toolbars { _Default(Index: any): Toolbar; Add(Name?: any): Toolbar; readonly Application: Application; @@ -8118,6 +8721,33 @@ declare namespace Excel { readonly Creator: XlCreator; Item(Index: any): Toolbar; readonly Parent: any; + (Index: any): Toolbar; + } + + class Top10 { + private 'Excel.Top10_typekey': Top10; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + CalcFor: XlCalcFor; + readonly Creator: XlCreator; + Delete(): void; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Percent: boolean; + Priority: number; + readonly PTCondition: boolean; + Rank: number; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + TopBottom: XlTopBottom; + readonly Type: number; } class TreeviewControl { @@ -8126,10 +8756,74 @@ declare namespace Excel { readonly Application: Application; readonly Creator: XlCreator; Drilled: any; - Hidden: any; + Hidden: SafeArray>; readonly Parent: any; } + class Trendline { + private 'Excel.Trendline_typekey': Trendline; + private constructor(); + readonly Application: Application; + Backward: number; + Backward2: number; + readonly Border: Border; + ClearFormats(): any; + readonly Creator: XlCreator; + readonly DataLabel: DataLabel; + Delete(): any; + DisplayEquation: boolean; + DisplayRSquared: boolean; + readonly Format: ChartFormat; + Forward: number; + Forward2: number; + readonly Index: number; + Intercept: number; + InterceptIsAuto: boolean; + Name: string; + NameIsAuto: boolean; + Order: number; + readonly Parent: any; + Period: number; + Select(): any; + Type: XlTrendlineType; + } + + interface Trendlines { + _Default(Index?: any): Trendline; + + /** @param Type [Type=-4132] */ + Add(Type?: XlTrendlineType, Order?: number, Period?: number, Forward?: number, Backward?: number, Intercept?: any, DisplayEquation?: boolean, DisplayRSquared?: boolean, Name?: string): Trendline; + readonly Application: Application; + readonly Count: number; + readonly Creator: XlCreator; + Item(Index: number): Trendline; + readonly Parent: any; + (Index: number): Trendline; + } + + class UniqueValues { + private 'Excel.UniqueValues_typekey': UniqueValues; + private constructor(); + readonly Application: Application; + readonly AppliesTo: Range; + readonly Borders: Borders; + readonly Creator: XlCreator; + Delete(): void; + DupeUnique: XlDupeUnique; + readonly Font: Font; + readonly Interior: Interior; + ModifyAppliesToRange(Range: Range): void; + NumberFormat: string; + readonly Parent: any; + Priority: number; + readonly PTCondition: boolean; + ScopeType: XlPivotConditionScope; + SetFirstPriority(): void; + SetLastPriority(): void; + StopIfTrue: boolean; + readonly Type: XlFormatConditionType.xlUniqueValues; + } + class UpBars { private 'Excel.UpBars_typekey': UpBars; private constructor(); @@ -8145,15 +8839,14 @@ declare namespace Excel { Select(): any; } - class UsedObjects { - private 'Excel.UsedObjects_typekey': UsedObjects; - private constructor(); + interface UsedObjects { _Default(Index: any): any; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): any; + Item(Index: number | string): any; readonly Parent: any; + (Index: number | string): any; } class UserAccess { @@ -8164,20 +8857,21 @@ declare namespace Excel { readonly Name: string; } - class UserAccessList { - private 'Excel.UserAccessList_typekey': UserAccessList; - private constructor(); + interface UserAccessList { _Default(Index: any): UserAccess; Add(Name: string, AllowEdit: boolean): UserAccess; readonly Count: number; DeleteAll(): void; - Item(Index: any): UserAccess; + Item(Index: number | string): UserAccess; + (Index: number | string): UserAccess; } class Validation { private 'Excel.Validation_typekey': Validation; private constructor(); - Add(Type: XlDVType, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Add(Type: XlDVType.xlValidateInputOnly): void; + Add(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Add(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly AlertStyle: number; readonly Application: Application; readonly Creator: XlCreator; @@ -8191,7 +8885,9 @@ declare namespace Excel { InCellDropdown: boolean; InputMessage: string; InputTitle: string; - Modify(Type?: any, AlertStyle?: any, Operator?: any, Formula1?: any, Formula2?: any): void; + Modify(Type: XlDVType.xlValidateInputOnly): void; + Modify(Type: XlDVType.xlValidateWholeNumber | XlDVType.xlValidateDate | XlDVType.xlValidateDecimal | XlDVType.xlValidateTextLength | XlDVType.xlValidateTime, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator.xlBetween | XlFormatConditionOperator.xlNotBetween, Formula1?: string, Formula2?: string): void; + Modify(Type?: XlDVType, AlertStyle?: XlDVAlertStyle, Operator?: XlFormatConditionOperator, Formula1?: string): void; readonly Operator: number; readonly Parent: any; ShowError: boolean; @@ -8230,16 +8926,15 @@ declare namespace Excel { Type: XlPageBreak; } - class VPageBreaks { - private 'Excel.VPageBreaks_typekey': VPageBreaks; - private constructor(); + interface VPageBreaks { _Default(Index: number): VPageBreak; - Add(Before: any): VPageBreak; + Add(Before: Range): VPageBreak; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Item(Index: number): VPageBreak; readonly Parent: any; + (Index: number): VPageBreak; } class Walls { @@ -8255,8 +8950,8 @@ declare namespace Excel { readonly Name: string; readonly Parent: any; Paste(): void; - PictureType: any; - PictureUnit: any; + PictureType: XlChartPictureType; + PictureUnit: number; Select(): any; Thickness: number; } @@ -8271,17 +8966,16 @@ declare namespace Excel { readonly Source: any; } - class Watches { - private 'Excel.Watches_typekey': Watches; - private constructor(); + interface Watches { _Default(Index: any): Watch; Add(Source: any): Watch; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; Delete(): void; - Item(Index: any): Watch; + Item(Index: number | string): Watch; readonly Parent: any; + (Index: number | string): Watch; } class WebOptions { @@ -8316,12 +9010,12 @@ declare namespace Excel { readonly ActiveCell: Range; readonly ActiveChart: Chart; readonly ActivePane: Pane; - readonly ActiveSheet: any; - readonly ActiveSheetView: any; + readonly ActiveSheet: Sheet | null; + readonly ActiveSheetView: SheetView | null; readonly Application: Application; AutoFilterDateGrouping: boolean; - Caption: any; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): boolean; + Caption: string; + Close(SaveChanges?: boolean, Filename?: string, RouteWorkbook?: boolean): boolean; readonly Creator: XlCreator; DisplayFormulas: boolean; DisplayGridlines: boolean; @@ -8340,7 +9034,7 @@ declare namespace Excel { GridlineColorIndex: XlColorIndex; Height: number; readonly Index: number; - LargeScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + LargeScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Left: number; NewWindow(): Window; OnWindow: string; @@ -8348,18 +9042,19 @@ declare namespace Excel { readonly Parent: any; PointsToScreenPixelsX(Points: number): number; PointsToScreenPixelsY(Points: number): number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): any; - PrintPreview(EnableChanges?: any): any; - RangeFromPoint(x: number, y: number): any; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName): any; + PrintPreview(EnableChanges?: boolean): any; + RangeFromPoint(x: number, y: number): Shape | Range | null; readonly RangeSelection: Range; ScrollColumn: number; - ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: any): void; + ScrollIntoView(Left: number, Top: number, Width: number, Height: number, Start?: boolean): void; ScrollRow: number; - ScrollWorkbookTabs(Sheets?: any, Position?: any): any; + ScrollWorkbookTabs(Sheets: 0, Position: Constants.xlFirst | Constants.xlLast): any; + ScrollWorkbookTabs(Sheets: number): any; readonly SelectedSheets: Sheets; readonly Selection: any; readonly SheetViews: SheetViews; - SmallScroll(Down?: any, Up?: any, ToRight?: any, ToLeft?: any): any; + SmallScroll(Down?: number, Up?: number, ToRight?: number, ToLeft?: number): any; Split: boolean; SplitColumn: number; SplitHorizontal: number; @@ -8376,25 +9071,25 @@ declare namespace Excel { Width: number; readonly WindowNumber: number; WindowState: XlWindowState; - Zoom: any; + Zoom: number | true; } - class Windows { - private 'Excel.Windows_typekey': Windows; - private constructor(); + interface Windows { _Default(Index: any): Window; readonly Application: Application; + Arrange(ArrangeStyle: XlArrangeStyle, ActiveWorkbook: true, SyncHorizontal?: boolean, SyncVertical?: boolean): any; - /** @param Excel.XlArrangeStyle [ArrangeStyle=1] */ - Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: any, SyncHorizontal?: any, SyncVertical?: any): any; + /** @param ArrangeStyle [ArrangeStyle=1] */ + Arrange(ArrangeStyle?: XlArrangeStyle, ActiveWorkbook?: boolean, SyncHorizontal?: boolean, SyncVertical?: boolean): any; BreakSideBySide(): boolean; - CompareSideBySideWith(WindowName: any): boolean; + CompareSideBySideWith(WindowName: string): boolean; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): Window; + Item(Index: number | string): Window; readonly Parent: any; ResetPositionsSideBySide(): void; SyncScrollingSideBySide: boolean; + (Index: number | string): Window; } class Workbook { @@ -8407,16 +9102,14 @@ declare namespace Excel { _ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any): void; readonly _ReadOnlyRecommended: boolean; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - _SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + _SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; AcceptAllChanges(When?: any, Who?: any, Where?: any): void; AcceptLabelsInFormulas: boolean; AccuracyVersion: number; Activate(): void; readonly ActiveChart: Chart; - readonly ActiveSheet: any; + readonly ActiveSheet: Sheet; readonly ActiveSlicer: Slicer; AddToFavorites(): void; readonly Application: Application; @@ -8428,18 +9121,21 @@ declare namespace Excel { readonly BuiltinDocumentProperties: Office.DocumentProperties; readonly CalculationVersion: number; CanCheckIn(): boolean; - ChangeFileAccess(Mode: XlFileAccess, WritePassword?: any, Notify?: any): void; + ChangeFileAccess(Mode: XlFileAccess.xlReadWrite, WritePassword?: string, Notify?: boolean): void; + ChangeFileAccess(Mode: XlFileAccess): void; ChangeHistoryDuration: number; - /** @param Excel.XlLinkType [Type=1] */ + /** @param Type [Type=1] */ ChangeLink(Name: string, NewName: string, Type?: XlLinkType): void; - readonly Charts: Sheets; + readonly Charts: Sheets; CheckCompatibility: boolean; - CheckIn(SaveChanges?: any, Comments?: any, MakePublic?: any): void; - CheckInWithVersion(SaveChanges?: any, Comments?: any, MakePublic?: any, VersionType?: any): void; - Close(SaveChanges?: any, Filename?: any, RouteWorkbook?: any): void; + CheckIn(SaveChanges: true, Comments?: string, MakePublic?: boolean): void; + CheckIn(SaveChanges?: any): void; + CheckInWithVersion(SaveChanges?: boolean, Comments?: any, MakePublic?: any, VersionType?: any): void; + Close(SaveChanges: true, Filename?: string, RouteWorkbook?: boolean): void; + Close(SaveChanges?: boolean, Filename?: undefined, RouteWorkbook?: boolean): void; readonly CodeName: string; - Colors(Index?: any): any; + Colors: SafeArray & ((Index: number) => number); readonly CommandBars: Office.CommandBars; Comments: string; ConflictResolution: XlSaveConflictResolution; @@ -8457,7 +9153,7 @@ declare namespace Excel { DefaultSlicerStyle: any; DefaultTableStyle: any; DeleteNumberFormat(NumberFormat: string): void; - readonly DialogSheets: Sheets; + readonly DialogSheets: Sheets; DisplayDrawingObjects: XlDisplayDrawingObjects; DisplayInkComments: boolean; readonly DocumentInspectors: Office.DocumentInspectors; @@ -8476,12 +9172,10 @@ declare namespace Excel { readonly Excel4MacroSheets: Sheets; readonly Excel8CompatibilityMode: boolean; ExclusiveAccess(): boolean; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FileFormat: XlFileFormat; Final: boolean; - FollowHyperlink(Address: string, SubAddress?: any, NewWindow?: any, AddHistory?: any, ExtraInfo?: any, Method?: any, HeaderInfo?: any): void; + FollowHyperlink(Address: string, SubAddress?: string, NewWindow?: boolean, AddHistory?: undefined, ExtraInfo?: string | Office.ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; ForceFullCalculation: boolean; ForwardMailer(): void; readonly FullName: string; @@ -8493,7 +9187,7 @@ declare namespace Excel { HasRoutingSlip: boolean; readonly HasVBProject: boolean; HighlightChangesOnScreen: boolean; - HighlightChangesOptions(When?: any, Who?: any, Where?: any): void; + HighlightChangesOptions(When?: XlHighlightChangesTime, Who?: 'Everyone' | 'Everyone but me' | string, Where?: string): void; readonly HTMLProject: Office.HTMLProject; readonly IconSets: IconSets; InactiveListBorderVisible: boolean; @@ -8501,12 +9195,12 @@ declare namespace Excel { readonly IsInplace: boolean; KeepChangeHistory: boolean; Keywords: string; - LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: any, EditionRef?: any): any; - LinkSources(Type?: any): any; + LinkInfo(Name: string, LinkInfo: XlLinkInfo, Type?: XlLinkInfoType, EditionRef?: string): any; + LinkSources(Type?: XlLink): SafeArray; ListChangesOnNewSheet: boolean; LockServerFile(): void; readonly Mailer: Mailer; - MergeWorkbook(Filename: any): void; + MergeWorkbook(Filename: string): void; readonly Modules: Sheets; readonly MultiUserEditing: boolean; readonly Name: string; @@ -8515,7 +9209,7 @@ declare namespace Excel { OnSave: string; OnSheetActivate: string; OnSheetDeactivate: string; - OpenLinks(Name: string, ReadOnly?: any, Type?: any): void; + OpenLinks(Name: string, ReadOnly?: boolean, Type?: XlLink): void; readonly Parent: any; Password: string; readonly PasswordEncryptionAlgorithm: string; @@ -8527,19 +9221,18 @@ declare namespace Excel { PersonalViewListSettings: boolean; PersonalViewPrintSettings: boolean; PivotCaches(): PivotCaches; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): void; - Post(DestName?: any): void; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + Post(): void; PrecisionAsDisplayed: boolean; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect(Password?: any, Structure?: any, Windows?: any): void; - ProtectSharing(Filename?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, SharingPassword?: any, FileFormat?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, Structure?: boolean, Windows?: boolean): void; + ProtectSharing(Filename?: string, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, SharingPassword?: string, FileFormat?: any): void; readonly ProtectStructure: boolean; readonly ProtectWindows: boolean; readonly PublishObjects: PublishObjects; - PurgeChangeHistoryNow(Days: number, SharingPassword?: any): void; + PurgeChangeHistoryNow(Days: number, SharingPassword?: string): void; readonly ReadOnly: boolean; ReadOnlyRecommended: boolean; RecheckSmartTags(): void; @@ -8551,7 +9244,7 @@ declare namespace Excel { RemoveUser(Index: number): void; Reply(): void; ReplyAll(): void; - ReplyWithChanges(ShowMessage?: any): void; + ReplyWithChanges(ShowMessage?: boolean): void; readonly Research: Research; ResetColors(): void; readonly RevisionNumber: number; @@ -8561,25 +9254,27 @@ declare namespace Excel { RunAutoMacros(Which: XlRunAutoMacro): void; Save(): void; - /** @param Excel.XlSaveAsAccessMode [AccessMode=1] */ - SaveAs( - Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, - ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; + /** @param AccessMode [AccessMode=1] */ + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AccessMode?: XlSaveAsAccessMode, ConflictResolution?: XlSaveConflictResolution, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any): void; SaveAsXMLData(Filename: string, Map: XmlMap): void; - SaveCopyAs(Filename?: any): void; + SaveCopyAs(Filename: string): void; Saved: boolean; SaveLinkValues: boolean; sblt(s: string): void; - SendFaxOverInternet(Recipients?: any, Subject?: any, ShowMessage?: any): void; - SendForReview(Recipients?: any, Subject?: any, ShowMessage?: any, IncludeAttachment?: any): void; - SendMail(Recipients: any, Subject?: any, ReturnReceipt?: any): void; + SendFaxOverInternet(Recipients?: string, Subject?: string, ShowMessage?: boolean): void; + SendForReview(Recipients?: string, Subject?: string, ShowMessage?: boolean, IncludeAttachment?: boolean): void; + SendMail(Recipients: string | SafeArray, Subject?: string, ReturnReceipt?: boolean): void; - /** @param Excel.XlPriority [Priority=-4143] */ + /** + * Macintosh only + * + * @param Priority [Priority=-4143] + */ SendMailer(FileFormat: any, Priority?: XlPriority): void; readonly ServerPolicy: Office.ServerPolicy; readonly ServerViewableItems: ServerViewableItems; - SetLinkOnData(Name: string, Procedure?: any): void; - SetPasswordEncryptionOptions(PasswordEncryptionProvider?: any, PasswordEncryptionAlgorithm?: any, PasswordEncryptionKeyLength?: any, PasswordEncryptionFileProperties?: any): void; + SetLinkOnData(Name: string, Procedure?: string): void; + SetPasswordEncryptionOptions(PasswordEncryptionProvider?: string, PasswordEncryptionAlgorithm?: string, PasswordEncryptionKeyLength?: number, PasswordEncryptionFileProperties?: boolean): void; readonly SharedWorkspace: Office.SharedWorkspace; readonly Sheets: Sheets; ShowConflictHistory: boolean; @@ -8597,25 +9292,25 @@ declare namespace Excel { readonly Theme: Office.OfficeTheme; Title: string; ToggleFormsDesign(): void; - Unprotect(Password?: any): void; - UnprotectSharing(SharingPassword?: any): void; + Unprotect(Password?: string): void; + UnprotectSharing(SharingPassword?: string): void; UpdateFromFile(): void; - UpdateLink(Name?: any, Type?: any): void; + UpdateLink(Name?: string, Type?: XlLinkType): void; UpdateLinks: XlUpdateLinks; UpdateRemoteReferences: boolean; UserControl: boolean; - readonly UserStatus: any; + readonly UserStatus: SafeArray; readonly VBASigned: boolean; readonly VBProject: VBIDE.VBProject; readonly WebOptions: WebOptions; WebPagePreview(): void; readonly Windows: Windows; - readonly Worksheets: Sheets; + readonly Worksheets: Sheets; WritePassword: string; readonly WriteReserved: boolean; readonly WriteReservedBy: string; - XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; - XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: any, Destination?: any): XlXmlImportResult; + XmlImport(Url: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; + XmlImportXml(Data: string, ImportMap: XmlMap, Overwrite?: boolean, Destination?: any): XlXmlImportResult; readonly XmlMaps: XmlMaps; readonly XmlNamespaces: XmlNamespaces; } @@ -8637,25 +9332,16 @@ declare namespace Excel { readonly Type: XlConnectionType; } - class Workbooks { - private 'Excel.Workbooks_typekey': Workbooks; - private constructor(); - - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - __OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; + interface Workbooks { + /** @param TextQualifier [TextQualifier=1] */ + __OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any): void; _Default(Index: any): Workbook; - _Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; + _Open(Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - _OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; + /** @param TextQualifier [TextQualifier=1] */ + _OpenText(Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any): void; _OpenXML(Filename: string, Stylesheets?: any): Workbook; - Add(Template?: any): Workbook; + Add(Template?: string | XlWBATemplate): Workbook; readonly Application: Application; CanCheckOut(Filename: string): boolean; CheckOut(Filename: string): void; @@ -8663,18 +9349,21 @@ declare namespace Excel { readonly Count: number; readonly Creator: XlCreator; Item(Index: number | string): Workbook; - Open( - Filename: string, UpdateLinks?: any, ReadOnly?: any, Format?: any, Password?: any, WriteResPassword?: any, IgnoreReadOnlyRecommended?: any, Origin?: any, - Delimiter?: any, Editable?: any, Notify?: any, Converter?: any, AddToMru?: any, Local?: any, CorruptLoad?: any): Workbook; - OpenDatabase(Filename: string, CommandText?: any, CommandType?: any, BackgroundQuery?: any, ImportDataAs?: any): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 1 | 2 | 3 | 4 | 5, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: undefined, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + Open(Filename: string, UpdateLinks?: 0 | 3, ReadOnly?: boolean, Format?: 6, Password?: string, WriteResPassword?: string, IgnoreReadOnlyRecommended?: boolean, Origin?: XlPlatform, Delimiter?: string, Editable?: boolean, Notify?: boolean, Converter?: number, AddToMru?: boolean, Local?: boolean, CorruptLoad?: XlCorruptLoad): Workbook; + OpenDatabase(Filename: string, CommandText?: string, CommandType?: XlCmdType, BackgroundQuery?: boolean, ImportDataAs?: XlImportDataAs): Workbook; - /** @param Excel.XlTextQualifier [TextQualifier=1] */ - OpenText( - Filename: string, Origin: any, StartRow: any, DataType: any, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: any, Tab?: any, Semicolon?: any, - Comma?: any, Space?: any, Other?: any, OtherChar?: any, FieldInfo?: any, TextVisualLayout?: any, DecimalSeparator?: any, ThousandsSeparator?: any, - TrailingMinusNumbers?: any, Local?: any): void; - OpenXML(Filename: string, Stylesheets?: any, LoadOption?: any): Workbook; + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: true, OtherChar?: string, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType.xlDelimited, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: boolean, Tab?: boolean, Semicolon?: boolean, Comma?: boolean, Space?: boolean, Other?: boolean, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + + /** @param TextQualifier [TextQualifier=1] */ + OpenText(Filename: string, Origin: XlPlatform, StartRow: number, DataType: XlTextParsingType, TextQualifier?: XlTextQualifier, ConsecutiveDelimiter?: undefined, Tab?: undefined, Semicolon?: undefined, Comma?: undefined, Space?: undefined, Other?: undefined, OtherChar?: undefined, FieldInfo?: SafeArray, TextVisualLayout?: any, DecimalSeparator?: string, ThousandsSeparator?: string, TrailingMinusNumbers?: boolean, Local?: boolean): void; + OpenXML(Filename: string, Stylesheets?: string | SafeArray, LoadOption?: XlXmlLoadOption): Workbook; readonly Parent: any; + (Index: number | string): Workbook; } class Worksheet { @@ -8688,9 +9377,7 @@ declare namespace Excel { _PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any): void; _PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any): void; _Protect(Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any): void; - _SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any): void; + _SaveAs(Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, TextVisualLayout?: any): void; Activate(): void; readonly Application: Application; Arcs(Index?: any): any; @@ -8699,9 +9386,10 @@ declare namespace Excel { Buttons(Index?: any): any; Calculate(): void; readonly Cells: Range; - ChartObjects(Index?: any): any; + ChartObjects(Index?: SafeArray): ChartObjects; + ChartObjects(Index: string | number): ChartObject; CheckBoxes(Index?: any): any; - CheckSpelling(CustomDictionary?: any, IgnoreUppercase?: any, AlwaysSuggest?: any, SpellLang?: any): void; + CheckSpelling(CustomDictionary?: string, IgnoreUppercase?: boolean, AlwaysSuggest?: boolean, SpellLang?: Office.MsoLanguageID): void; CircleInvalid(): void; readonly CircularReference: Range; ClearArrows(): void; @@ -8710,9 +9398,10 @@ declare namespace Excel { readonly Columns: Range; readonly Comments: Comments; readonly ConsolidationFunction: XlConsolidationFunction; - readonly ConsolidationOptions: any; - readonly ConsolidationSources: any; - Copy(Before?: any, After?: any): void; + readonly ConsolidationOptions: SafeArray; + readonly ConsolidationSources: SafeArray | undefined; + Copy(Before?: Sheet): void; + Copy(Before: undefined, After: Sheet): void; readonly Creator: XlCreator; readonly CustomProperties: CustomProperties; Delete(): void; @@ -8728,10 +9417,8 @@ declare namespace Excel { EnableOutlining: boolean; EnablePivotTable: boolean; EnableSelection: XlEnableSelection; - Evaluate(Name: any): any; - ExportAsFixedFormat( - Type: XlFixedFormatType, Filename?: any, Quality?: any, IncludeDocProperties?: any, IgnorePrintAreas?: any, From?: any, To?: any, OpenAfterPublish?: any, - FixedFormatExtClassPtr?: any): void; + Evaluate(Name: string): any; + ExportAsFixedFormat(Type: XlFixedFormatType, Filename?: string, Quality?: XlFixedFormatQuality, IncludeDocProperties?: boolean, IgnorePrintAreas?: boolean, From?: number, To?: number, OpenAfterPublish?: boolean, FixedFormatExtClassPtr?: any): void; readonly FilterMode: boolean; GroupBoxes(Index?: any): any; GroupObjects(Index?: any): any; @@ -8743,11 +9430,12 @@ declare namespace Excel { ListBoxes(Index?: any): any; readonly ListObjects: ListObjects; readonly MailEnvelope: Office.MsoEnvelope; - Move(Before?: any, After?: any): void; + Move(Before?: Sheet, After?: Sheet): void; Name: string; readonly Names: Names; - readonly Next: any; - OLEObjects(Index?: any): any; + readonly Next: Worksheet; + OLEObjects(Index: number | string): OLEObject; + OLEObjects(): OLEObjects; OnCalculate: string; OnData: string; OnDoubleClick: string; @@ -8759,21 +9447,18 @@ declare namespace Excel { Ovals(Index?: any): any; readonly PageSetup: PageSetup; readonly Parent: any; - Paste(Destination?: any, Link?: any): void; - PasteSpecial(Format?: any, Link?: any, DisplayAsIcon?: any, IconFileName?: any, IconIndex?: any, IconLabel?: any, NoHTMLFormatting?: any): void; + Paste(Destination?: Range, Link?: boolean): void; + PasteSpecial(Format: string | undefined, Link: boolean | undefined, DisplayAsIcon: true, IconFileName?: string, IconIndex?: number, IconLabel?: string, NoHTMLFormatting?: boolean): void; + PasteSpecial(Format?: string, Link?: boolean, DisplayAsIcon?: boolean, IconFileName?: undefined, IconIndex?: undefined, IconLabel?: undefined, NoHTMLFormatting?: boolean): void; Pictures(Index?: any): any; PivotTables(Index?: any): any; - PivotTableWizard( - SourceType?: any, SourceData?: any, TableDestination?: any, TableName?: any, RowGrand?: any, ColumnGrand?: any, SaveData?: any, HasAutoFormat?: any, - AutoPage?: any, Reserved?: any, BackgroundQuery?: any, OptimizeCache?: any, PageFieldOrder?: any, PageFieldWrapCount?: any, ReadData?: any, Connection?: any): PivotTable; - readonly Previous: any; + PivotTableWizard(): void; + PivotTableWizard(SourceType: TSourceType, SourceData: PivotTableWizardSourceData, TableDestination?: Range, TableName?: string, RowGrand?: boolean, ColumnGrand?: boolean, SaveData?: boolean, HasAutoFormat?: boolean, AutoPage?: PivotTableWizardAutoPage, Reserved?: undefined, BackgroundQuery?: boolean, OptimizeCache?: boolean, PageFieldOrder?: XlOrder, PageFieldWrapCount?: number, ReadData?: boolean, Connection?: string): void; + readonly Previous: Worksheet; readonly PrintedCommentPages: number; - PrintOut(From?: any, To?: any, Copies?: any, Preview?: any, ActivePrinter?: any, PrintToFile?: any, Collate?: any, PrToFileName?: any, IgnorePrintAreas?: any): void; - PrintPreview(EnableChanges?: any): void; - Protect( - Password?: any, DrawingObjects?: any, Contents?: any, Scenarios?: any, UserInterfaceOnly?: any, AllowFormattingCells?: any, AllowFormattingColumns?: any, - AllowFormattingRows?: any, AllowInsertingColumns?: any, AllowInsertingRows?: any, AllowInsertingHyperlinks?: any, AllowDeletingColumns?: any, - AllowDeletingRows?: any, AllowSorting?: any, AllowFiltering?: any, AllowUsingPivotTables?: any): void; + PrintOut(From?: number, To?: number, Copies?: number, Preview?: boolean, ActivePrinter?: string, PrintToFile?: T, Collate?: boolean, PrToFileName?: PrintToFileName, IgnorePrintAreas?: boolean): void; + PrintPreview(EnableChanges?: boolean): void; + Protect(Password?: string, DrawingObjects?: boolean, Contents?: boolean, Scenarios?: boolean, UserInterfaceOnly?: boolean, AllowFormattingCells?: boolean, AllowFormattingColumns?: boolean, AllowFormattingRows?: boolean, AllowInsertingColumns?: boolean, AllowInsertingRows?: boolean, AllowInsertingHyperlinks?: boolean, AllowDeletingColumns?: boolean, AllowDeletingRows?: boolean, AllowSorting?: boolean, AllowFiltering?: boolean, AllowUsingPivotTables?: boolean): void; readonly ProtectContents: boolean; readonly ProtectDrawingObjects: boolean; readonly Protection: Protection; @@ -8784,14 +9469,13 @@ declare namespace Excel { Rectangles(Index?: any): any; ResetAllPageBreaks(): void; readonly Rows: Range; - SaveAs( - Filename: string, FileFormat?: any, Password?: any, WriteResPassword?: any, ReadOnlyRecommended?: any, CreateBackup?: any, AddToMru?: any, TextCodepage?: any, - TextVisualLayout?: any, Local?: any): void; - Scenarios(Index?: any): any; + SaveAs(Filename: string, FileFormat?: XlFileFormat, Password?: string, WriteResPassword?: string, ReadOnlyRecommended?: boolean, CreateBackup?: boolean, AddToMru?: boolean, TextCodepage?: any, TextVisualLayout?: any, Local?: boolean): void; + Scenarios(Index: number | string): Scenario; + Scenarios(Index?: SafeArray): Scenarios; readonly Scripts: Office.Scripts; ScrollArea: string; ScrollBars(Index?: any): any; - Select(Replace?: any): void; + Select(Replace?: boolean): void; SetBackgroundPicture(Filename: string): void; readonly Shapes: Shapes; ShowAllData(): void; @@ -8806,54 +9490,36 @@ declare namespace Excel { TransitionExpEval: boolean; TransitionFormEntry: boolean; readonly Type: XlSheetType; - Unprotect(Password?: any): void; + Unprotect(Password?: string): void; readonly UsedRange: Range; Visible: XlSheetVisibility; readonly VPageBreaks: VPageBreaks; - XmlDataQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; - XmlMapQuery(XPath: string, SelectionNamespaces?: any, Map?: any): Range; + XmlDataQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range | null; + XmlMapQuery(XPath: string, SelectionNamespaces?: string, Map?: XmlMap): Range; } class WorksheetFunction { private 'Excel.WorksheetFunction_typekey': WorksheetFunction; private constructor(); - _WSFunction( - Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + _WSFunction(Arg1?: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; AccrInt(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AccrIntM(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; Acos(Arg1: number): number; Acosh(Arg1: number): number; - Aggregate( - Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Aggregate(Arg1: number, Arg2: number, Arg3: Range, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AmorDegrc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; AmorLinc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7?: any): number; - And( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + And(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Application: Application; Asc(Arg1: string): string; Asin(Arg1: number): number; Asinh(Arg1: number): number; Atan2(Arg1: number, Arg2: number): number; Atanh(Arg1: number): number; - AveDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Average( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + AveDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Average(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; AverageIf(Arg1: Range, Arg2: any, Arg3?: any): number; - AverageIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + AverageIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; BahtText(Arg1: number): string; BesselI(Arg1: any, Arg2: any): number; BesselJ(Arg1: any, Arg2: any): number; @@ -8879,10 +9545,7 @@ declare namespace Excel { ChiSq_Inv_RT(Arg1: number, Arg2: number): number; ChiSq_Test(Arg1: any, Arg2: any): number; ChiTest(Arg1: any, Arg2: any): number; - Choose( - Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Choose(Arg1: any, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Clean(Arg1: string): string; Combin(Arg1: number, Arg2: number): number; Complex(Arg1: any, Arg2: any, Arg3?: any): string; @@ -8892,20 +9555,11 @@ declare namespace Excel { Convert(Arg1: any, Arg2: any, Arg3: any): number; Correl(Arg1: any, Arg2: any): number; Cosh(Arg1: number): number; - Count( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - CountA( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Count(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountA(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CountBlank(Arg1: Range): number; CountIf(Arg1: Range, Arg2: string | number): number; - CountIfs( - Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + CountIfs(Arg1: Range, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; CoupDayBs(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDays(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; CoupDaysNc(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): number; @@ -8931,10 +9585,7 @@ declare namespace Excel { Dec2Oct(Arg1: any, Arg2?: any): string; Degrees(Arg1: number): number; Delta(Arg1: any, Arg2?: any): number; - DevSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + DevSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; DGet(Arg1: Range, Arg2: any, Arg3: any): any; Disc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; DMax(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8946,10 +9597,7 @@ declare namespace Excel { DStDev(Arg1: Range, Arg2: any, Arg3: any): number; DStDevP(Arg1: Range, Arg2: any, Arg3: any): number; DSum(Arg1: Range, Arg2: any, Arg3: any): number; - Dummy19( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Dummy19(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; Dummy21(Arg1: number, Arg2: number): number; Duration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; DVar(Arg1: Range, Arg2: any, Arg3: any): number; @@ -8991,20 +9639,11 @@ declare namespace Excel { GammaInv(Arg1: number, Arg2: number, Arg3: number): number; GammaLn(Arg1: number): number; GammaLn_Precise(Arg1: number): number; - Gcd( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - GeoMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Gcd(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + GeoMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; GeStep(Arg1: any, Arg2?: any): number; Growth(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; - HarMean( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + HarMean(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Hex2Bin(Arg1: any, Arg2?: any): string; Hex2Dec(Arg1: any): string; Hex2Oct(Arg1: any, Arg2?: any): string; @@ -9023,18 +9662,12 @@ declare namespace Excel { ImLog10(Arg1: any): string; ImLog2(Arg1: any): string; ImPower(Arg1: any, Arg2: any): string; - ImProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; ImReal(Arg1: any): number; ImSin(Arg1: any): string; ImSqrt(Arg1: any): string; ImSub(Arg1: any, Arg2: any): string; - ImSum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; + ImSum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): string; Index(Arg1: any, Arg2: number, Arg3?: any, Arg4?: any): any; Intercept(Arg1: any, Arg2: any): number; IntRate(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; @@ -9052,15 +9685,9 @@ declare namespace Excel { Ispmt(Arg1: number, Arg2: number, Arg3: number, Arg4: number): number; IsText(Arg1: any): boolean; IsThaiDigit(Arg1: string): boolean; - Kurt( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Kurt(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Large(Arg1: any, Arg2: number): number; - Lcm( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Lcm(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; LinEst(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any): any; Ln(Arg1: number): number; Log(Arg1: number, Arg2?: any): number; @@ -9072,40 +9699,19 @@ declare namespace Excel { LogNormDist(Arg1: number, Arg2: number, Arg3: number): number; Lookup(Arg1: any, Arg2: any, Arg3?: any): any; Match(Arg1: any, Arg2: any, Arg3?: any): number; - Max( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Max(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MDeterm(Arg1: any): number; MDuration(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; - Median( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Min( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Median(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Min(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MInverse(Arg1: any): any; MIrr(Arg1: any, Arg2: number, Arg3: number): number; MMult(Arg1: any, Arg2: any): any; - Mode( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Mode_Mult( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; - Mode_Sngl( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Mode_Mult(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): any; + Mode_Sngl(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; MRound(Arg1: any, Arg2: any): number; - MultiNomial( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + MultiNomial(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; NegBinom_Dist(Arg1: number, Arg2: number, Arg3: number, Arg4: boolean): number; NegBinomDist(Arg1: number, Arg2: number, Arg3: number): number; NetworkDays(Arg1: any, Arg2: any, Arg3?: any): number; @@ -9120,10 +9726,7 @@ declare namespace Excel { NormSDist(Arg1: number): number; NormSInv(Arg1: number): number; NPer(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; - Npv( - Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Npv(Arg1: number, Arg2: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Oct2Bin(Arg1: any, Arg2?: any): string; Oct2Dec(Arg1: any): string; Oct2Hex(Arg1: any, Arg2?: any): string; @@ -9132,10 +9735,7 @@ declare namespace Excel { OddFYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8: any, Arg9?: any): number; OddLPrice(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; OddLYield(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6: any, Arg7: any, Arg8?: any): number; - Or( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; + Or(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): boolean; readonly Parent: any; Pearson(Arg1: any, Arg2: any): number; Percentile(Arg1: any, Arg2: number): number; @@ -9156,10 +9756,7 @@ declare namespace Excel { PriceDisc(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5?: any): number; PriceMat(Arg1: any, Arg2: any, Arg3: any, Arg4: any, Arg5: any, Arg6?: any): number; Prob(Arg1: any, Arg2: any, Arg3: number, Arg4?: any): number; - Product( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Product(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Proper(Arg1: string): string; Pv(Arg1: number, Arg2: number, Arg3: number, Arg4?: any, Arg5?: any): number; Quartile(Arg1: any, Arg2: number): number; @@ -9183,62 +9780,29 @@ declare namespace Excel { RoundDown(Arg1: number, Arg2: number): number; RoundUp(Arg1: number, Arg2: number): number; RSq(Arg1: any, Arg2: any): number; - RTD( - progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, - topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, - topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; + RTD(progID: any, server: any, topic1: any, topic2?: any, topic3?: any, topic4?: any, topic5?: any, topic6?: any, topic7?: any, topic8?: any, topic9?: any, topic10?: any, topic11?: any, topic12?: any, topic13?: any, topic14?: any, topic15?: any, topic16?: any, topic17?: any, topic18?: any, topic19?: any, topic20?: any, topic21?: any, topic22?: any, topic23?: any, topic24?: any, topic25?: any, topic26?: any, topic27?: any, topic28?: any): any; Search(Arg1: string, Arg2: string, Arg3?: any): number; SearchB(Arg1: string, Arg2: string, Arg3?: any): number; SeriesSum(Arg1: any, Arg2: any, Arg3: any, Arg4: any): number; Sinh(Arg1: number): number; - Skew( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Skew(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Sln(Arg1: number, Arg2: number, Arg3: number): number; Slope(Arg1: any, Arg2: any): number; Small(Arg1: any, Arg2: number): number; SqrtPi(Arg1: any): number; Standardize(Arg1: number, Arg2: number, Arg3: number): number; - StDev( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDev_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - StDevP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDev_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + StDevP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; StEyx(Arg1: any, Arg2: any): number; Substitute(Arg1: string, Arg2: string, Arg3: string, Arg4?: any): string; - Subtotal( - Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Sum( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Subtotal(Arg1: number, Arg2: Range, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Sum(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumIf(Arg1: Range, Arg2: any, Arg3?: any): number; - SumIfs( - Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, - Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, - Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; - SumProduct( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - SumSq( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumIfs(Arg1: Range, Arg2: Range, Arg3: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any): number; + SumProduct(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + SumSq(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; SumX2MY2(Arg1: any, Arg2: any): number; SumX2PY2(Arg1: any, Arg2: any): number; SumXMY2(Arg1: any, Arg2: any): number; @@ -9269,22 +9833,10 @@ declare namespace Excel { TrimMean(Arg1: any, Arg2: number): number; TTest(Arg1: any, Arg2: any, Arg3: number, Arg4: number): number; USDollar(Arg1: number, Arg2: number): string; - Var( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_P( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - Var_S( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; - VarP( - Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, - Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, - Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_P(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + Var_S(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; + VarP(Arg1: any, Arg2?: any, Arg3?: any, Arg4?: any, Arg5?: any, Arg6?: any, Arg7?: any, Arg8?: any, Arg9?: any, Arg10?: any, Arg11?: any, Arg12?: any, Arg13?: any, Arg14?: any, Arg15?: any, Arg16?: any, Arg17?: any, Arg18?: any, Arg19?: any, Arg20?: any, Arg21?: any, Arg22?: any, Arg23?: any, Arg24?: any, Arg25?: any, Arg26?: any, Arg27?: any, Arg28?: any, Arg29?: any, Arg30?: any): number; Vdb(Arg1: number, Arg2: number, Arg3: number, Arg4: number, Arg5: number, Arg6?: any, Arg7?: any): number; VLookup(Arg1: any, Arg2: any, Arg3: any, Arg4?: any): any; Weekday(Arg1: any, Arg2?: any): number; @@ -9302,6 +9854,20 @@ declare namespace Excel { ZTest(Arg1: any, Arg2: number, Arg3?: any): number; } + class WorksheetView { + private 'Excel.WorksheetView_typekey': WorksheetView; + private constructor(); + readonly Application: Application; + readonly Creator: XlCreator; + DisplayFormulas: boolean; + DisplayGridlines: boolean; + DisplayHeadings: boolean; + DisplayOutline: boolean; + DisplayZeros: boolean; + readonly Parent: any; + readonly Sheet: Worksheet; + } + class XmlDataBinding { private 'Excel.XmlDataBinding_typekey': XmlDataBinding; private constructor(); @@ -9325,10 +9891,10 @@ declare namespace Excel { readonly Creator: XlCreator; readonly DataBinding: XmlDataBinding; Delete(): void; - Export(Url: string, Overwrite?: any): XlXmlExportResult; + Export(Url: string, Overwrite?: boolean): XlXmlExportResult; ExportXml(Data: string): XlXmlExportResult; - Import(Url: string, Overwrite?: any): XlXmlImportResult; - ImportXml(XmlData: string, Overwrite?: any): XlXmlImportResult; + Import(Url: string, Overwrite?: boolean): XlXmlImportResult; + ImportXml(XmlData: string, Overwrite?: boolean): XlXmlImportResult; readonly IsExportable: boolean; Name: string; readonly Parent: any; @@ -9342,16 +9908,15 @@ declare namespace Excel { readonly WorkbookConnection: WorkbookConnection; } - class XmlMaps { - private 'Excel.XmlMaps_typekey': XmlMaps; - private constructor(); + interface XmlMaps { _Default(Index: any): XmlMap; - Add(Schema: string, RootElementName?: any): XmlMap; + Add(Schema: string, RootElementName?: string): XmlMap; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlMap; + Item(Index: number | string): XmlMap; readonly Parent: any; + (Index: number | string): XmlMap; } class XmlNamespace { @@ -9365,17 +9930,16 @@ declare namespace Excel { readonly Uri: string; } - class XmlNamespaces { - private 'Excel.XmlNamespaces_typekey': XmlNamespaces; - private constructor(); + interface XmlNamespaces { _Default(Index: any): XmlNamespace; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - InstallManifest(Path: string, InstallForAllUsers?: any): void; - Item(Index: any): XmlNamespace; + InstallManifest(Path: string, InstallForAllUsers?: boolean): void; + Item(Index: number | string): XmlNamespace; readonly Parent: any; readonly Value: string; + (Index: number | string): XmlNamespace; } class XmlSchema { @@ -9389,15 +9953,14 @@ declare namespace Excel { readonly XML: string; } - class XmlSchemas { - private 'Excel.XmlSchemas_typekey': XmlSchemas; - private constructor(); + interface XmlSchemas { _Default(Index: any): XmlSchema; readonly Application: Application; readonly Count: number; readonly Creator: XlCreator; - Item(Index: any): XmlSchema; + Item(Index: number | string): XmlSchema; readonly Parent: any; + (Index: number | string): XmlSchema; } class XPath { @@ -9410,7 +9973,7 @@ declare namespace Excel { readonly Map: XmlMap; readonly Parent: any; readonly Repeating: boolean; - SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: any): void; + SetValue(Map: XmlMap, XPath: string, SelectionNamespace?: any, Repeating?: boolean): void; readonly Value: string; } @@ -9495,223 +10058,100 @@ declare namespace Excel { } } +interface EnumeratorConstructor { + // we need this because there are two overloads for Item on the Sheets object + new (sheets: Excel.Sheets): Enumerator; +} + interface ActiveXObject { - on( - obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Application, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Application, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Application, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Application, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Application, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: ( - this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; - on( - obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', - argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', - argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'Invoke', argNames: Excel.EventHelperTypes.Application_Invoke_ArgNames, handler: (this: Excel.Application, parameter: Excel.EventHelperTypes.Application_Invoke_Parameter) => void): void; + on(obj: Excel.Application, event: 'NewWorkbook' | 'WorkbookActivate' | 'WorkbookAddinInstall' | 'WorkbookAddinUninstall' | 'WorkbookDeactivate' | 'WorkbookOpen', argNames: ['Wb'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowActivate' | 'ProtectedViewWindowDeactivate' | 'ProtectedViewWindowOpen' | 'ProtectedViewWindowResize', argNames: ['Pvw'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeClose', argNames: ['Pvw', 'Reason', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, readonly Reason: Excel.XlProtectedViewCloseReason, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'ProtectedViewWindowBeforeEdit', argNames: ['Pvw', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Pvw: Excel.ProtectedViewWindow, Cancel: boolean }) => void): void; on(obj: Excel.Application, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Application, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Application, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Application, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: any }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], - handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: ( - this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; - on( - obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Application, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Application, event: 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Application, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wb', 'Wn'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Wn: Excel.Window }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterSave', argNames: ['Wb', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlExport', argNames: ['Wb', 'Map', 'Url', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookAfterXmlImport', argNames: ['Wb', 'Map', 'IsRefresh', 'Result'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeClose' | 'WorkbookBeforePrint', argNames: ['Wb', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeSave', argNames: ['Wb', 'SaveAsUI', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlExport', argNames: ['Wb', 'Map', 'Url', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookBeforeXmlImport', argNames: ['Wb', 'Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewChart', argNames: ['Wb', 'Ch'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Ch: Excel.Chart }) => void): void; + on(obj: Excel.Application, event: 'WorkbookNewSheet', argNames: ['Wb', 'Sh'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Sh: Excel.Worksheet }) => void): void; + on(obj: Excel.Application, event: 'WorkbookPivotTableCloseConnection' | 'WorkbookPivotTableOpenConnection', argNames: ['Wb', 'Target'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Application, event: 'WorkbookRowsetComplete', argNames: ['Wb', 'Description', 'Sheet', 'Success'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Application, event: 'WorkbookSync', argNames: ['Wb', 'SyncEventType'], handler: (this: Excel.Application, parameter: { readonly Wb: Excel.Workbook, readonly SyncEventType: Office.MsoSyncEventType }) => void): void; + on(obj: Excel.Chart, event: 'BeforeDoubleClick', argNames: ['ElementID', 'Arg1', 'Arg2', 'Cancel'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number, Cancel: boolean }) => void): void; on(obj: Excel.Chart, event: 'BeforeRightClick', argNames: ['Cancel'], handler: (this: Excel.Chart, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Chart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Chart, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Chart, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Chart, parameter: { pctinfo: number }) => void): void; on(obj: Excel.Chart, event: 'Invoke', argNames: Excel.EventHelperTypes.Chart_Invoke_ArgNames, handler: (this: Excel.Chart, parameter: Excel.EventHelperTypes.Chart_Invoke_Parameter) => void): void; - on( - obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: ( - this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; + on(obj: Excel.Chart, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'x', 'y'], handler: (this: Excel.Chart, parameter: { readonly Button: number, readonly Shift: number, readonly x: number, readonly y: number }) => void): void; on(obj: Excel.Chart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Chart, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: ( - this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; - on( - obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: ( - this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Chart, event: 'Select', argNames: ['ElementID', 'Arg1', 'Arg2'], handler: (this: Excel.Chart, parameter: { readonly ElementID: number, readonly Arg1: number, readonly Arg2: number }) => void): void; + on(obj: Excel.Chart, event: 'SeriesChange', argNames: ['SeriesIndex', 'PointIndex'], handler: (this: Excel.Chart, parameter: { readonly SeriesIndex: number, readonly PointIndex: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.OLEObject, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.OLEObject, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.OLEObject, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.OLEObject, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: ( - this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; + on(obj: Excel.OLEObject, event: 'Invoke', argNames: Excel.EventHelperTypes.OLEObject_Invoke_ArgNames, handler: (this: Excel.OLEObject, parameter: Excel.EventHelperTypes.OLEObject_Invoke_Parameter) => void): void; on(obj: Excel.OLEObject, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.OLEObject, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'AfterRefresh', argNames: ['Success'], handler: (this: Excel.QueryTable, parameter: { readonly Success: boolean }) => void): void; on(obj: Excel.QueryTable, event: 'BeforeRefresh', argNames: ['Cancel'], handler: (this: Excel.QueryTable, parameter: { Cancel: boolean }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.QueryTable, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.QueryTable, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.QueryTable, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.QueryTable, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.QueryTable, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: ( - this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; + on(obj: Excel.QueryTable, event: 'Invoke', argNames: Excel.EventHelperTypes.QueryTable_Invoke_ArgNames, handler: (this: Excel.QueryTable, parameter: Excel.EventHelperTypes.QueryTable_Invoke_Parameter) => void): void; on(obj: Excel.QueryTable, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.QueryTable, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Workbook, event: 'AfterSave', argNames: ['Success'], handler: (this: Excel.Workbook, parameter: { readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; - on( - obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlExport', argNames: ['Map', 'Url', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly Result: Excel.XlXmlExportResult }) => void): void; + on(obj: Excel.Workbook, event: 'AfterXmlImport', argNames: ['Map', 'IsRefresh', 'Result'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly IsRefresh: boolean, readonly Result: Excel.XlXmlImportResult }) => void): void; on(obj: Excel.Workbook, event: 'BeforeClose' | 'BeforePrint', argNames: ['Cancel'], handler: (this: Excel.Workbook, parameter: { Cancel: boolean }) => void): void; on(obj: Excel.Workbook, event: 'BeforeSave', argNames: ['SaveAsUI', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly SaveAsUI: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlExport', argNames: ['Map', 'Url', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'BeforeXmlImport', argNames: ['Map', 'Url', 'IsRefresh', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Map: Excel.XmlMap, readonly Url: string, readonly IsRefresh: boolean, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Workbook, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Workbook, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Workbook, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Workbook, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: ( - this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; + on(obj: Excel.Workbook, event: 'Invoke', argNames: Excel.EventHelperTypes.Workbook_Invoke_ArgNames, handler: (this: Excel.Workbook, parameter: Excel.EventHelperTypes.Workbook_Invoke_Parameter) => void): void; on(obj: Excel.Workbook, event: 'NewChart', argNames: ['Ch'], handler: (this: Excel.Workbook, parameter: { readonly Ch: Excel.Chart }) => void): void; - on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any }) => void): void; - on( - obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'NewSheet' | 'SheetActivate' | 'SheetCalculate' | 'SheetDeactivate', argNames: ['Sh'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Chart | Excel.Worksheet }) => void): void; + on(obj: Excel.Workbook, event: 'PivotTableCloseConnection' | 'PivotTableOpenConnection', argNames: ['Target'], handler: (this: Excel.Workbook, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Workbook, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; - on( - obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: ( - this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Range }) => void): void; - on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', - argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Workbook, - parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on( - obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: ( - this: Excel.Workbook, parameter: { readonly Sh: any, readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Workbook, event: 'RowsetComplete', argNames: ['Description', 'Sheet', 'Success'], handler: (this: Excel.Workbook, parameter: { readonly Description: string, readonly Sheet: string, readonly Success: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetBeforeDoubleClick' | 'SheetBeforeRightClick', argNames: ['Sh', 'Target', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetChange' | 'SheetSelectionChange', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetFollowHyperlink', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.Hyperlink }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableAfterValueChange', argNames: ['Sh', 'TargetPivotTable', 'TargetRange'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeAllocateChanges' | 'SheetPivotTableBeforeCommitChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableBeforeDiscardChanges', argNames: ['Sh', 'TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Workbook, parameter: { readonly Sh: any, readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Workbook, event: 'SheetPivotTableChangeSync' | 'SheetPivotTableUpdate', argNames: ['Sh', 'Target'], handler: (this: Excel.Workbook, parameter: { readonly Sh: Excel.Worksheet, readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Workbook, event: 'Sync', argNames: ['SyncEventType'], handler: (this: Excel.Workbook, parameter: { readonly SyncEventType: Office.MsoSyncEventType }) => void): void; on(obj: Excel.Workbook, event: 'WindowActivate' | 'WindowDeactivate' | 'WindowResize', argNames: ['Wn'], handler: (this: Excel.Workbook, parameter: { readonly Wn: Excel.Window }) => void): void; - on( - obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'BeforeDoubleClick' | 'BeforeRightClick', argNames: ['Target', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range, Cancel: boolean }) => void): void; on(obj: Excel.Worksheet, event: 'Change' | 'SelectionChange', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Range }) => void): void; on(obj: Excel.Worksheet, event: 'FollowHyperlink', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.Hyperlink }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; + on(obj: Excel.Worksheet, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number }) => void): void; + on(obj: Excel.Worksheet, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Excel.Worksheet, parameter: { readonly itinfo: number, readonly lcid: number, pptinfo: undefined }) => void): void; on(obj: Excel.Worksheet, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Excel.Worksheet, parameter: { pctinfo: number }) => void): void; - on( - obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: ( - this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', - argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: ( - this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; - on( - obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], - handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; - on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: ( - this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; + on(obj: Excel.Worksheet, event: 'Invoke', argNames: Excel.EventHelperTypes.Worksheet_Invoke_ArgNames, handler: (this: Excel.Worksheet, parameter: Excel.EventHelperTypes.Worksheet_Invoke_Parameter) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableAfterValueChange', argNames: ['TargetPivotTable', 'TargetRange'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly TargetRange: Excel.Range }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeAllocateChanges' | 'PivotTableBeforeCommitChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd', 'Cancel'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number, Cancel: boolean }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableBeforeDiscardChanges', argNames: ['TargetPivotTable', 'ValueChangeStart', 'ValueChangeEnd'], handler: (this: Excel.Worksheet, parameter: { readonly TargetPivotTable: Excel.PivotTable, readonly ValueChangeStart: number, readonly ValueChangeEnd: number }) => void): void; + on(obj: Excel.Worksheet, event: 'PivotTableChangeSync' | 'PivotTableUpdate', argNames: ['Target'], handler: (this: Excel.Worksheet, parameter: { readonly Target: Excel.PivotTable }) => void): void; on(obj: Excel.Worksheet, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Excel.Worksheet, parameter: { readonly riid: stdole.GUID, ppvObj: undefined }) => void): void; on(obj: Excel.Application, event: 'AddRef' | 'AfterCalculate' | 'Release', handler: (this: Excel.Application, parameter: {}) => void): void; on(obj: Excel.Chart, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'DragOver' | 'DragPlot' | 'Release' | 'Resize', handler: (this: Excel.Chart, parameter: {}) => void): void; @@ -9719,10 +10159,13 @@ interface ActiveXObject { on(obj: Excel.QueryTable, event: 'AddRef' | 'Release', handler: (this: Excel.QueryTable, parameter: {}) => void): void; on(obj: Excel.Workbook, event: 'Activate' | 'AddinInstall' | 'AddinUninstall' | 'AddRef' | 'Deactivate' | 'Open' | 'Release', handler: (this: Excel.Workbook, parameter: {}) => void): void; on(obj: Excel.Worksheet, event: 'Activate' | 'AddRef' | 'Calculate' | 'Deactivate' | 'Release', handler: (this: Excel.Worksheet, parameter: {}) => void): void; - set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [any, any], newValue: any): void; - set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [any], newValue: any): void; + set(obj: Excel.Chart, propertyName: 'HasAxis', parameterTypes: [Excel.XlAxisType | undefined, Excel.XlAxisGroup | undefined], newValue: boolean): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: [number], newValue: string): void; + set(obj: Excel.ControlFormat, propertyName: 'List', parameterTypes: never[], newValue: SafeArray): void; + set(obj: Excel.PageSetup, propertyName: 'PrintQuality', parameterTypes: [number], newValue: number): void; + set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [number], newValue: number): void; set(obj: Excel.Range, propertyName: 'Value', parameterTypes: [Excel.XlRangeValueDataType], newValue: any): void; - set(obj: Excel.Range, propertyName: 'Value', newValue: any): void; // because Value is defined on the type as a method, not a property + set(obj: Excel.PivotField, propertyName: 'Subtotals', parameterTypes: [Excel.PivotFieldSubtotal], newValue: boolean): void; } interface ActiveXObjectNameMap { @@ -9730,57 +10173,3 @@ interface ActiveXObjectNameMap { 'Excel.Chart': Excel.Chart; 'Excel.Sheet': Excel.Worksheet; } - -interface EnumeratorConstructor { - new(col: Excel.Range): Enumerator; - - new(col: Excel.GroupShapes | Excel.ShapeRange | Excel.Shapes): Enumerator; - new(col: Excel.HPageBreaks): Enumerator; - new(col: Excel.Hyperlinks): Enumerator; - new(col: Excel.IconSet): Enumerator; - new(col: Excel.ListColumns): Enumerator; - new(col: Excel.ListObjects): Enumerator; - new(col: Excel.ListRows): Enumerator; - new(col: Excel.MenuBars): Enumerator; - new(col: Excel.Menus): Enumerator; - new(col: Excel.Names): Enumerator; - new(col: Excel.ODBCErrors): Enumerator; - new(col: Excel.OLEDBErrors): Enumerator; - new(col: Excel.Pages): Enumerator; - new(col: Excel.Parameters): Enumerator; - new(col: Excel.PivotCaches): Enumerator; - new(col: Excel.PivotFilters): Enumerator; - new(col: Excel.PivotFormulas): Enumerator; - new(col: Excel.PivotLineCells): Enumerator; - new(col: Excel.PivotLines): Enumerator; - new(col: Excel.PivotTableChangeList): Enumerator; - new(col: Excel.ProtectedViewWindows): Enumerator; - new(col: Excel.PublishObjects): Enumerator; - new(col: Excel.QueryTables): Enumerator; - new(col: Excel.RecentFiles): Enumerator; - new(col: Excel.Sheets): Enumerator; - new(col: Excel.ShapeNodes): Enumerator; - new(col: Excel.SlicerCacheLevels): Enumerator; - new(col: Excel.SlicerCaches): Enumerator; - new(col: Excel.SlicerItems): Enumerator; - new(col: Excel.SlicerPivotTables): Enumerator; - new(col: Excel.Slicers): Enumerator; - new(col: Excel.SmartTagActions): Enumerator; - new(col: Excel.SmartTagRecognizers): Enumerator; - new(col: Excel.SortFields): Enumerator; - new(col: Excel.SparklineGroup): Enumerator; - new(col: Excel.SparklineGroups): Enumerator; - new(col: Excel.Styles): Enumerator; - new(col: Excel.TableStyleElements): Enumerator; - new(col: Excel.TableStyles): Enumerator; - new(col: Excel.ToolbarButtons): Enumerator; - new(col: Excel.Toolbars): Enumerator; - new(col: Excel.UserAccessList): Enumerator; - new(col: Excel.VPageBreaks): Enumerator; - new(col: Excel.Watches): Enumerator; - new(col: Excel.Windows): Enumerator; - new(col: Excel.Workbooks): Enumerator; - new(col: Excel.XmlMaps): Enumerator; - new(col: Excel.XmlNamespaces): Enumerator; - new(col: Excel.XmlSchemas): Enumerator; -} diff --git a/types/activex-excel/tslint.json b/types/activex-excel/tslint.json index f93cf8562a..7b89accc6d 100644 --- a/types/activex-excel/tslint.json +++ b/types/activex-excel/tslint.json @@ -1,3 +1,7 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false, + "max-line-length": false + } } diff --git a/types/activex-interop/index.d.ts b/types/activex-interop/index.d.ts index 3bb13a5351..d59b315fcb 100644 --- a/types/activex-interop/index.d.ts +++ b/types/activex-interop/index.d.ts @@ -51,7 +51,6 @@ interface Enumerator { interface EnumeratorConstructor { new (collection: { Item(index: any): T }): Enumerator; - // new (collection: any): Enumerator; } declare var Enumerator: EnumeratorConstructor; diff --git a/types/activex-office/index.d.ts b/types/activex-office/index.d.ts index 18a7dd285d..6df01eb16e 100644 --- a/types/activex-office/index.d.ts +++ b/types/activex-office/index.d.ts @@ -10,6 +10,8 @@ declare namespace Office { type MsoRGBType = number; + type ByteArray = SafeArray; + const enum BackstageGroupStyle { BackstageGroupStyleError = 2, BackstageGroupStyleNormal = 0, diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index 2b316d80bd..4789c10e19 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -5886,7 +5886,3 @@ interface EnumeratorConstructor { new(col: Outlook.Reminders): Enumerator; new(col: Outlook.Views): Enumerator; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/adone/index.d.ts b/types/adone/index.d.ts index c6add2eeea..521bdf6e03 100644 --- a/types/adone/index.d.ts +++ b/types/adone/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/ciferox/adone // Definitions by: am , Maximus // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 /// /// diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index a7031d2ef8..8e0e8b9fb6 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -3,107 +3,104 @@ import { Db, Server } from "mongodb"; var mongoConnectionString = "mongodb://127.0.0.1/agenda"; -var agenda = new Agenda({ db: { address: mongoConnectionString } }); +(async () => { + var agenda = new Agenda({ db: { address: mongoConnectionString } }); -agenda.define<{ foo: Error }>('delete old users', (job, done) => { - done(job.attrs.data.foo) + agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) + }); + + agenda.on('ready', () => { + agenda.every('3 minutes', 'delete old users'); + + // Alternatively, you could also do: + agenda.every('*/3 * * * *', 'delete old users'); + + agenda.start(); + }); + + agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { + }); + + agenda.on('ready', () => { + agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); + agenda.start(); + }); + + agenda.on('ready', () => { + var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); + weeklyReport.repeatEvery('1 week').save(); + agenda.start(); + }); + + var agenda = new Agenda({ processEvery: '30 seconds' }); + + agenda.defaultConcurrency(5); + + var agenda = new Agenda({ defaultConcurrency: 5 }); + + agenda.lockLimit(0); + + var agenda = new Agenda({ lockLimit: 0 }); + + agenda.defaultLockLimit(0); + + var agenda = new Agenda({ defaultLockLimit: 0 }); + + agenda.defaultLockLifetime(10000); + + var agenda = new Agenda({ defaultLockLifetime: 10000 }); + + agenda.define('some long running job', function (job, done) { + done(); + }); + + agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); + + agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); + + agenda.now('do the hokey pokey'); + + var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); + await job.save(); + + const jobs = await agenda.jobs({ name: 'printAnalyticsReport' }); + jobs.forEach((job) => { + job.save(); + }); + + let numRemoved = await agenda.cancel({ name: 'printAnalyticsReport' }); + + numRemoved = await agenda.purge(); + + await agenda.stop(); + + await job.agenda.now('do the hokey pokey'); + + job.repeatEvery('10 minutes'); + + job.repeatEvery('10 minutes', { timezone: 'America/New_York' }); + + job.repeatEvery('10 minutes', { skipImmediate: true }); + + job.repeatAt('3:30pm'); + + job.schedule('tomorrow at 6pm'); + + job.priority('low'); + job.priority(10); + + job.unique({ 'data.type': 'active', 'data.userId': '123' }); + job.fail('insuficient disk space'); + job.fail(new Error('insufficient disk space')); + const job2 = await job.run(); + await job.remove(); }); -agenda.on('ready', () => { - agenda.every('3 minutes', 'delete old users'); - - // Alternatively, you could also do: - agenda.every('*/3 * * * *', 'delete old users'); - - agenda.start(); -}); - -agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => { -}); - -agenda.on('ready', () => { - agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' }); - agenda.start(); -}); - -agenda.on('ready', () => { - var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' }); - weeklyReport.repeatEvery('1 week').save(); - agenda.start(); -}); - -var agenda = new Agenda({ processEvery: '30 seconds' }); - -agenda.defaultConcurrency(5); - -var agenda = new Agenda({ defaultConcurrency: 5 }); - -agenda.lockLimit(0); - -var agenda = new Agenda({ lockLimit: 0 }); - -agenda.defaultLockLimit(0); - -var agenda = new Agenda({ defaultLockLimit: 0 }); - -agenda.defaultLockLifetime(10000); - -var agenda = new Agenda({ defaultLockLifetime: 10000 }); - -agenda.define('some long running job', function(job, done) { - done(); -}); - -agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 }); - -agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']); - -agenda.now('do the hokey pokey'); - -var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); -job.save(function(err) { - console.log("Job successfully saved"); -}); - -agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) { - // Work with jobs (see below) -}); - -agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) { -}); - -agenda.purge(function(err, numRemoved) { -}); - -agenda.stop(function() { - process.exit(0); -}); - -job.agenda.now('do the hokey pokey'); - -job.repeatEvery('10 minutes'); - -job.repeatAt('3:30pm'); - -job.schedule('tomorrow at 6pm'); - -job.priority('low'); -job.priority(10); - -job.unique({ 'data.type': 'active', 'data.userId': '123' }); -job.fail('insuficient disk space'); -job.fail(new Error('insufficient disk space')); -job.run(function(err, job) { - console.log("I don't know why you would need to do this..."); -}); -job.remove(function(err) { - if (!err) console.log("Successfully removed job from collection"); -}) - class ExtendedAgenda extends Agenda { - async start() { } + async start() { } } const extendedAgenda: ExtendedAgenda = new ExtendedAgenda() diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index b29158983d..206d40daf3 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Agenda v1.0.3 +// Type definitions for Agenda v2.0.0 // Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb // Jeff Principe @@ -95,16 +95,14 @@ declare class Agenda extends EventEmitter { /** * Find all Jobs matching `query` and pass same back in cb(). * @param query - * @param cb */ - jobs(query: any, cb: ResultCallback[]>): void; + jobs(query: any): Promise[]>; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want * to remove old jobs. - * @param cb Called with the number of jobs removed. */ - purge(cb?: ResultCallback): void; + purge(): Promise; /** * Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done). @@ -123,46 +121,41 @@ declare class Agenda extends EventEmitter { * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param options An optional argument that will be passed to job.repeatEvery. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; - every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any): Promise>; + every(interval: number | string, names: string[], data?: T, options?: any): Promise[]>; /** * Schedules a job to run name once at a given time. * @param when A Date or a String such as tomorrow at 5pm. * @param names The name or names of the job(s) to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; - schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T): Promise>; + schedule(when: Date | string, names: string[], data?: T): Promise[]>; /** * Schedules a job to run name once immediately. * @param name The name of the job to run. * @param data An optional argument that will be passed to the processing function under job.attrs.data. - * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; + now(name: string, data?: T): Promise>; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. * @param query Mongodb native query. - * @param cb Called with the number of jobs removed. */ - cancel(query: any, cb?: ResultCallback): void; + cancel(query: any): Promise; /** * Starts the job queue processing, checking processEvery time to see if there are new jobs. */ - start(): void; + start(): Promise; /** * Stops the job queue processing. Unlocks currently running jobs. - * @param cb Called after the job processing queue shuts down and unlocks all jobs. */ - stop(cb: Callback): void; + stop(): Promise; } declare namespace Agenda { @@ -350,57 +343,57 @@ declare namespace Agenda { /** * Specifies an interval on which the job should repeat. * @param interval A human-readable format String, a cron format String, or a Number. - * @param options An optional argument that can include a timezone field. The timezone should be a string as - * accepted by moment-timezone and is considered when using an interval in the cron string format. + * @param options An optional argument that can include a timezone field or skipImmediate field. + * The timezone should be a string as accepted by moment-timezone and is considered when using an interval in the cron string format. + * Setting skipImmediate as true will skip the immediate run. The first run will occur only in configured interval. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string, skipImmediate?: boolean }): this /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): this /** * Disables the job. */ - disable(): Job; + disable(): this; /** * Enables the job. */ - enable(): Job; + enable(): this; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): this; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): this; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): this; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): this; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually - * @param cb Called when the job is completed. */ - run(cb?: ResultCallback>): Job; + run(): Promise; /** * Returns true if the job is running; otherwise, returns false. @@ -409,27 +402,24 @@ declare namespace Agenda { /** * Saves the job into the database. - * @param cb Called when the job is saved. */ - save(cb?: ResultCallback>): Job; + save(): Promise; /** * Removes the job from the database and cancels the job. - * @param cb Called after the job has beeb removed from the database. */ - remove(cb?: Callback): void; + remove(): Promise; /** * Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running * jobs. - * @param cb Called after the job has been saved to the database. */ - touch(cb?: Callback): void; + touch(): Promise; /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): this; } interface JobOptions { diff --git a/types/agent-base/agent-base-tests.ts b/types/agent-base/agent-base-tests.ts new file mode 100644 index 0000000000..116ff8af96 --- /dev/null +++ b/types/agent-base/agent-base-tests.ts @@ -0,0 +1,23 @@ +import agent = require('agent-base'); + +agent(); // $ExpectType Agent +agent({ timeout: 1000 }); // $ExpectType Agent + +agent((req, opts) => {}); // $ExpectType Agent +agent((req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(async (req, opts) => {}); // $ExpectType Agent +agent(async (req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent + +agent(0); // $ExpectError +agent(1); // $ExpectError +agent(''); // $ExpectError +agent(true); // $ExpectError +agent(null); // $ExpectError + +agent((req, opts) => {}, 0); // $ExpectError +agent((req, opts) => {}, 1); // $ExpectError +agent((req, opts) => {}, ''); // $ExpectError +agent((req, opts) => {}, true); // $ExpectError +agent((req, opts) => {}, null); // $ExpectError +agent((req, opts) => {}, (req, opts) => {}); // $ExpectError diff --git a/types/agent-base/index.d.ts b/types/agent-base/index.d.ts new file mode 100644 index 0000000000..0b1e4d3018 --- /dev/null +++ b/types/agent-base/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for agent-base 4.2 +// Project: https://github.com/TooTallNate/node-agent-base#readme +// Definitions by: Christopher Quadflieg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { EventEmitter } from 'events'; + +declare namespace Agent { + type AgentCallback = ( + req?: any, + opts?: { + secureEndpoint: boolean; + } + ) => void; + + interface AgentOptions { + timeout?: number; + host?: string; + port?: number; + [key: string]: any; + } + + interface Agent extends EventEmitter { + _promisifiedCallback: boolean; + timeout: number | null; + options?: AgentOptions; + callback: AgentCallback; + addRequest: (req?: any, opts?: any) => void; + freeSocket: (socket: any, opts: any) => void; + } +} + +/** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + */ +declare function Agent(opts?: Agent.AgentOptions): Agent.Agent; +declare function Agent( + callback: Agent.AgentCallback, + opts?: Agent.AgentOptions +): Agent.Agent; + +export = Agent; diff --git a/types/agent-base/tsconfig.json b/types/agent-base/tsconfig.json new file mode 100644 index 0000000000..dc6db21f70 --- /dev/null +++ b/types/agent-base/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "agent-base-tests.ts" + ] +} diff --git a/types/meteor-univserse-i18n/tslint.json b/types/agent-base/tslint.json similarity index 100% rename from types/meteor-univserse-i18n/tslint.json rename to types/agent-base/tslint.json diff --git a/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts new file mode 100644 index 0000000000..bfa00378db --- /dev/null +++ b/types/agora-rtc-sdk/agora-rtc-sdk-tests.ts @@ -0,0 +1,27 @@ +let client = AgoraRTC.createClient({ + mode: 'live', + codec: 'vp8' +}); + +let stream = AgoraRTC.createStream({ + video: true, + audio: true, + streamID: 21230, + screen: false +}); + +client.init('74a0b7bb5d3e47c7abca0533d17b0afa', () => { + client.join('74a0b7bb5d3e47c7abca0533d17b0afa', 'testyy', 21230, uid => { + stream.init(() => { + client.publish(stream, err => { + throw(err); + }); + }, err => { + throw(err); + }); + }, err => { + throw(err); + }); +}, err => { + throw(err); +}); diff --git a/types/agora-rtc-sdk/index.d.ts b/types/agora-rtc-sdk/index.d.ts new file mode 100644 index 0000000000..d70385d639 --- /dev/null +++ b/types/agora-rtc-sdk/index.d.ts @@ -0,0 +1,314 @@ +// Type definitions for agora-rtc-sdk 2.3 +// Project: https://github.com/AgoraIO/web-archive#readme +// Definitions by: Menthays +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/*~ If this module is a UMD module that exposes a global variable 'myLib' when + *~ loaded outside a module loader environment, declare that global here. + *~ Otherwise, delete this declaration. + */ +export as namespace AgoraRTC; + +/*~ If this module has methods, declare them as functions like so. + */ +export function createClient(config: ClientConfig): Client; +export function createStream(spec: StreamSpec): Stream; +export function checkSystemRequirements(): boolean; +export function getDevices(callback: (devices: any[]) => void): void; + +/*~ You can declare types that are available via importing the module */ +export interface ClientConfig { + mode: 'live' | 'rtc'; + codec: 'vp8' | 'h264'; + proxyServer?: string; + turnServer?: { + turnServerURL: string; + username: string; + password: string; + udpport: string; + tcpport: string; + forceturn: boolean; + }; +} + +export interface StreamSpec { + streamID: number; + audio: boolean; + video: boolean; + screen: boolean; + cameraId?: string; + microphoneId?: string; + mirror?: boolean; + extensionid?: string; + mediaSource?: 'screen' | 'application' | 'window'; + audioProcessing?: { + AGC: boolean; + }; + attributes?: { + resolution: string; + minFrameRate: number; + maxFrameRate: number; + }; +} + +export interface LocalStreamStats { + audioSendBytes: string; + audioSendPackets: string; + videoSendBytes: string; + videoSendPackets: string; + videoSendPacketsLost: string; + videoSendFrameRate: string; + videoSendBandwidth: string; + videoSendResolutionWidth?: string; + videoSendResolutionHeight?: string; + audioCodecName: string; + videoCodecName: string; + timestamp: string; + startTime: string; + duration: string; +} + +export interface RemoteStreamStats { + audioReceiveBytes: string; + audioReceivePackets: string; + audioReceivePacketsLost: string; + videoReceiveBytes: string; + videoReceivePackets: string; + videoReceivePacketsLost: string; + videoReceiveFrameRate?: string; + videoReceiveDecodeFrameRate?: string; + videoReceiveBandwidth?: string; + videoReceivedResolutionWidth?: string; + videoReceivedResolutionHeight?: string; + timestamp: string; + startTime: string; + duration: string; +} + +export type VideoProfile = + | '120p' + | '120p_1' + | '120p_3' + | '180p' + | '180p_1' + | '180p_3' + | '180p_4' + | '240p' + | '240p_1' + | '240p_3' + | '240p_4' + | '360p' + | '360p_1' + | '360p_3' + | '360p_4' + | '360p_6' + | '360p_7' + | '360p_8' + | '360p_9' + | '360p_10' + | '360p_11' + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type FirefoxVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6'; + +export type SafariVideoProfile = + | '480p' + | '480p_1' + | '480p_2' + | '480p_3' + | '480p_4' + | '480p_6' + | '480p_8' + | '480p_9' + | '480p_10' + | '720p' + | '720p_1' + | '720p_2' + | '720p_3' + | '720p_5' + | '720p_6' + | '1080p' + | '1080p_1' + | '1080p_2' + | '1080p_3' + | '1080p_5' + | '1440p' + | '1440p_1' + | '1440p_2' + | '4K' + | '4K_1' + | '4K_3'; + +export type ScreenSharingProfile = + | '480p_1' + | '480p_2' + | '720p_1' + | '720p_2' + | '1080p_1' + | '1080p_2'; + +export type ClientEvent = + | 'stream-published' + | 'stream-added' + | 'stream-removed' + | 'stream-subscribed' + | 'peer-leave' + | 'mute-audio' + | 'unmute-audio' + | 'mute-video' + | 'unmute-video' + | 'client-banned' + | 'active-speaker' + | 'error'; + +export interface Stream { + getStats( + callback: (stats: LocalStreamStats | RemoteStreamStats) => void + ): void; + init(onSuccess: () => void, onFailure: (err: any) => void): void; + getId(): number; + getAttributes(): any; + getAudioLevel(): number; + hasVideo(): boolean; + hasAudio(): boolean; + enableVideo(): void; + disableVideo(): void; + enableAudio(): void; + disableAudio(): void; + setVideoProfile( + profile: + | VideoProfile + | FirefoxVideoProfile + | SafariVideoProfile + | ScreenSharingProfile + ): void; + play(HTMLElementID: string): void; + stop(): void; + close(): void; +} + +export interface Client { + on(eventName: ClientEvent, callback: (evt: any) => void): void; + init( + appId: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + join( + tokenOrKey: string, + channel: string, + uid: number, + onSuccess: (uid: number) => void, + onFailure: (err: any) => void + ): void; + renewChannelKey( + key: string, + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + enableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + setRemoteVideoStreamType(stream: Stream, streamType: 0 | 1): void; + setLowStreamParameter(param: { + width: number; + height: number; + framerate: number; + birate: number; + }): void; + disableDualStream( + onSuccess: () => void, + onFailure: (err: any) => void + ): void; + leave(onSuccess: () => void, onFailure: (err: any) => void): void; + publish(stream: Stream, onFailure: (err: any) => void): void; + unpublish(stream: Stream, onFailure: (err: any) => void): void; + subscribe(stream: Stream, onFailure: (err: any) => void): void; + unsubscribe(stream: Stream, onFailure: (err: any) => void): void; + setProxyServer(proxyServer: ClientConfig['proxyServer']): void; + setTurnServer(turnServer: ClientConfig['turnServer']): void; + setEncryptionSecret(password: string): void; + setEncryptionMode( + encryptionMode: 'aes-128-xts' | 'aes-256-xts' | 'aes-128-ecb' + ): void; +} + +/*~ You can declare properties of the module using const, let, or var */ +export const VERSION: string; + +export const AUDIO_SAMPLE_RATE_32000: 32000; +export const AUDIO_SAMPLE_RATE_44100: 44100; +export const AUDIO_SAMPLE_RATE_48000: 48000; + +export const VIDEO_CODEC_PROFILE_BASELINE: 66; +export const VIDEO_CODEC_PROFILE_MAIN: 77; +export const VIDEO_CODEC_PROFILE_HIGH: 100; + +export const REMOTE_VIDEO_STREAM_HIGH: 0; +export const REMOTE_VIDEO_STREAM_LOW: 1; +export const REMOTE_VIDEO_STREAM_MEDIUM: 2; +/*~ If there are types, properties, or methods inside dotted names + *~ of the module, declare them inside a 'namespace'. + */ +export namespace Logger { + /*~ For example, given this definition, someone could write: + *~ import { subProp } from 'yourModule'; + *~ subProp.foo(); + *~ or + *~ import * as yourMod from 'yourModule'; + *~ yourMod.subProp.foo(); + */ + type DEBUG = 0; + type INFO = 1; + type WARNING = 2; + type ERROR = 3; + type NONE = 4; + function setLogLevel(level: DEBUG|INFO|WARNING|NONE): void; + function log(args: any): void; + function debug(args: any): void; + function info(args: any): void; + function warning(args: any): void; + function error(args: any): void; +} diff --git a/types/agora-rtc-sdk/tsconfig.json b/types/agora-rtc-sdk/tsconfig.json new file mode 100644 index 0000000000..8d3d2c118b --- /dev/null +++ b/types/agora-rtc-sdk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "agora-rtc-sdk-tests.ts" + ] +} diff --git a/types/react-native-navigation/tslint.json b/types/agora-rtc-sdk/tslint.json similarity index 100% rename from types/react-native-navigation/tslint.json rename to types/agora-rtc-sdk/tslint.json diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index b2890573ce..0c2d244b05 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -764,6 +764,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } /** * Interface describing options available for gettings the logs @@ -1771,6 +1776,14 @@ declare namespace algoliasearch { facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; } interface MultiResponse { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index a567a917a8..4f068d5647 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -4,6 +4,7 @@ // Haroen Viaene // Aurélien Hervé // Samuel Vaillant +// Claas Brüggemann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -180,6 +181,11 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#client-options */ hosts?: { read?: string[]; write?: string[] }; + /** + * enable the experimental feature: caching requests instead of responses + * see https://github.com/algolia/algoliasearch-client-javascript/pull/694 + */ + _useRequestCache?: boolean } interface BrowseResponse { cursor?: string; @@ -565,6 +571,14 @@ declare namespace algoliasearch { facets?: { [facetName: string]: { [facetValue: string]: number }; }; + facets_stats?: { + [facetName: string]: { + avg: number, + max: number, + min: number, + sum: number, + }; + }; } interface MultiResponse { diff --git a/types/almost-equal/almost-equal-tests.ts b/types/almost-equal/almost-equal-tests.ts new file mode 100644 index 0000000000..398017e7ec --- /dev/null +++ b/types/almost-equal/almost-equal-tests.ts @@ -0,0 +1,7 @@ +import * as almostEqual from 'almost-equal'; + +const res1 = almostEqual(1.999999, 2.0); + +const res2 = almostEqual(1.999999, 2.0, almostEqual.DBL_EPSILON); + +const res3 = almostEqual(1.999999, 2.0, almostEqual.FLT_EPSILON, almostEqual.FLT_EPSILON); diff --git a/types/almost-equal/index.d.ts b/types/almost-equal/index.d.ts new file mode 100644 index 0000000000..cacbaa4886 --- /dev/null +++ b/types/almost-equal/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for almost-equal 1.1 +// Project: https://github.com/mikolalysenko/almost-equal#readme +// Definitions by: Curtis Maddalozzo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function almostEqual(value: number, other: number, absoluteTolerance?: number, relativeTolerance?: number): boolean; +declare namespace almostEqual { + const FLT_EPSILON: number; + const DBL_EPSILON: number; +} +export = almostEqual; diff --git a/types/meteor-univserse-i18n/tsconfig.json b/types/almost-equal/tsconfig.json similarity index 91% rename from types/meteor-univserse-i18n/tsconfig.json rename to types/almost-equal/tsconfig.json index 7beab3bd30..a4a61b092b 100644 --- a/types/meteor-univserse-i18n/tsconfig.json +++ b/types/almost-equal/tsconfig.json @@ -7,17 +7,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], + "strictFunctionTypes": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "meteor-univserse-i18n-tests.ts" + "almost-equal-tests.ts" ] } diff --git a/types/react-svg/tslint.json b/types/almost-equal/tslint.json similarity index 100% rename from types/react-svg/tslint.json rename to types/almost-equal/tslint.json diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 0c69e4020a..9094642e70 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/goatslacker/alt // Definitions by: Michael Shearer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts index 1e17bc8507..983c1f993b 100644 --- a/types/amp/amp-tests.ts +++ b/types/amp/amp-tests.ts @@ -32,7 +32,7 @@ new Stream({ highWaterMark: 1, decodeStrings: true, objectMode: true, - destroy: (error?: Error) => { + destroy: (error: Error | null) => { return 'handle error'; }, final: (callback: (error?: Error) => void) => { diff --git a/types/amqp-connection-manager/amqp-connection-manager-tests.ts b/types/amqp-connection-manager/amqp-connection-manager-tests.ts new file mode 100644 index 0000000000..6eae738a3c --- /dev/null +++ b/types/amqp-connection-manager/amqp-connection-manager-tests.ts @@ -0,0 +1,25 @@ +import * as amqp from "amqplib"; +import * as amqpConMgr from 'amqp-connection-manager'; + +// from README.md +const connection = amqpConMgr.connect(['amqp://localhost']); +const channelWrapper: amqpConMgr.ChannelWrapper = connection.createChannel({ + json: true, + setup: async (channel: amqp.ConfirmChannel): Promise => { + // `channel` here is a regular amqplib `ConfirmChannel`. Unfortunately its typings make it return a bluebird-specific promise + // tslint:disable-next-line:await-promise + await channel.assertQueue('rxQueueName', {durable: true}); + } +}); + +connection.on("connect", (_arg: { connection: amqp.Connection, url: string }): void => undefined); +connection.on("disconnect", (_arg: { err: Error }): void => undefined); + +channelWrapper.on("close", () => undefined); +channelWrapper.on("connect", () => undefined); +channelWrapper.on("error", (_error: Error) => undefined); + +channelWrapper.sendToQueue("foo", Buffer.from("bar")) + .catch((error: Error): void => { + // nothing + }); diff --git a/types/amqp-connection-manager/index.d.ts b/types/amqp-connection-manager/index.d.ts new file mode 100644 index 0000000000..ab69aadeb1 --- /dev/null +++ b/types/amqp-connection-manager/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for amqp-connection-manager 2.0 +// Project: https://github.com/benbria/node-amqp-connection-manager +// Definitions by: rogierschouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ConfirmChannel, Connection, Message, Options, Replies } from "amqplib"; +import { EventEmitter } from "events"; +import { SecureContextOptions } from "tls"; + +/** + * connect() options + */ +export interface AmqpConnectionManagerOptions { + /** + * Interval to send heartbeats to broker. Defaults to 5 seconds. + */ + heartbeatIntervalInSeconds?: number; + + /** + * The time to wait before trying to reconnect. If not specified, defaults to heartbeatIntervalInSeconds + */ + reconnectTimeInSeconds?: number; + + /** + * is a function which returns one or more servers to connect to. This should return either a single URL or an array of URLs. + * This is handy when you're using a service discovery mechanism such as Consul or etcd. Instead of taking a callback, this can also + * return a Promise. Note that if this is supplied, then urls is ignored. + */ + findServers?: ((callback: (urls: string | string[]) => void) => void) | (() => Promise); + + /** + * TLS options + */ + connectionOptions?: SecureContextOptions; +} + +/** + * Creates a new AmqpConnectionManager, which will connect to one of the URLs provided in urls. + * If a broker is unreachable or dies, then AmqpConnectionManager will try the next available broker, round-robin. + * @param urls + * @param options + */ +export function connect(urls: string[], options?: AmqpConnectionManagerOptions): AmqpConnectionManager; + +export type SetupFunc = ((channel: ConfirmChannel, callback: (error?: Error) => void) => void) | ((channel: ConfirmChannel) => Promise); + +export interface CreateChannelOpts { + /** + * Name for this channel. Used for debugging. + */ + name?: string; + /** + * A function to call whenever we reconnect to the broker (and therefore create a new underlying channel.) + * This function should either accept a callback, or return a Promise. See addSetup below + */ + setup?: SetupFunc; + /** + * if true, then ChannelWrapper assumes all messages passed to publish() and sendToQueue() are plain JSON objects. + * These will be encoded automatically before being sent. + */ + json?: boolean; +} + +export interface AmqpConnectionManager extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + addListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + on(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + once(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this; + prependOnceListener(event: "disconnect", listener: (arg: {err: Error}) => void): this; + + /** + * Create a new ChannelWrapper. This is a proxy for the actual channel (which may or may not exist at any moment, depending on whether or not we are currently connected.) + * @param opts + */ + createChannel(opts: CreateChannelOpts): ChannelWrapper; + + /** + * Returns true if the AmqpConnectionManager is connected to a broker, false otherwise. + */ + isConnected(): boolean; + + /** + * Close this AmqpConnectionManager and free all associated resources. + */ + close(): Promise; +} + +export interface ChannelWrapper extends EventEmitter { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "error", listener: (err: Error, info: { name: string }) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "error", listener: (err: Error, info: { name: string }) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error, info: { name: string }) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + + /** + * Adds a new 'setup handler'. setup(channel, [cb]) is a function to call when a new underlying channel is created - + * handy for asserting exchanges and queues exists, and whatnot. The channel object here is a ConfirmChannel from amqplib. + * The setup function should return a Promise (or optionally take a callback) - no messages will be sent until this Promise resolves. + * If there is a connection, setup() will be run immediately, and the addSetup Promise/callback won't resolve until setup is complete. + * Note that in this case, if the setup throws an error, no 'error' event will be emitted, since you can just handle the error here + * (although the setup will still be added for future reconnects, even if it throws an error.) + * Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event. + * @param func + */ + addSetup(func: SetupFunc): Promise; + + /** + * @see amqplib + * @param exchange + * @param routingKey + * @param content + * @param options + * @param callback + */ + publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise; + + /** + * @see amqplib + * @param queue + * @param content + * @param options + * @param callback + */ + sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise; + + /** + * @see amqplib + * @param message + * @param allUpTo + */ + ack(message: Message, allUpTo?: boolean): void; + + /** + * @see amqplib + * @param message + * @param allUpTo + * @param requeue + */ + nack(message: Message, allUpTo?: boolean, requeue?: boolean): void; + + /** + * Returns a count of messages currently waiting to be sent to the underlying channel. + */ + queueLength(): number; + + /** + * Close a channel, clean up resources associated with it. + */ + close(): Promise; +} diff --git a/types/fork-ts-checker-webpack-plugin/tsconfig.json b/types/amqp-connection-manager/tsconfig.json similarity index 90% rename from types/fork-ts-checker-webpack-plugin/tsconfig.json rename to types/amqp-connection-manager/tsconfig.json index cfd6ee81db..d707bd5a65 100644 --- a/types/fork-ts-checker-webpack-plugin/tsconfig.json +++ b/types/amqp-connection-manager/tsconfig.json @@ -6,8 +6,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "fork-ts-checker-webpack-plugin-tests.ts" + "amqp-connection-manager-tests.ts" ] } diff --git a/types/amqp-connection-manager/tslint.json b/types/amqp-connection-manager/tslint.json new file mode 100644 index 0000000000..d57642e30f --- /dev/null +++ b/types/amqp-connection-manager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false, + "unified-signatures": false, + "void-return": false + } +} diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 269ed0112e..9ad6d9ceda 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/squaremo/amqp.node // Definitions by: Michael Nahkies , Ab Reitsma , Nicolás Fantone , Nick Zelei // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/angular-desktop-notification/index.d.ts b/types/angular-desktop-notification/index.d.ts index 6281396b66..2e017da49b 100644 --- a/types/angular-desktop-notification/index.d.ts +++ b/types/angular-desktop-notification/index.d.ts @@ -22,7 +22,7 @@ declare module 'angular' { * This is an experimental technology * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge */ - badge?: USVString; + badge?: string; /** * The data read-only property of the Notification interface returns a structured clone of the notification's data, @@ -40,7 +40,7 @@ declare module 'angular' { * Note: This feature is available in Web Workers. * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/image */ - image?: USVString; + image?: string; /** * The renotify read-only property of the Notification interface specifies whether the user should be notified after a diff --git a/types/angular-gettext/angular-gettext-tests.ts b/types/angular-gettext/angular-gettext-tests.ts index 766b16a963..1b1d5b6342 100644 --- a/types/angular-gettext/angular-gettext-tests.ts +++ b/types/angular-gettext/angular-gettext-tests.ts @@ -24,6 +24,8 @@ angular.module("myApp").controller("helloController", function (gettextCatalog: angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); + var myStringWithScope: string = gettextCatalog.getPlural(4, "{{color}} Bird", "{{color}} Birds", {color: 'Blue'}); + var myStringWithContext: string = gettextCatalog.getPlural(5, "pick", "picks", null, 'noun'); }); angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { diff --git a/types/angular-gettext/index.d.ts b/types/angular-gettext/index.d.ts index 107d9e10e2..6b5fe29e73 100644 --- a/types/angular-gettext/index.d.ts +++ b/types/angular-gettext/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-gettext v2.1.0 +// Type definitions for angular-gettext v2.1.1 // Project: https://angular-gettext.rocketeer.be/ // Definitions by: Ákos Lukács // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,6 +9,7 @@ import * as angular from 'angular'; +export type gettextCatalog = angular.gettext.gettextCatalog; declare module 'angular' { export namespace gettext { @@ -65,7 +66,7 @@ declare module 'angular' { getString(string: string, scope?: any, context?: string): string; /** Translate a plural string with the given context. */ - getPlural(n: number, string: string, stringPlural: string, context?: any): string; + getPlural(n: number, string: string, stringPlural: string, scope?: any, context?: string): string; /** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */ loadRemote(url: string): ng.IHttpPromise; diff --git a/types/angular-local-storage/index.d.ts b/types/angular-local-storage/index.d.ts index 76ab65b1b5..6e8c64416a 100644 --- a/types/angular-local-storage/index.d.ts +++ b/types/angular-local-storage/index.d.ts @@ -8,6 +8,10 @@ import * as angular from 'angular'; +export type ILocalStorageServiceProvider = angular.local.storage.ILocalStorageServiceProvider; +export type ILocalStorageService = angular.local.storage.ILocalStorageService; +export type ICookie = angular.local.storage.ICookie; + declare module 'angular' { export namespace local.storage { interface ILocalStorageServiceProvider extends angular.IServiceProvider { diff --git a/types/angular-mocks/angular-mocks-tests.ts b/types/angular-mocks/angular-mocks-tests.ts index cabbf7c578..662d75c079 100644 --- a/types/angular-mocks/angular-mocks-tests.ts +++ b/types/angular-mocks/angular-mocks-tests.ts @@ -1,80 +1,100 @@ - /////////////////////////////////////// // IAngularStatic /////////////////////////////////////// -var angular: ng.IAngularStatic; -var mock: ng.IMockStatic; +let angular: ng.IAngularStatic; +let mock: ng.IMockStatic; mock = angular.mock; - /////////////////////////////////////// // IMockStatic /////////////////////////////////////// -var date: Date; +let date: Date; mock.dump({ key: 'value' }); mock.inject( - function () { return 1; }, - function () { return 2; } - ); + function() { + return 1; + }, + function() { + return 2; + } +); -mock.inject( - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]); +mock.inject([ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 1; + } +]); // This overload is not documented on the website, but flows from // how the injector works. mock.inject( - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }], - ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]); + [ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 1; + } + ], + [ + '$rootScope', + function($rootScope: ng.IRootScopeService) { + return 2; + } + ] +); mock.module('module1', 'module2'); mock.module( - function () { return 1; }, - function () { return 2; } - ); -mock.module({ module1: function () { return 1; } }); + function() { + return 1; + }, + function() { + return 2; + } +); +mock.module({ + module1: () => { + return 1; + } +}); mock.module.sharedInjector(); date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); date = mock.TzDate(-8, 12345678); - /////////////////////////////////////// // IExceptionHandlerProvider /////////////////////////////////////// -var exceptionHandlerProvider: ng.IExceptionHandlerProvider; +let exceptionHandlerProvider: ng.IExceptionHandlerProvider; exceptionHandlerProvider.mode('log'); - /////////////////////////////////////// // ITimeoutService /////////////////////////////////////// -var timeoutService: ng.ITimeoutService; +let timeoutService: ng.ITimeoutService; timeoutService.flush(); timeoutService.flush(1234); -timeoutService.flushNext(); -timeoutService.flushNext(1234); timeoutService.verifyNoPendingTasks(); //////////////////////////////////////// // IIntervalService //////////////////////////////////////// -var intervalService: ng.IIntervalService; -var intervalServiceTimeActuallyAdvanced: number; +let intervalService: ng.IIntervalService; +let intervalServiceTimeActuallyAdvanced: number; -intervalServiceTimeActuallyAdvanced = intervalService.flush(); intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); /////////////////////////////////////// // ILogService, ILogCall /////////////////////////////////////// -var logService: ng.ILogService; -var logCall: ng.ILogCall; -var logs: string[]; +let logService: ng.ILogService; +let logCall: ng.ILogCall; +let logs: string[]; logService.assertEmpty(); logService.reset(); @@ -90,29 +110,31 @@ logs = logCall.logs; /////////////////////////////////////// // ControllerService mock /////////////////////////////////////// -var $controller: ng.IControllerService; -$controller(class TestController {}, {}, {myBinding: 'works!'}); -$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'}); -$controller('TestController', {}, {myBinding: 'works!'}); - +let $controller: ng.IControllerService; +$controller(class TestController {}, {}, { myBinding: 'works!' }); +$controller(function TestController() {}, { someLocal: 42 }, { myBinding: 'works!' }); +$controller('TestController', {}, { myBinding: 'works!' }); /////////////////////////////////////// // IComponentControllerService /////////////////////////////////////// -var $componentController: ng.IComponentControllerService; -$componentController<{}, {}>('Test controller', { $scope: {} }); -$componentController<{}, {}>('Test controller', { $scope: {}, test: true }); -$componentController<{}, { test: boolean }>('Test controller', { $scope: {} }, { test: true}); -$componentController<{}, { test?: boolean }>('Test controller', { $scope: {} }, {}); -$componentController<{}, {}>('Test controller', { $scope: {} }, {}, 'identity'); -$componentController<{ cb: () => void }, {}>('Test controller', { $scope: {} }); -$componentController<{}, { test: {name: string} }>('Test controller', { test: {name: 'Test Local'} }); +let $componentController: ng.IComponentControllerService; +let $scope: ng.IScope; +$componentController<{}, {}>('Test controller', { $scope }); +$componentController<{}, {}>('Test controller', { $scope, test: true }); +$componentController<{}, { test: boolean }>('Test controller', { $scope }, { test: true }); +$componentController<{}, { test?: boolean }>('Test controller', { $scope }, {}); +$componentController<{}, {}>('Test controller', { $scope }, {}, 'identity'); +$componentController<{ cb: () => void }, {}>('Test controller', { $scope }); +$componentController<{}, { test: { name: string } }>('Test controller', { + test: { name: 'Test Local' } +}); /////////////////////////////////////// // IHttpBackendService /////////////////////////////////////// -var httpBackendService: ng.IHttpBackendService; -var requestHandler: ng.mock.IRequestHandler; +let httpBackendService: ng.IHttpBackendService; +let requestHandler: ng.mock.IRequestHandler; httpBackendService.flush(); httpBackendService.flush(1234); @@ -123,342 +145,1362 @@ httpBackendService.verifyNoOutstandingRequest(); requestHandler = httpBackendService.expect('GET', 'http://test.local'); requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data'); -requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/); -requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect( + 'GET', + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.expect('GET', /test.local/); requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); -requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + 'response data', + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); -requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + /response data/, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.expect('GET', /test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expect('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect( + 'GET', + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.expect('GET', (url: string) => { + return true; +}); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data' +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + 'response data', + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/ +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + /response data/, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expect( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.expectDELETE('http://test.local'); requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectDELETE( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectGET('http://test.local'); requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectGET( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectHEAD('http://test.local'); requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); requestHandler = httpBackendService.expectHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectJSONP('http://test.local'); requestHandler = httpBackendService.expectJSONP(/test.local/); requestHandler = httpBackendService.expectJSONP(/test.local\/(\d+)/, ['id']); -requestHandler = httpBackendService.expectJSONP((url: string) => { return true; }); +requestHandler = httpBackendService.expectJSONP((url: string) => { + return true; +}); requestHandler = httpBackendService.expectPATCH('http://test.local'); requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/); -requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPATCH('http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expectPATCH( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPATCH(/test.local/); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPATCH(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPATCH( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH( + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPATCH( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST('http://test.local'); requestHandler = httpBackendService.expectPOST('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPOST('http://test.local', /response data/); -requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPOST('http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.expectPOST( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST(/test.local/); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPOST(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPOST( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPOST( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT('http://test.local'); requestHandler = httpBackendService.expectPUT('http://test.local', 'response data'); -requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.expectPUT('http://test.local', /response data/); -requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.expectPUT('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPUT( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.expectPUT(/test.local/); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPUT(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.expectPUT( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.expectPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.expectPUT( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.when('GET', 'http://test.local'); requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data'); -requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { + header: 'value' +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/); -requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when('GET', 'http://test.local', function( + data: string +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when( + 'GET', + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function( + headers: object +): boolean { + return true; +}); requestHandler = httpBackendService.when('GET', /test.local/); requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, 'response data', function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + 'response data', + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.when('GET', /test.local/, /response data/); requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, /response data/, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }, ['id']); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + /response data/, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + }, + ['id'] +); requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', /test.local\/(\d+)/, { key: 'value' }, function (headers: Object): boolean { return true; }, ['id']); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, 'response data', function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, /response data/, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.when('GET', (url: string) => { return true; }, { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when( + 'GET', + /test.local/, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function( + headers: object +): boolean { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + /test.local\/(\d+)/, + { key: 'value' }, + function(headers: object): boolean { + return true; + }, + ['id'] +); +requestHandler = httpBackendService.when('GET', (url: string) => { + return true; +}); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data' +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + 'response data', + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/ +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + /response data/, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + function(headers: object): boolean { + return true; + } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); +requestHandler = httpBackendService.when( + 'GET', + (url: string) => { + return true; + }, + { key: 'value' }, + function(headers: object): boolean { + return true; + } +); requestHandler = httpBackendService.whenDELETE('http://test.local'); requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenDELETE(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenDELETE((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenDELETE( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenGET('http://test.local'); requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenGET(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenGET((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenGET( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenHEAD('http://test.local'); requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); requestHandler = httpBackendService.whenHEAD(/test.local\/(\d+)/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenHEAD((url: string) => { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD( + (url: string) => { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenJSONP('http://test.local'); requestHandler = httpBackendService.whenJSONP(/test.local/); requestHandler = httpBackendService.whenJSONP(/test.local\/(\d+)/, ['id']); -requestHandler = httpBackendService.whenJSONP((url: string) => { return true; }); +requestHandler = httpBackendService.whenJSONP((url: string) => { + return true; +}); requestHandler = httpBackendService.whenPATCH('http://test.local'); requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/); -requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPATCH('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPATCH( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPATCH(/test.local/); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPATCH(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPATCH( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPATCH((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPATCH( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST('http://test.local'); requestHandler = httpBackendService.whenPOST('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPOST('http://test.local', /response data/); -requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPOST('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPOST( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPOST(/test.local/); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPOST(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPOST( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPOST((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPOST( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT('http://test.local'); requestHandler = httpBackendService.whenPUT('http://test.local', 'response data'); -requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { + header: 'value' +}); requestHandler = httpBackendService.whenPUT('http://test.local', /response data/); -requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { + header: 'value' +}); +requestHandler = httpBackendService.whenPUT('http://test.local', function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPUT( + 'http://test.local', + function(data: string): boolean { + return true; + }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }); -requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT( + 'http://test.local', + { key: 'value' }, + { header: 'value' } +); requestHandler = httpBackendService.whenPUT(/test.local/); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, 'response data', { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + 'response data', + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, /response data/, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, function (data: string): boolean { return true; }, { header: 'value' }, ['id']); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + /response data/, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPUT(/test.local/, function(data: string): boolean { + return true; +}); +requestHandler = httpBackendService.whenPUT( + /test.local/, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + function(data: string): boolean { + return true; + }, + { header: 'value' }, + ['id'] +); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT(/test.local\/(\d+)/, { key: 'value' }, { header: 'value' }, ['id']); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data'); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, 'response data', { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, /response data/, { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, function (data: string): boolean { return true; }, { header: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }); -requestHandler = httpBackendService.whenPUT((url: string) => { return true; }, { key: 'value' }, { header: 'value' }); - +requestHandler = httpBackendService.whenPUT( + /test.local\/(\d+)/, + { key: 'value' }, + { header: 'value' }, + ['id'] +); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}, 'response data'); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + 'response data', + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT((url: string) => { + return true; +}, /response data/); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + /response data/, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + function(data: string): boolean { + return true; + }, + { header: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + { key: 'value' } +); +requestHandler = httpBackendService.whenPUT( + (url: string) => { + return true; + }, + { key: 'value' }, + { header: 'value' } +); /////////////////////////////////////// // IRequestHandler /////////////////////////////////////// -var expectedData = { key: 'value'}; +let expectedData = { key: 'value' }; requestHandler.passThrough(); requestHandler.passThrough().passThrough(); -requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']); -requestHandler.respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']).respond({}); -requestHandler.respond((method, url, data, headers) => { return [404, { key: 'value' }, { header: 'value' }, 'responseText']; }); +requestHandler.respond((method, url, data, headers) => [ + 404, + 'data', + { header: 'value' }, + 'responseText' +]); +requestHandler + .respond((method, url, data, headers) => [404, 'data', { header: 'value' }, 'responseText']) + .respond({}); +requestHandler.respond((method, url, data, headers) => { + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; +}); requestHandler.respond((method, url, data, headers, params) => { - if(params.id === 1) { - return [200, { key: 'value'}, { header: 'value'}, 'responseText']; - } else { - return [404, { key: 'value' }, { header: 'value' }, 'responseText']; - } + if (params.id === '1') { + return [200, { key: 'value' }, { header: 'value' }, 'responseText']; + } else { + return [404, { key: 'value' }, { header: 'value' }, 'responseText']; + } }); requestHandler.respond('data'); requestHandler.respond('data').respond({}); @@ -466,8 +1508,30 @@ requestHandler.respond(expectedData); requestHandler.respond({ key: 'value' }); requestHandler.respond({ key: 'value' }, { header: 'value' }); requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText'); +requestHandler.respond(404); requestHandler.respond(404, 'data'); requestHandler.respond(404, 'data').respond({}); requestHandler.respond(404, { key: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }); requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText'); + +/////////////////////////////////////// +// IFlushPendingTasksService +/////////////////////////////////////// +let $flushPendingTasks: ng.IFlushPendingTasksService; +$flushPendingTasks(); +$flushPendingTasks(42); + +/////////////////////////////////////// +// IVerifyNoPendingTasksService +/////////////////////////////////////// +let $verifyNoPendingTasks: ng.IVerifyNoPendingTasksService; +$verifyNoPendingTasks(); +$verifyNoPendingTasks('task type'); + +/////////////////////////////////////// +// browserTrigger +/////////////////////////////////////// +browserTrigger(document.body, 'click'); +browserTrigger(angular.element(document.body), 'click'); +browserTrigger(angular.element(document.body), 'click', { which: 1, keys: ['ctrl'] }); diff --git a/types/angular-mocks/index.d.ts b/types/angular-mocks/index.d.ts index 051539e2ac..a2aa4fe29e 100644 --- a/types/angular-mocks/index.d.ts +++ b/types/angular-mocks/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.5 +// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.7 // Project: http://angularjs.org -// Definitions by: Diego Vilar , Tony Curtis +// Definitions by: Diego Vilar +// Tony Curtis +// Georgii Dolzhykov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 -/// /// import * as angular from 'angular'; @@ -13,7 +14,6 @@ import * as angular from 'angular'; // ngMock module (angular-mocks.js) /////////////////////////////////////////////////////////////////////////////// declare module 'angular' { - /////////////////////////////////////////////////////////////////////////// // AngularStatic // We reopen it to add the MockStatic definition @@ -23,27 +23,27 @@ declare module 'angular' { } // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject + // Depending on context, it might return a function, however having `void | (() => void)` + // as a return type seems to be not useful. E.g. it requires type assertions in `beforeEach(inject(...))`. interface IInjectStatic { - (...fns: Function[]): any; - (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works - strictDi(val?: boolean): void; + (...fns: Array void>>): any; // void | (() => void); + strictDi(val?: boolean): any; // void | (() => void); } interface IMockStatic { // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump dump(obj: any): string; - inject: IInjectStatic + inject: IInjectStatic; // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module module: { (...modules: any[]): any; sharedInjector(): void; - } + }; // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate - TzDate(offset: number, timestamp: number): Date; - TzDate(offset: number, timestamp: string): Date; + TzDate(offset: number, timestamp: number | string): Date; } /////////////////////////////////////////////////////////////////////////// @@ -61,8 +61,38 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { + /** + * **Deprecated** since version 1.7.3. (Use `$flushPendingTasks` instead.) + * + * --- + * Flushes the queue of pending tasks. + * + * _This method is essentially an alias of `$flushPendingTasks`._ + * + * > For historical reasons, this method will also flush non-`$timeout` pending tasks, such as + * > `$q` promises and tasks scheduled via `$applyAsync` and `$evalAsync`. + * + * @param delay - The maximum timeout amount to flush up until. + */ flush(delay?: number): void; - flushNext(expectedDelay?: number): void; + + /** + * **Deprecated** since version 1.7.3. (Use `$verifyNoPendingTasks` instead.) + * + * --- + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * _This method is essentially an alias of `$verifyNoPendingTasks` (called with no arguments)._ + * + * > For historical reasons, this method will also verify non-`$timeout` pending tasks, such as + * > pending `$http` requests, in-progress `$route` transitions, unresolved `$q` promises and + * > tasks scheduled via `$applyAsync` and `$evalAsync`. + * > + * > It is recommended to use `$verifyNoPendingTasks` instead, which additionally supports + * > verifying a specific type of tasks. For example, you can verify there are no pending + * > timeouts with `$verifyNoPendingTasks('$timeout')`. + */ verifyNoPendingTasks(): void; } @@ -72,7 +102,13 @@ declare module 'angular' { // Augments the original service /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - flush(millis?: number): number; + /** + * Runs interval tasks scheduled to be run in the next `millis` milliseconds. + * + * @param millis - The maximum timeout amount to flush up until. + * @return The amount of time moved forward. + */ + flush(millis: number): number; } /////////////////////////////////////////////////////////////////////////// @@ -96,9 +132,11 @@ declare module 'angular' { /////////////////////////////////////////////////////////////////////////// interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T; - (controllerConstructor: (...args: any[]) => T, locals?: any, bindings?: any): T; - (controllerName: string, locals?: any, bindings?: any): T; + ( + controllerConstructor: (new (...args: any[]) => T) | ((...args: any[]) => T) | string, + locals?: any, + bindings?: any + ): T; } /////////////////////////////////////////////////////////////////////////// @@ -108,268 +146,538 @@ declare module 'angular' { interface IComponentControllerService { // TBinding is an interface exposed by a component as per John Papa's style guide // https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#accessible-members-up-top - (componentName: string, locals: { $scope?: IScope, [key: string]: any }, bindings?: TBinding, ident?: string): T; + ( + componentName: string, + locals: { $scope?: IScope; [key: string]: any }, + bindings?: TBinding, + ident?: string + ): T; } - /////////////////////////////////////////////////////////////////////////// // HttpBackendService // see https://docs.angularjs.org/api/ngMock/service/$httpBackend /////////////////////////////////////////////////////////////////////////// interface IHttpBackendService { /** - * Flushes pending requests using the trained responses. Requests are flushed in the order they were made, but it is also possible to skip one or more requests (for example to have them flushed later). This is useful for simulating scenarios where responses arrive from the server in any order. - * - * If there are no pending requests to flush when the method is called, an exception is thrown (as this is typically a sign of programming error). - * @param count Number of responses to flush. If undefined/null, all pending requests (starting after `skip`) will be flushed. - * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_ - */ + * Flushes pending requests using the trained responses. Requests are flushed in the order they + * were made, but it is also possible to skip one or more requests (for example to have them + * flushed later). This is useful for simulating scenarios where responses arrive from the server + * in any order. + * + * If there are no pending requests to flush when the method is called, an exception is thrown (as + * this is typically a sign of programming error). + * + * @param count Number of responses to flush. If undefined/null, all pending requests (starting + * after `skip`) will be flushed. + * @param skip Number of pending requests to skip. For example, a value of 5 would skip the first 5 pending requests and start flushing from the 6th onwards. _(default: 0)_ + */ flush(count?: number, skip?: number): void; /** - * Resets all request expectations, but preserves all backend definitions. - */ + * Resets all request expectations, but preserves all backend definitions. + */ resetExpectations(): void; /** - * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. - * @param digest Do digest before checking expectation. Pass anything except false to trigger digest. NOTE this flag is purposely undocumented by Angular, which means it's not to be used in normal client code. - */ + * Verifies that all of the requests defined via the `expect` api were made. If any of the + * requests were not made, verifyNoOutstandingExpectation throws an exception. + * @param digest Do digest before checking expectation. Pass anything except false to trigger digest. + * NOTE: this flag is purposely undocumented by Angular, which means it's not to be used in normal client code. + */ verifyNoOutstandingExpectation(digest?: boolean): void; /** - * Verifies that there are no outstanding requests that need to be flushed. - */ + * Verifies that there are no outstanding requests that need to be flushed. + */ verifyNoOutstandingRequest(): void; - /** - * Creates a new request expectation. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param method HTTP method. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expect( + method: string, + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for DELETE requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for DELETE requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectDELETE( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for GET requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for GET requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectGET( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for HEAD requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object to be compared with the HTTP headers in the request. - * @param keys Array of keys to assign to regex matches in the request url. - */ + /** + * Creates a new request expectation for HEAD requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ - expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + expectHEAD( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for JSONP requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for JSONP requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectJSONP( + url: string | RegExp | ((url: string) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for PATCH requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for PATCH requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPATCH( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for POST requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for POST requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPOST( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new request expectation for PUT requests. - * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object, keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation for PUT requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + expectPUT( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition. - * Returns an object with respond method that controls how a matched request is handled. - * @param method HTTP method. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new request expectation that compares only with the requested route. + * This method offers colon delimited matching of the url path, ignoring the query string. + * This allows declarations similar to how application routes are configured with `$routeProvider`. + * As this method converts the definition url to regex, declaration order is important. + * @param method HTTP method + * @param url HTTP url string that supports colon param matching + */ + expectRoute(method: string, url: string): mock.IRequestHandler; - /** - * Creates a new backend definition for DELETE requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + when( + method: string, + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for GET requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in request url described above - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for DELETE requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenDELETE( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for HEAD requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for GET requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in request url described above + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenGET( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for JSONP requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenJSONP(url: string | RegExp | ((url: string) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for HEAD requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenHEAD( + url: string | RegExp | ((url: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for PATCH requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for JSONP requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenJSONP( + url: string | RegExp | ((url: string) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for POST requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for PATCH requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPATCH( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; - /** - * Creates a new backend definition for PUT requests. - * Returns an object with respond method that controls how a matched request is handled. - * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. - * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. - * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. - * @param keys Array of keys to assign to regex matches in the request url. - */ - whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; + /** + * Creates a new backend definition for POST requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true + * if the url matches the current definition. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPOST( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; + + /** + * Creates a new backend definition for PUT requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true + * if the url matches the current definition. + * @param data HTTP request body or function that receives data string and returns true if the data + * is as expected. + * @param headers HTTP headers or function that receives http header object and returns true if the + * headers match the current definition. + * @param keys Array of keys to assign to regex matches in the request url. + */ + whenPUT( + url: string | RegExp | ((url: string) => boolean), + data?: string | RegExp | object | ((data: string) => boolean), + headers?: mock.IHttpHeaders | ((headers: mock.IHttpHeaders) => boolean), + keys?: string[] + ): mock.IRequestHandler; + + /** + * Creates a new backend definition that compares only with the requested route. + * This method offers colon delimited matching of the url path, ignoring the query string. + * This allows declarations similar to how application routes are configured with `$routeProvider`. + * As this method converts the definition url to regex, declaration order is important. + * @param method HTTP method. + * @param url HTTP url string that supports colon param matching. + */ + whenRoute(method: string, url: string): mock.IRequestHandler; + } + + /////////////////////////////////////////////////////////////////////////// + // FlushPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$flushPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IFlushPendingTasksService { + /** + * Flushes all currently pending tasks and executes the corresponding callbacks. + * + * Optionally, you can also pass a `delay` argument to only flush tasks that are scheduled to be + * executed within `delay` milliseconds. Currently, `delay` only applies to timeouts, since all + * other tasks have a delay of 0 (i.e. they are scheduled to be executed as soon as possible, but + * still asynchronously). + * + * If no delay is specified, it uses a delay such that all currently pending tasks are flushed. + * + * The types of tasks that are flushed include: + * + * - Pending timeouts (via `$timeout`). + * - Pending tasks scheduled via `$applyAsync`. + * - Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not flushed by + * > `$flushPendingTasks()`. Use `$interval.flush(millis)` instead. + * + * @param millis - The number of milliseconds to flush. + */ + (delay?: number): void; + } + + /////////////////////////////////////////////////////////////////////////// + // VerifyNoPendingTasksService + // see https://docs.angularjs.org/api/ngMock/service/$verifyNoPendingTasks + /////////////////////////////////////////////////////////////////////////// + interface IVerifyNoPendingTasksService { + /** + * Verifies that there are no pending tasks that need to be flushed. It throws an error if there + * are still pending tasks. + * + * You can check for a specific type of tasks only, by specifying a `taskType`. + * + * Available task types: + * + * - `$timeout`: Pending timeouts (via `$timeout`). + * - `$http`: Pending HTTP requests (via `$http`). + * - `$route`: In-progress route transitions (via `$route`). + * - `$applyAsync`: Pending tasks scheduled via `$applyAsync`. + * - `$evalAsync`: Pending tasks scheduled via `$evalAsync`. + * These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises). + * + * > Periodic tasks scheduled via `$interval` use a different queue and are not taken into + * > account by `$verifyNoPendingTasks()`. There is currently no way to verify that there are no + * > pending `$interval` tasks. + * + * @param taskType - The type of tasks to check for. + */ + (taskType?: string): void; } /////////////////////////////////////////////////////////////////////////// // AnimateService // see https://docs.angularjs.org/api/ngMock/service/$animate /////////////////////////////////////////////////////////////////////////// - module animate { + namespace animate { interface IAnimateService { - /** - * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. + * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining + * animation frames and/or callbacks. */ closeAndFlush(): void; /** - * This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively running animation (see `closeAndFlush()` for that). + * This method is used to flush the pending callbacks and animation frames to either start + * an animation or conclude an animation. Note that this will not actually close an + * actively running animation (see `closeAndFlush()`} for that). */ flush(): void; } } - export module mock { - // returned interface by the the mocked HttpBackendService expect/when methods + namespace mock { + /** Object returned by the the mocked HttpBackendService expect/when methods */ interface IRequestHandler { - - /** - * Controls the response for a matched request using a function to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param func Function that receives the request HTTP method, url, data, headers, and an array of keys to regex matches in the request url and returns an array containing response status (number), data, headers, and status text. - */ - respond(func: ((method: string, url: string, data: string | Object, headers: Object, params?: any) => [number, string | Object, Object, string])): IRequestHandler; - - /** - * Controls the response for a matched request using supplied static data to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param status HTTP status code to add to the response. - * @param data Data to add to the response. - * @param headers Headers object to add to the response. - * @param responseText Response text to add to the response. - */ - respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; - - /** - * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. - * Returns the RequestHandler object for possible overrides. - * @param data Data to add to the response. - * @param headers Headers object to add to the response. - * @param responseText Response text to add to the response. - */ - respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; - - // Available when ngMockE2E is loaded /** - * Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) - */ + * Controls the response for a matched request using a function to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param func Function that receives the request HTTP method, url, data, headers, and an array of keys + * to regex matches in the request url and returns an array containing response status (number), data, + * headers, and status text. + */ + respond( + func: (( + method: string, + url: string, + data: string | object, + headers: IHttpHeaders, + params: { [key: string]: string } + ) => [number, string | object, IHttpHeaders, string]) + ): IRequestHandler; + + /** + * Controls the response for a matched request using supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param status HTTP status code to add to the response. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond( + status: number, + data?: string | object, + headers?: IHttpHeaders, + responseText?: string + ): IRequestHandler; + + /** + * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond( + data: string | object, + headers?: IHttpHeaders, + responseText?: string + ): IRequestHandler; + + /** + * Any request matching a backend definition or expectation with passThrough handler will be + * passed through to the real backend (an XHR request will be made to the server.) + * Available when ngMockE2E is loaded + */ passThrough(): IRequestHandler; } + interface IHttpHeaders { + [headerName: string]: any; + } + + /** + * Contains additional event data used by the `browserTrigger` function when creating an event. + */ + interface IBrowserTriggerEventData { + /** + * [Event.bubbles](https://developer.mozilla.org/docs/Web/API/Event/bubbles). + * Not applicable to all events. + */ + bubbles?: boolean; + /** + * [Event.cancelable](https://developer.mozilla.org/docs/Web/API/Event/cancelable). + * Not applicable to all events. + */ + cancelable?: boolean; + /** + * [charCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/charcode) + * for keyboard events (keydown, keypress, and keyup). + */ + charcode?: number; + /** + * [data](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data) for + * [CompositionEvents](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent). + */ + data?: string; + /** + * The elapsedTime for + * [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent) + * and [AnimationEvent](https://developer.mozilla.org/docs/Web/API/AnimationEvent). + */ + elapsedTime?: number; + /** + * [keyCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/keycode) + * for keyboard events (keydown, keypress, and keyup). + */ + keycode?: number; + /** + * An array of possible modifier keys (ctrl, alt, shift, meta) for + * [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) and + * keyboard events (keydown, keypress, and keyup). + */ + keys?: Array<'ctrl' | 'alt' | 'shift' | 'meta'>; + /** + * The [relatedTarget](https://developer.mozilla.org/docs/Web/API/MouseEvent/relatedTarget) + * for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent). + */ + relatedTarget?: Node; + /** + * [which](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/which) + * for keyboard events (keydown, keypress, and keyup). + */ + which?: number; + /** + * x-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + */ + x?: number; + /** + * y-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) + * and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent). + */ + y?: number; + } } } /////////////////////////////////////////////////////////////////////////////// // functions attached to global object (window) /////////////////////////////////////////////////////////////////////////////// -//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. -//declare var module: (...modules: any[]) => any; +// Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. +// declare var module: (...modules: any[]) => any; declare global { - export var inject: angular.IInjectStatic; + const inject: angular.IInjectStatic; + + /** + * This is a global (window) function that is only available when the `ngMock` module is included. + * It can be used to trigger a native browser event on an element, which is useful for unit testing. + * + * @param element Either a wrapped jQuery/jqLite node or a DOM element. + * @param eventType Optional event type. If none is specified, the function tries to determine the + * right event type for the element, e.g. `change` for `input[text]`. + * @param eventData An optional object which contains additional event data used when creating the + * event. + */ + function browserTrigger( + element: JQuery | Element, + eventType?: string, + eventData?: angular.mock.IBrowserTriggerEventData + ): void; } diff --git a/types/angular-mocks/mocks.d.ts b/types/angular-mocks/mocks.d.ts index 17c077008c..e8cc13c0a8 100644 --- a/types/angular-mocks/mocks.d.ts +++ b/types/angular-mocks/mocks.d.ts @@ -1,14 +1,14 @@ declare module "angular-mocks/ngMock" { - var _: string; + const _: string; export = _; } declare module "angular-mocks/ngMockE2E" { - var _: string; + const _: string; export = _; } declare module "angular-mocks/ngAnimateMock" { - var _: string; + const _: string; export = _; -} \ No newline at end of file +} diff --git a/types/angular-mocks/tslint.json b/types/angular-mocks/tslint.json index a41bf5d19a..e91317558b 100644 --- a/types/angular-mocks/tslint.json +++ b/types/angular-mocks/tslint.json @@ -1,79 +1,10 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json", + "rules": { + "callable-types": false, + "interface-name": false, + "no-declare-current-package": false, + "no-unnecessary-generics": false, + "only-arrow-functions": false + } } diff --git a/types/angular-route/angular-route-tests.ts b/types/angular-route/angular-route-tests.ts index 677c1589ed..e1e7bd43fd 100644 --- a/types/angular-route/angular-route-tests.ts +++ b/types/angular-route/angular-route-tests.ts @@ -39,6 +39,21 @@ $routeProvider return "I return a string" } }) + .when('/projects/:projectId/dashboard6', { + resolve: { + foo: () => 'foo', + bar: () => 'bar', + }, + resolveAs: 'baz', + resolveRedirectTo: [ + '$http', + ($http: ng.IHttpService) => $http.get('/is-admin').then(() => '/admin/lounge', () => undefined), + ], + }) + .when('/projects/:projectId/dashboard7', { + reloadOnUrl: false, + resolveRedirectTo: () => (Math.random() < 0.5) ? '/some/route' : undefined, + }) .otherwise({ redirectTo: '/' }) .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }) .otherwise("/"); diff --git a/types/angular-route/index.d.ts b/types/angular-route/index.d.ts index 56bd3f2263..15529f1572 100644 --- a/types/angular-route/index.d.ts +++ b/types/angular-route/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Angular JS (ngRoute module) 1.3 +// Type definitions for Angular JS (ngRoute module) 1.7 // Project: http://angularjs.org // Definitions by: Jonathan Park +// George Kalpakas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -52,7 +53,7 @@ declare module 'angular' { */ interface IRoute { /** - * {(string|function()=} + * {(string|Function)=} * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. */ controller?: string | InlineAnnotatedFunction; @@ -61,56 +62,122 @@ declare module 'angular' { */ controllerAs?: string; /** - * Undocumented? - */ - name?: string; - /** - * {string=|function()=} + * {(string|Function)=} * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. * * If template is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - template?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + template?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {string=|function()=} + * {(string|Function)=} * Path or function that returns a path to an html template that should be used by ngView. * * If templateUrl is a function, it will be called with the following parameters: * * {Array.} - route parameters extracted from the current $location.path() by applying the current route */ - templateUrl?: string | { ($routeParams?: angular.route.IRouteParamsService): string; } + templateUrl?: string | { ($routeParams?: IRouteParamsService): string; } /** - * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * {Object.=} + * An optional map of dependencies which should be injected into the controller. If any of these + * dependencies are promises, the router will wait for them all to be resolved or one to be rejected before + * the controller is instantiated. + * If all the promises are resolved successfully, the values of the resolved promises are injected and + * `$routeChangeSuccess` event is fired. If any of the promises are rejected the `$routeChangeError` event + * is fired. + * For easier access to the resolved dependencies from the template, the `resolve` map will be available on + * the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs` + * property (see below). This can be particularly useful, when working with components as route templates. * - * - key - {string}: a name of a dependency to be injected into the controller. - * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + * > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten. + * > Make sure, you specify an appropriate name for this property, that does not collide with other + * > properties on the scope. + * + * The map object is: + * + * - `key` – `{string}`: a name of a dependency to be injected into the controller. + * - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function, + * then it is called with `$injector#invoke()` and the return value is treated as the dependency. If the + * result is a promise, it is resolved before its value is injected into the controller. Be aware that + * `ngRoute.$routeParams` will still refer to the previous route within these resolve functions. Use + * `$route.current.params` to access the new route parameters, instead. */ resolve?: { [key: string]: any }; /** - * {(string|function())=} - * Value to update $location path with and trigger route redirection. - * - * If redirectTo is a function, it will be called with the following parameters: - * - * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. - * - {string} - current $location.path() - * - {Object} - current $location.search() - * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + * {string=} + * The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults + * to `$resolve`. */ - redirectTo?: string | { ($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + resolveAs?: string; /** - * Reload route when only $location.search() or $location.hash() changes. + * {(string|Function)=} + * Value to update `$location` path with and trigger route redirection. * - * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + * If `redirectTo` is a function, it will be called with the following parameters: + * + * - `{Object.}` - route parameters extracted from the current `$location.path()` by applying the + * current route templateUrl. + * - `{string}` - current `$location.path()` + * - `{Object}` - current `$location.search()` + * + * The custom `redirectTo` function is expected to return a string which will be used to update + * `$location.url()`. If the function throws an error, no further processing will take place and the + * `$routeChangeError` event will be fired. + * + * Routes that specify `redirectTo` will not have their controllers, template functions or resolves called, + * the `$location` will be changed to the redirect url and route processing will stop. The exception to this + * is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs + * as though there was no redirection. + */ + redirectTo?: string | { ($routeParams?: IRouteParamsService, $locationPath?: string, $locationSearch?: any): string }; + /** + * {Function=} + * A function that will (eventually) return the value to update `$location` URL with and trigger route + * redirection. In contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the + * return value can be either a string or a promise that will be resolved to a string. + * + * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets resolved to + * `undefined`), no redirection takes place and the route transition occurs as though there was no + * redirection. + * + * If the function throws an error or the returned promise gets rejected, no further processing will take + * place and the `$routeChangeError` event will be fired. + * + * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route definition, + * will cause the latter to be ignored. + */ + resolveRedirectTo?: angular.Injectable<(...deps: any[]) => angular.IPromise | string | undefined>; + /** + * {boolean=true} + * Reload route when any part of the URL changes (including the path) even if the new URL maps to the same + * route. + * + * If the option is set to `false` and the URL in the browser changes, but the new URL maps to the same + * route, then a `$routeUpdate` event is broadcasted on the root scope (without reloading the route). + * + * Defaults to `true`. + */ + reloadOnUrl?: boolean; + /** + * {boolean=true} + * Reload route when only `$location.search()` or `$location.hash()` changes. + * + * If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is + * broadcasted on the root scope (without reloading the route). + * + * > Note: This option has no effect if `reloadOnUrl` is set to `false`. + * + * Defaults to `true`. */ reloadOnSearch?: boolean; /** - * Match routes without being case sensitive + * {boolean=false} + * Match routes without being case sensitive. + * If the option is set to `true`, then the particular route can be matched without being case sensitive. * - * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + * Defaults to `false`. */ caseInsensitiveMatch?: boolean; } diff --git a/types/angular-translate/index.d.ts b/types/angular-translate/index.d.ts index 719fcb5d5c..f35fb57570 100644 --- a/types/angular-translate/index.d.ts +++ b/types/angular-translate/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Translate (pascalprecht.translate module) 2.15 +// Type definitions for Angular Translate (pascalprecht.translate module) 2.16 // Project: https://github.com/PascalPrecht/angular-translate // Definitions by: Michel Salib , Gabriel Gil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -47,8 +47,8 @@ declare module 'angular' { } interface ITranslateService { - (translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise; - (translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<{ [key: string]: string }>; + (translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise; + (translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise<{ [key: string]: string }>; cloakClassName(): string; cloakClassName(name: string): ITranslateProvider; fallbackLanguage(langKey?: string): string; diff --git a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 9dbbf8e002..f21ee43ab3 100644 --- a/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/types/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -57,6 +57,28 @@ testApp.config(( /** * $datepickerPopupConfig tests */ + $datepickerPopupConfig.datepickerMode = 'month'; + $datepickerPopupConfig.formatDay = 'd'; + $datepickerPopupConfig.formatDayHeader = 'E'; + $datepickerPopupConfig.formatDayTitle = 'dd-MM-yyyy'; + $datepickerPopupConfig.formatMonth = 'M'; + $datepickerPopupConfig.formatMonthTitle = 'yy'; + $datepickerPopupConfig.formatYear = 'y'; + $datepickerPopupConfig.initDate = '1389586124979'; + $datepickerPopupConfig.maxDate = '1389586124979'; + $datepickerPopupConfig.maxMode = 'month'; + $datepickerPopupConfig.minDate = '1389586124979'; + $datepickerPopupConfig.minMode = 'month'; + $datepickerPopupConfig.shortcutPropagation = true; + $datepickerPopupConfig.showWeeks = false; + $datepickerPopupConfig.startingDay = 1; + $datepickerPopupConfig.yearRange = 10; + $datepickerPopupConfig.monthColumns = 3; + $datepickerPopupConfig.yearColumns = 9; + $datepickerPopupConfig.yearRows = 6; + $datepickerPopupConfig.ngModelOptions.allowInvalid = false; + $datepickerPopupConfig.ngModelOptions.timezone = "EST"; + $datepickerPopupConfig.ngModelOptions.updateOn = "click"; $datepickerPopupConfig.altInputFormats = ["mm/dd/YYYY", "mm-dd-YY"]; $datepickerPopupConfig.appendToBody = true; $datepickerPopupConfig.currentText = 'Select Today'; diff --git a/types/angular-ui-bootstrap/index.d.ts b/types/angular-ui-bootstrap/index.d.ts index 0c41fcc15c..db08aae252 100644 --- a/types/angular-ui-bootstrap/index.d.ts +++ b/types/angular-ui-bootstrap/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for Angular UI Bootstrap 0.13.3 // Project: https://github.com/angular-ui/bootstrap -// Definitions by: Brian Surowiec , Ryan Southgate +// Definitions by: Brian Surowiec , +// Ryan Southgate +// Alfie Johnson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -227,7 +229,7 @@ declare module 'angular' { customClass?: DatepickerCallback; } - interface IDatepickerPopupConfig { + interface IDatepickerPopupConfig extends IDatepickerConfig { /** * A list of alternate formats acceptable for manual entry. diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 1dff1a0451..44f8539af2 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -214,11 +214,18 @@ mod.factory({ name1(foo: any) {}, name2: ['foo', (foo: any) => {}] }); -mod.filter('name', ($scope: ng.IScope) => {}); -mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]); +mod.filter('name', ($scope: ng.IScope) => () => {}); +mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]); mod.filter({ - name1(foo: any) {}, - name2: ['foo', (foo: any) => {}] + name1(foo: any) { return () => {}; }, + name2: ['foo', (foo: any) => () => {}], +}); +const customStatefulFilter: ng.IFilterFunction = (s) => 1; +mod.filter('name', () => customStatefulFilter); +mod.filter('name', ['$scope', () => customStatefulFilter]); +mod.filter({ + name1: () => customStatefulFilter, + name2: ['foo', () => customStatefulFilter], }); mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } })); mod.provider('name', TestProvider); @@ -304,8 +311,10 @@ namespace TestQ { } const abcObject: AbcObject = null; const abcObjectPromise: angular.IPromise = null; + const abcObjectPromiseLike: PromiseLike = null; const efObject: EfObject = null; const efObjectPromise: angular.IPromise = null; + const efObjectPromiseLike: PromiseLike = null; const ghObject: GhObject = null; const ghObjectPromise: angular.IPromise = null; @@ -397,6 +406,7 @@ namespace TestQ { result = $q.when(abcObject); result = $q.when(abcObjectPromise); + result = $q.when(abcObjectPromiseLike); result = $q.when(efObject, (result: EfObject) => abcObject); result = $q.when(efObject, (result: EfObject) => abcObject, (any) => any); @@ -409,10 +419,21 @@ namespace TestQ { resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise); + resultOther = $q.when(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromise); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any); result = $q.when(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any); + result = $q.when(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any); + result = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject); resultOther = $q.when(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any); @@ -513,6 +534,20 @@ namespace TestInjector { anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } + + // $injector.loadNewModules + { + const inlineAnnotatedFunction: any[] = [false, (v: boolean) => {}]; + const modA = angular.module('$injector.moduleA', []); + $injector.loadNewModules([modA]); + $injector.loadNewModules([modA.name]); + $injector.loadNewModules([inlineAnnotatedFunction]); + } + + // $injector.modules + { + const module: angular.IModule = $injector.modules['$injector.module']; + } } // Promise signature tests @@ -710,11 +745,12 @@ function test_angular_forEach() { this.push(`${key}: ${value}`); }, log); // expect(log).toEqual(['name: misko', 'gender: male']); - // $ExpectType NodeListOf - angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { + // TODO: Set minimum version to ts3.1 where this is always HTMLCollectionOf + type Collection = NodeListOf | HTMLCollectionOf; + const collection: Collection = angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => { value; // $ExpectType HTMLImageElement key; // $ExpectType number - obj; // $ExpectType NodeListOf + const collection: Collection = obj; }); // $ExpectType number[] angular.forEach([1, 2, 3], (value, key, obj) => { diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 89e897a7ad..99977b57b5 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -4,6 +4,7 @@ // Georgii Dolzhykov // Caleb St-Denis // Leonard Thieu +// Steffen Kowalski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -249,8 +250,8 @@ declare namespace angular { */ factory(name: string, $getFn: Injectable): IModule; factory(object: {[name: string]: Injectable}): IModule; - filter(name: string, filterFactoryFunction: Injectable): IModule; - filter(object: {[name: string]: Injectable}): IModule; + filter(name: string, filterFactoryFunction: Injectable): IModule; + filter(object: {[name: string]: Injectable}): IModule; provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; provider(name: string, inlineAnnotatedConstructor: any[]): IModule; @@ -484,6 +485,76 @@ declare namespace angular { $broadcast(name: string, ...args: any[]): IAngularEvent; $destroy(): void; $digest(): void; + + /** + * Suspend watchers of this scope subtree so that they will not be invoked during digest. + * + * This can be used to optimize your application when you know that running those watchers + * is redundant. + * + * **Warning** + * + * Suspending scopes from the digest cycle can have unwanted and difficult to debug results. + * Only use this approach if you are confident that you know what you are doing and have + * ample tests to ensure that bindings get updated as you expect. + * + * Some of the things to consider are: + * + * * Any external event on a directive/component will not trigger a digest while the hosting + * scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`. + * * Transcluded content exists on a scope that inherits from outside a directive but exists + * as a child of the directive's containing scope. If the containing scope is suspended the + * transcluded scope will also be suspended, even if the scope from which the transcluded + * scope inherits is not suspended. + * * Multiple directives trying to manage the suspended status of a scope can confuse each other: + * * A call to `$suspend()` on an already suspended scope is a no-op. + * * A call to `$resume()` on a non-suspended scope is a no-op. + * * If two directives suspend a scope, then one of them resumes the scope, the scope will no + * longer be suspended. This could result in the other directive believing a scope to be + * suspended when it is not. + * * If a parent scope is suspended then all its descendants will be also excluded from future + * digests whether or not they have been suspended themselves. Note that this also applies to + * isolate child scopes. + * * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers + * for that scope and its descendants. When digesting we only check whether the current scope is + * locally suspended, rather than checking whether it has a suspended ancestor. + * * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be + * included in future digests until all its ancestors have been resumed. + * * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()` + * against the `$rootScope` and so will still trigger a global digest even if the promise was + * initiated by a component that lives on a suspended scope. + */ + $suspend(): void; + + /** + * Call this method to determine if this scope has been explicitly suspended. It will not + * tell you whether an ancestor has been suspended. + * To determine if this scope will be excluded from a digest triggered at the $rootScope, + * for example, you must check all its ancestors: + * + * ``` + * function isExcludedFromDigest(scope) { + * while(scope) { + * if (scope.$isSuspended()) return true; + * scope = scope.$parent; + * } + * return false; + * ``` + * + * Be aware that a scope may not be included in digests if it has a suspended ancestor, + * even if `$isSuspended()` returns false. + * + * @returns true if the current scope has been suspended. + */ + $isSuspended(): boolean; + + /** + * Resume watchers of this scope subtree in case it was suspended. + * + * See {$rootScope.Scope#$suspend} for information about the dangers of using this approach. + */ + $resume(): void; + /** * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners. * @@ -1066,12 +1137,12 @@ declare namespace angular { * * @param value Value or a promise */ - resolve(value: IPromise|T): IPromise; + resolve(value: PromiseLike|T): IPromise; /** * @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2. * To use resolve with two different types, pass a union type to the single-type-argument overload. */ - resolve(value: IPromise|T2): IPromise; + resolve(value: PromiseLike|T2): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -1081,11 +1152,11 @@ declare namespace angular { * * @param value Value or a promise */ - when(value: IPromise|T): IPromise; - when(value: IPromise|T2): IPromise; - when(value: IPromise|T, successCallback: (promiseValue: T) => IPromise|TResult): IPromise; - when(value: T, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; - when(value: IPromise, successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => TResult2 | IPromise, notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike|T): IPromise; + when(value: PromiseLike|T2): IPromise; + when(value: PromiseLike|T, successCallback: (promiseValue: T) => PromiseLike|TResult): IPromise; + when(value: T, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise; + when(value: PromiseLike, successCallback: (promiseValue: T) => PromiseLike|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike, notifyCallback?: (state: any) => any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. */ @@ -2112,6 +2183,14 @@ declare namespace angular { has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; invoke(func: Injectable T)>, context?: any, locals?: any): T; + /** + * Add the specified modules to the current injector. + * This method will add each of the injectables to the injector and execute all of the config and run blocks for each module passed to the method. + * @param modules A module, module name or annotated injection function. + */ + loadNewModules(modules: Array void>>): void; + /** An object map of all the modules that have been loaded into the injector. */ + modules: {[moduleName: string]: IModule}; strictDi: boolean; } @@ -2166,4 +2245,13 @@ declare namespace angular { interface IHttpParamSerializer { (obj: Object): string; } + + interface IFilterFunction extends Function { + /** + * By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.** + * See https://docs.angularjs.org/guide/filter#stateful-filters + */ + $stateful?: boolean; + } + type FilterFactory = (...I: any[]) => IFilterFunction; } diff --git a/types/antlr4/BufferedTokenStream.d.ts b/types/antlr4/BufferedTokenStream.d.ts new file mode 100644 index 0000000000..0efc73da2f --- /dev/null +++ b/types/antlr4/BufferedTokenStream.d.ts @@ -0,0 +1,53 @@ +import { Token } from './Token'; +import { Interval } from './IntervalSet'; + +export class BufferedTokenStream { + tokenSource: any; + tokens: Token[]; + index: number; + fetchEOF: boolean; + + mark(): number; + + release(marker: number): number; + + reset(): void; + + seek(index: number): void; + + get(index: number): Token; + + consume(): void; + + sync(i: number): boolean; + + fetch(n: number): number; + + getTokens(start: number, stop: number, types: any): Token[]; + + LA(i: number): any; + + LB(k: number): Token; + + LT(k: number): Token; + + adjustSeekIndex(i: number): number; + + lazyInit(): void; + + setup(): void; + + setTokenSource(tokenSource: any): void; + + nextTokenOnChannel(i: number, channel: any): number; + + previousTokenOnChannel(i: number, channel: any): number; + + getHiddenTokensToRight(tokenIndex: number, channel: any): Token[]; + + getSourceName(): any; + + getText(interval: Interval): any; + + fill(): void; +} diff --git a/types/antlr4/CommonTokenStream.d.ts b/types/antlr4/CommonTokenStream.d.ts new file mode 100644 index 0000000000..bc15162518 --- /dev/null +++ b/types/antlr4/CommonTokenStream.d.ts @@ -0,0 +1,15 @@ +import { BufferedTokenStream } from './BufferedTokenStream'; +import { Token } from './Token'; +import { Lexer } from './Lexer'; + +export class CommonTokenStream extends BufferedTokenStream { + constructor(lexer: Lexer, channel?: any); + + adjustSeekIndex(i: number): any; + + LB(k: number): Token; + + LT(k: number): Token; + + getNumberOfOnChannelTokens(): number; +} diff --git a/types/antlr4/InputStream.d.ts b/types/antlr4/InputStream.d.ts new file mode 100644 index 0000000000..79a05490a0 --- /dev/null +++ b/types/antlr4/InputStream.d.ts @@ -0,0 +1,24 @@ +export class InputStream { + readonly index: number; + readonly size: number; + + constructor(data: string, decodeToUnicodeCodePoints?: boolean); + + reset(): void; + + consume(): void; + + LA(offset: number): string; + + LT(offset: number): string; + + mark(): number; + + release(marker: any): number; + + seek(index: number): void; + + getText(start: number, stop: number): string; + + toString(): string; +} diff --git a/types/antlr4/IntervalSet.d.ts b/types/antlr4/IntervalSet.d.ts new file mode 100644 index 0000000000..cd477700f1 --- /dev/null +++ b/types/antlr4/IntervalSet.d.ts @@ -0,0 +1,49 @@ +import { Token } from './Token'; + +export class Interval { + readonly length: number; + readonly start: number; + readonly stop: number; + + constructor(start: number, stop: number); + + contains(item: number): boolean; + + toString(): string; +} + +export class IntervalSet { + readonly readOnly: boolean; + readonly intervals: Interval[]; + readonly length: boolean; + + first(): number; + + addOne(v: number): void; + + addRange(l: number, h: number): void; + + addInterval(interval: Interval): void; + + addSet(other: IntervalSet): void; + + reduce(k: number): void; + + complement(start: number, stop: number): IntervalSet; + + contains(item: number): boolean; + + removeRange(interval: Interval): boolean; + + removeOne(v: number): boolean; + + toString(literalNames?: string[], symbolicNames?: string[], elemsAreChar?: boolean): string; + + toCharString(): string; + + toIndexString(): string; + + toTokenString(literalNames: string[], symbolicNames: string[]): string; + + elementName(literalNames: string[], symbolicNames: string[], token: Token): string; +} diff --git a/types/antlr4/Lexer.d.ts b/types/antlr4/Lexer.d.ts new file mode 100644 index 0000000000..bb66859402 --- /dev/null +++ b/types/antlr4/Lexer.d.ts @@ -0,0 +1,52 @@ +import { Recognizer } from './Recognizer'; +import { Token } from './Token'; +import { RecognitionException } from './error/Errors'; + +export class Lexer extends Recognizer { + inputStream: any; + sourceName: any; + type: any; + line: any; + column: any; + text: string; + + reset(): void; + + nextToken(): Token; + + skip(): void; + + more(): void; + + pushMode(mode: any): void; + + popMode(): any; + + emitToken(): void; + + emit(): Token; + + emitEOF(): Token; + + charIndex(): number; + + getAllTokens(): Token[]; + + notifyListeners(e: RecognitionException): void; + + getErrorDisplay(s: string): string; + + getErrorDisplayForChar(c: string): string; + + getCharErrorDisplay(c: string): string; + + recover(re: RecognitionException): void; + + static readonly DEFAULT_MODE: number; + static readonly MORE: number; + static readonly SKIP: number; + static readonly DEFAULT_TOKEN_CHANNEL: any; + static readonly HIDDEN: any; + static readonly MIN_CHAR_VALUE: number; + static readonly MAX_CHAR_VALUE: number; +} diff --git a/types/antlr4/Parser.d.ts b/types/antlr4/Parser.d.ts new file mode 100644 index 0000000000..b43e50bc50 --- /dev/null +++ b/types/antlr4/Parser.d.ts @@ -0,0 +1,90 @@ +import { CommonTokenStream } from './CommonTokenStream'; +import { Recognizer } from './Recognizer'; +import { Token } from './Token'; +import { ParseTreeListener } from './tree/Tree'; +import { Lexer } from './Lexer'; +import { InputStream } from './InputStream'; +import { ParserRuleContext } from './ParserRuleContext'; +import { ErrorStrategy } from './error/ErrorStrategy'; + +export class Parser extends Recognizer { + constructor(input: CommonTokenStream); + + buildParseTrees: boolean; + + _errHandler: ErrorStrategy; + + reset(): void; + + match(): Token; + + matchWildcard(): Token; + + getParseListeners(): ParseTreeListener[]; + + addParseListener(lister: ParseTreeListener): void; + + removeParseListener(lister: ParseTreeListener): void; + + removeParseListeners(): void; + + triggerEnterRuleEvent(): void; + + triggerExitRuleEvent(): void; + + getTokenFactory(): any; + + setTokenFactory(factory: any): void; + + getATNWithBypassAlts(): any; + + compileParseTreePattern(pattern: any, patternRuleIndex: any, lexer: Lexer): any; + + getInputStream(): InputStream; + + getTokenStream(): any; + + setTokenStream(stream: any): any; + + getCurrentToken(): Token; + + notifyErrorListeners(msg: string, offendingToken: Token, err: any): void; + + consume(): any; + + addContextToParseTree(): any; + + enterRule(localCtx: ParserRuleContext, state: any, ruleIndex: number): void; + + exitRule(): void; + + enterOuterAlt(): void; + + getPrecedence(): any; + + enterRecursionRule(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void; + + pushNewRecursionContext(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void; + + unrollRecursionContexts(parentCtx: ParserRuleContext): void; + + getInvokingContext(ruleIndex: number): any; + + isExpectedToken(symbol: Token): boolean; + + getExpectedTokens(): Token[]; + + getExpectedTokensWithinCurrentRule(): Token[]; + + getRuleIndex(ruleName: string): number; + + getRuleInvocationStack(p: any): any; + + getDFAStrings(): any; + + dumpDFA(): void; + + getSourceName(): any; + + setTrace(trace: boolean): void; +} diff --git a/types/antlr4/ParserRuleContext.d.ts b/types/antlr4/ParserRuleContext.d.ts new file mode 100644 index 0000000000..c9bb873dcb --- /dev/null +++ b/types/antlr4/ParserRuleContext.d.ts @@ -0,0 +1,44 @@ +import { RuleContext } from './RuleContext'; +import { Token } from './Token'; +import { ErrorNode, ParseTreeListener } from './tree/Tree'; +import { Interval } from './IntervalSet'; +import { RecognitionException } from './error/Errors'; + +export class ParserRuleContext extends RuleContext { + readonly start: Token; + readonly stop: Token; + readonly ruleIndex: number; + readonly exception: RecognitionException; + + constructor(parent: any, invokingState: number); + + copyFrom(ctx: any): void; + + enterRule(listener: ParseTreeListener): void; + + exitRule(listener: ParseTreeListener): void; + + addChild(child: any): any; + + removeLastChild(): void; + + addTokenNode(token: Token): Token; + + addErrorNode(badToken: Token): ErrorNode; + + getChild(i: number, type?: any): any; + + getToken(ttype: number, i: number): Token; + + getTokens(ttype: number): Token[]; + + getTypedRuleContext(cxtType: any, i: number): any; + + getTypedRuleContexts(cxtType: any): any[]; + + getChildCount(): number; + + getSourceInterval(): Interval; + + static readonly EMPTY: ParserRuleContext; +} diff --git a/types/antlr4/Recognizer.d.ts b/types/antlr4/Recognizer.d.ts new file mode 100644 index 0000000000..bbe1752cba --- /dev/null +++ b/types/antlr4/Recognizer.d.ts @@ -0,0 +1,29 @@ +import { ErrorListener, ProxyErrorListener } from './error/ErrorListener'; +import { Token } from './Token'; +import { ParserRuleContext } from './ParserRuleContext'; + +export class Recognizer { + state: number; + + checkVersion(toolVersion: number): void; + + addErrorListener(listener: ErrorListener): void; + + removeErrorListeners(): void; + + getTokenTypeMap(): any; + + getRuleIndexMap(): any; + + getTokenType(tokenName: string): any; + + getErrorHeader(e: any): string; + + getTokenErrorDisplay(t: Token): string; + + getErrorListenerDispatch(): ProxyErrorListener; + + sempred(localCtx: ParserRuleContext, ruleIndex: number, actionIndex: number): boolean; + + precpred(localCtx: ParserRuleContext, precedence: any): boolean; +} diff --git a/types/antlr4/RuleContext.d.ts b/types/antlr4/RuleContext.d.ts new file mode 100644 index 0000000000..992b8c4c25 --- /dev/null +++ b/types/antlr4/RuleContext.d.ts @@ -0,0 +1,34 @@ +import { ParseTreeVisitor, RuleNode } from './tree/Tree'; +import { Interval } from './IntervalSet'; +import { ParserRuleContext } from './ParserRuleContext'; + +export class RuleContext extends RuleNode { + readonly invokingState: number; + readonly parentCtx: ParserRuleContext; + + constructor(parent: any, invokingState: number); + + depth(): number; + + isEmpty(): boolean; + + getSourceInterval(): Interval; + + getRuleContext(): RuleContext; + + getPayload(): RuleContext; + + getText(): string; + + getAltNumber(): number; + + setAltNumber(altNumber: number): void; + + getChild(i: number): any; + + getChildCount(): number; + + accept(visitor: ParseTreeVisitor): void; + + toStringTree(ruleNames: string[], recog: any): string; +} diff --git a/types/antlr4/Token.d.ts b/types/antlr4/Token.d.ts new file mode 100644 index 0000000000..fecf9f7d5c --- /dev/null +++ b/types/antlr4/Token.d.ts @@ -0,0 +1,31 @@ +export class Token { + readonly text: string; + source: any; + type: any; + channel: any; + start: number; + stop: number; + tokenIndex: number; + line: number; + column: number; + + getTokenSource(): any; + + getInputStream(): any; + + static readonly INVALID_TYPE: number; + static readonly EPSILON: number; + static readonly MIN_USER_TOKEN_TYPE: number; + static readonly EOF: number; + static readonly HIDDEN_CHANNEL: number; +} + +export class CommonToken extends Token { + constructor(source: any, type: any, channel: any, start: number, stop: number); + + clone(): Token; + + toString(): string; + + static readonly EMPTY_SOURCE: any; +} diff --git a/types/antlr4/antlr4-tests.ts b/types/antlr4/antlr4-tests.ts new file mode 100644 index 0000000000..f7d75865df --- /dev/null +++ b/types/antlr4/antlr4-tests.ts @@ -0,0 +1,2158 @@ +import { InputStream, CommonTokenStream, Lexer, Parser, ParserRuleContext } from 'antlr4'; +import { TerminalNode } from 'antlr4/tree/Tree'; + +export declare class CLexer extends Lexer { + readonly channelNames: string[]; + readonly modeNames: string[]; + readonly symbolicNames: string[]; + readonly grammarFileName: string; + + constructor(input: InputStream); +} + +export interface PrimaryExpressionContext extends ParserRuleContext { + Identifier(): TerminalNode; + + Constant(): TerminalNode; + + expression(): ExpressionContext; + + genericSelection(): GenericSelectionContext; + + compoundStatement(): CompoundStatementContext; + + unaryExpression(): UnaryExpressionContext; + + typeName(): TypeNameContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +interface GenericSelectionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + genericAssocList(): GenericAssocListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GenericAssocListContext extends ParserRuleContext { + genericAssociation(): GenericAssociationContext; + + genericAssocList(): GenericAssocListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GenericAssociationContext extends ParserRuleContext { + typeName(): TypeNameContext; + + assignmentExpression(): AssignmentExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface PostfixExpressionContext extends ParserRuleContext { + primaryExpression(): PrimaryExpressionContext; + + typeName(): TypeNameContext; + + initializerList(): InitializerListContext; + + postfixExpression(): PostfixExpressionContext; + + expression(): ExpressionContext; + + argumentExpressionList(): ArgumentExpressionListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ArgumentExpressionListContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + argumentExpressionList(): ArgumentExpressionListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface UnaryExpressionContext extends ParserRuleContext { + postfixExpression(): PostfixExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + unaryOperator(): UnaryOperatorContext; + + castExpression(): CastExpressionContext; + + typeName(): TypeNameContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface UnaryOperatorContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CastExpressionContext extends ParserRuleContext { + typeName(): TypeNameContext; + + castExpression(): CastExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + DigitSequence(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface MultiplicativeExpressionContext extends ParserRuleContext { + castExpression(): CastExpressionContext; + + multiplicativeExpression(): MultiplicativeExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AdditiveExpressionContext extends ParserRuleContext { + multiplicativeExpression(): MultiplicativeExpressionContext; + + additiveExpression(): AdditiveExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ShiftExpressionContext extends ParserRuleContext { + additiveExpression(): AdditiveExpressionContext; + + shiftExpression(): ShiftExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface RelationalExpressionContext extends ParserRuleContext { + shiftExpression(): ShiftExpressionContext; + + relationalExpression(): RelationalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EqualityExpressionContext extends ParserRuleContext { + relationalExpression(): RelationalExpressionContext; + + equalityExpression(): EqualityExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AndExpressionContext extends ParserRuleContext { + equalityExpression(): EqualityExpressionContext; + + andExpression(): AndExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExclusiveOrExpressionContext extends ParserRuleContext { + andExpression(): AndExpressionContext; + + exclusiveOrExpression(): ExclusiveOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InclusiveOrExpressionContext extends ParserRuleContext { + exclusiveOrExpression(): ExclusiveOrExpressionContext; + + inclusiveOrExpression(): InclusiveOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LogicalAndExpressionContext extends ParserRuleContext { + inclusiveOrExpression(): InclusiveOrExpressionContext; + + logicalAndExpression(): LogicalAndExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LogicalOrExpressionContext extends ParserRuleContext { + logicalAndExpression(): LogicalAndExpressionContext; + + logicalOrExpression(): LogicalOrExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ConditionalExpressionContext extends ParserRuleContext { + logicalOrExpression(): LogicalOrExpressionContext; + + expression(): ExpressionContext; + + conditionalExpression(): ConditionalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AssignmentExpressionContext extends ParserRuleContext { + conditionalExpression(): ConditionalExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + assignmentOperator(): AssignmentOperatorContext; + + assignmentExpression(): AssignmentExpressionContext; + + DigitSequence(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AssignmentOperatorContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExpressionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ConstantExpressionContext extends ParserRuleContext { + conditionalExpression(): ConditionalExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + initDeclaratorList(): InitDeclaratorListContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifiersContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifiers2Context extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationSpecifierContext extends ParserRuleContext { + storageClassSpecifier(): StorageClassSpecifierContext; + + typeSpecifier(): TypeSpecifierContext; + + typeQualifier(): TypeQualifierContext; + + functionSpecifier(): FunctionSpecifierContext; + + alignmentSpecifier(): AlignmentSpecifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitDeclaratorListContext extends ParserRuleContext { + initDeclarator(): InitDeclaratorContext; + + initDeclaratorList(): InitDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitDeclaratorContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + initializer(): InitializerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StorageClassSpecifierContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeSpecifierContext extends ParserRuleContext { + atomicTypeSpecifier(): AtomicTypeSpecifierContext; + + structOrUnionSpecifier(): StructOrUnionSpecifierContext; + + enumSpecifier(): EnumSpecifierContext; + + typedefName(): TypedefNameContext; + + constantExpression(): ConstantExpressionContext; + + typeSpecifier(): TypeSpecifierContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructOrUnionSpecifierContext extends ParserRuleContext { + structOrUnion(): StructOrUnionContext; + + structDeclarationList(): StructDeclarationListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructOrUnionContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclarationListContext extends ParserRuleContext { + structDeclaration(): StructDeclarationContext; + + structDeclarationList(): StructDeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclarationContext extends ParserRuleContext { + specifierQualifierList(): SpecifierQualifierListContext; + + structDeclaratorList(): StructDeclaratorListContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface SpecifierQualifierListContext extends ParserRuleContext { + typeSpecifier(): TypeSpecifierContext; + + specifierQualifierList(): SpecifierQualifierListContext; + + typeQualifier(): TypeQualifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclaratorListContext extends ParserRuleContext { + structDeclarator(): StructDeclaratorContext; + + structDeclaratorList(): StructDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StructDeclaratorContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumSpecifierContext extends ParserRuleContext { + enumeratorList(): EnumeratorListContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumeratorListContext extends ParserRuleContext { + enumerator(): EnumeratorContext; + + enumeratorList(): EnumeratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumeratorContext extends ParserRuleContext { + enumerationConstant(): EnumerationConstantContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface EnumerationConstantContext extends ParserRuleContext { + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AtomicTypeSpecifierContext extends ParserRuleContext { + typeName(): TypeNameContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeQualifierContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface FunctionSpecifierContext extends ParserRuleContext { + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AlignmentSpecifierContext extends ParserRuleContext { + typeName(): TypeNameContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclaratorContext extends ParserRuleContext { + directDeclarator(): DirectDeclaratorContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DirectDeclaratorContext extends ParserRuleContext { + Identifier(): TerminalNode; + + declarator(): DeclaratorContext; + + DigitSequence(): TerminalNode; + + pointer(): PointerContext; + + directDeclarator(): DirectDeclaratorContext; + + typeSpecifier(): TypeSpecifierContext; + + typeQualifierList(): TypeQualifierListContext; + + assignmentExpression(): AssignmentExpressionContext; + + parameterTypeList(): ParameterTypeListContext; + + identifierList(): IdentifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccDeclaratorExtensionContext extends ParserRuleContext { + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeSpecifierContext extends ParserRuleContext { + gccAttributeList(): GccAttributeListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeListContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface GccAttributeContext extends ParserRuleContext { + argumentExpressionList(): ArgumentExpressionListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface NestedParenthesesBlockContext extends ParserRuleContext { + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface PointerContext extends ParserRuleContext { + typeQualifierList(): TypeQualifierListContext; + + pointer(): PointerContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeQualifierListContext extends ParserRuleContext { + typeQualifier(): TypeQualifierContext; + + typeQualifierList(): TypeQualifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterTypeListContext extends ParserRuleContext { + parameterList(): ParameterListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterListContext extends ParserRuleContext { + parameterDeclaration(): ParameterDeclarationContext; + + parameterList(): ParameterListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ParameterDeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarator(): DeclaratorContext; + + declarationSpecifiers2(): DeclarationSpecifiers2Context; + + abstractDeclarator(): AbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface IdentifierListContext extends ParserRuleContext { + Identifier(): TerminalNode; + + identifierList(): IdentifierListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypeNameContext extends ParserRuleContext { + specifierQualifierList(): SpecifierQualifierListContext; + + abstractDeclarator(): AbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface AbstractDeclaratorContext extends ParserRuleContext { + pointer(): PointerContext; + + directAbstractDeclarator(): DirectAbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DirectAbstractDeclaratorContext extends ParserRuleContext { + abstractDeclarator(): AbstractDeclaratorContext; + + typeQualifierList(): TypeQualifierListContext; + + assignmentExpression(): AssignmentExpressionContext; + + parameterTypeList(): ParameterTypeListContext; + + directAbstractDeclarator(): DirectAbstractDeclaratorContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TypedefNameContext extends ParserRuleContext { + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitializerContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + initializerList(): InitializerListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface InitializerListContext extends ParserRuleContext { + initializer(): InitializerContext; + + designation(): DesignationContext; + + initializerList(): InitializerListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignationContext extends ParserRuleContext { + designatorList(): DesignatorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignatorListContext extends ParserRuleContext { + designator(): DesignatorContext; + + designatorList(): DesignatorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DesignatorContext extends ParserRuleContext { + constantExpression(): ConstantExpressionContext; + + Identifier(): TerminalNode; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StaticAssertDeclarationContext extends ParserRuleContext { + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface StatementContext extends ParserRuleContext { + labeledStatement(): LabeledStatementContext; + + compoundStatement(): CompoundStatementContext; + + expressionStatement(): ExpressionStatementContext; + + selectionStatement(): SelectionStatementContext; + + iterationStatement(): IterationStatementContext; + + jumpStatement(): JumpStatementContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface LabeledStatementContext extends ParserRuleContext { + Identifier(): TerminalNode; + + statement(): StatementContext; + + constantExpression(): ConstantExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CompoundStatementContext extends ParserRuleContext { + blockItemList(): BlockItemListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface BlockItemListContext extends ParserRuleContext { + blockItem(): BlockItemContext; + + blockItemList(): BlockItemListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface BlockItemContext extends ParserRuleContext { + statement(): StatementContext; + + declaration(): DeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExpressionStatementContext extends ParserRuleContext { + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface SelectionStatementContext extends ParserRuleContext { + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface IterationStatementContext extends ParserRuleContext { + While(): TerminalNode; + + expression(): ExpressionContext; + + statement(): StatementContext; + + Do(): TerminalNode; + + For(): TerminalNode; + + forCondition(): ForConditionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForConditionContext extends ParserRuleContext { + forDeclaration(): ForDeclarationContext; + + expression(): ExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForDeclarationContext extends ParserRuleContext { + declarationSpecifiers(): DeclarationSpecifiersContext; + + initDeclaratorList(): InitDeclaratorListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ForExpressionContext extends ParserRuleContext { + assignmentExpression(): AssignmentExpressionContext; + + forExpression(): ForExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface JumpStatementContext extends ParserRuleContext { + Identifier(): TerminalNode; + + expression(): ExpressionContext; + + unaryExpression(): UnaryExpressionContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface CompilationUnitContext extends ParserRuleContext { + EOF(): any; + + translationUnit(): TranslationUnitContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface TranslationUnitContext extends ParserRuleContext { + externalDeclaration(): ExternalDeclarationContext; + + translationUnit(): TranslationUnitContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface ExternalDeclarationContext extends ParserRuleContext { + functionDefinition(): FunctionDefinitionContext; + + declaration(): DeclarationContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface FunctionDefinitionContext extends ParserRuleContext { + declarator(): DeclaratorContext; + + compoundStatement(): CompoundStatementContext; + + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarationList(): DeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export interface DeclarationListContext extends ParserRuleContext { + declaration(): DeclarationContext; + + declarationList(): DeclarationListContext; + + removeLastChild(): any; + + getChildCount(): any; + + getSourceInterval(): any; + + isEmpty(): any; + + getRuleContext(): any; + + getPayload(): any; + + getText(): any; + + getAltNumber(): any; +} + +export declare class CParser extends Parser { + readonly ruleNames: string[]; + readonly literalNames: string[]; + readonly symbolicNames: string[]; + + constructor(input: CommonTokenStream); + + primaryExpression(): PrimaryExpressionContext; + + genericSelection(): GenericSelectionContext; + + genericAssociation(): GenericAssociationContext; + + unaryExpression(): UnaryExpressionContext; + + unaryOperator(): UnaryOperatorContext; + + castExpression(): CastExpressionContext; + + conditionalExpression(): ConditionalExpressionContext; + + assignmentExpression(): AssignmentExpressionContext; + + assignmentOperator(): AssignmentOperatorContext; + + constantExpression(): ConstantExpressionContext; + + declaration(): DeclarationContext; + + declarationSpecifiers(): DeclarationSpecifiersContext; + + declarationSpecifiers2(): DeclarationSpecifiers2Context; + + declarationSpecifier(): DeclarationSpecifierContext; + + initDeclarator(): InitDeclaratorContext; + + storageClassSpecifier(): StorageClassSpecifierContext; + + structOrUnionSpecifier(): StructOrUnionSpecifierContext; + + structOrUnion(): StructOrUnionContext; + + structDeclaration(): StructDeclarationContext; + + specifierQualifierList(): SpecifierQualifierListContext; + + structDeclarator(): StructDeclaratorContext; + + enumSpecifier(): EnumSpecifierContext; + + enumerator(): EnumeratorContext; + + enumerationConstant(): EnumerationConstantContext; + + atomicTypeSpecifier(): AtomicTypeSpecifierContext; + + typeQualifier(): TypeQualifierContext; + + functionSpecifier(): FunctionSpecifierContext; + + alignmentSpecifier(): AlignmentSpecifierContext; + + declarator(): DeclaratorContext; + + gccDeclaratorExtension(): GccDeclaratorExtensionContext; + + gccAttributeSpecifier(): GccAttributeSpecifierContext; + + gccAttributeList(): GccAttributeListContext; + + gccAttribute(): GccAttributeContext; + + nestedParenthesesBlock(): NestedParenthesesBlockContext; + + pointer(): PointerContext; + + parameterTypeList(): ParameterTypeListContext; + + parameterDeclaration(): ParameterDeclarationContext; + + typeName(): TypeNameContext; + + abstractDeclarator(): AbstractDeclaratorContext; + + typedefName(): TypedefNameContext; + + initializer(): InitializerContext; + + designation(): DesignationContext; + + designator(): DesignatorContext; + + staticAssertDeclaration(): StaticAssertDeclarationContext; + + statement(): StatementContext; + + labeledStatement(): LabeledStatementContext; + + compoundStatement(): CompoundStatementContext; + + blockItem(): BlockItemContext; + + expressionStatement(): ExpressionStatementContext; + + selectionStatement(): SelectionStatementContext; + + iterationStatement(): IterationStatementContext; + + forCondition(): ForConditionContext; + + forDeclaration(): ForDeclarationContext; + + jumpStatement(): JumpStatementContext; + + compilationUnit(): CompilationUnitContext; + + externalDeclaration(): ExternalDeclarationContext; + + functionDefinition(): FunctionDefinitionContext; + + reset(): any; + + matchWildcard(): any; + + getParseListeners(): any; + + removeParseListeners(): any; + + triggerEnterRuleEvent(): any; + + triggerExitRuleEvent(): any; + + getTokenFactory(): any; + + getATNWithBypassAlts(): any; + + getInputStream(): any; + + getTokenStream(): any; + + getCurrentToken(): any; + + consume(): any; + + addContextToParseTree(): any; + + exitRule(): any; + + getPrecedence(): any; + + getExpectedTokens(): any; + + getExpectedTokensWithinCurrentRule(): any; + + getDFAStrings(): any; + + dumpDFA(): any; + + getSourceName(): any; + + removeErrorListeners(): any; + + getTokenTypeMap(): any; + + getRuleIndexMap(): any; + + getErrorListenerDispatch(): any; +} + +const inputStream = new InputStream('int x = 10;'); +const lexer = new CLexer(inputStream); +const tokenStream = new CommonTokenStream(lexer); +const parser = new CParser(tokenStream); + +// execute the parse, and generate the parse tree +const tree = parser.compilationUnit(); +console.log(tree); diff --git a/types/antlr4/error/ErrorListener.d.ts b/types/antlr4/error/ErrorListener.d.ts new file mode 100644 index 0000000000..be03bef912 --- /dev/null +++ b/types/antlr4/error/ErrorListener.d.ts @@ -0,0 +1,15 @@ +import { Recognizer } from '../Recognizer'; +import { Token } from '../Token'; + +export class ErrorListener { + syntaxError(recognizer: Recognizer, offendingSymbol: Token, line: number, column: number, msg: string, e: any): void; + reportAmbiguity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, exact: any, ambigAlts: any, configs: any): void; + reportAttemptingFullContext(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void; + reportContextSensitivity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void; +} + +export class ConsoleErrorListener extends ErrorListener { +} + +export class ProxyErrorListener extends ErrorListener { +} diff --git a/types/antlr4/error/ErrorStrategy.d.ts b/types/antlr4/error/ErrorStrategy.d.ts new file mode 100644 index 0000000000..5b11bcbe6a --- /dev/null +++ b/types/antlr4/error/ErrorStrategy.d.ts @@ -0,0 +1,21 @@ +import { Recognizer } from '../Recognizer'; + +export class ErrorStrategy { + reset(recognizer: Recognizer): void; + + recoverInline(recognizer: Recognizer): void; + + recover(recognizer: Recognizer, e: Error): void; + + sync(recognizer: Recognizer): void; + + inErrorRecoveryMode(recognizer: Recognizer): void; + + reportError(recognizer: Recognizer): void; +} + +export class DefaultErrorStrategy extends ErrorStrategy { +} + +export class BailErrorStrategy extends ErrorStrategy { +} diff --git a/types/antlr4/error/Errors.d.ts b/types/antlr4/error/Errors.d.ts new file mode 100644 index 0000000000..11e348dace --- /dev/null +++ b/types/antlr4/error/Errors.d.ts @@ -0,0 +1,30 @@ +import { ParserRuleContext } from '../ParserRuleContext'; +import { Recognizer } from '../Recognizer'; +import { InputStream } from '../InputStream'; +import { Token } from '../Token'; + +export class RecognitionException extends Error { + message: string; + ctx: ParserRuleContext; + recognizer: Recognizer; + input: InputStream; + offendingToken: Token; + offendingState: -1; + getExpectedTokens(): Token[]; + toString(): string; +} + +export class LexerNoViableAltException extends RecognitionException { +} + +export class NoViableAltException extends RecognitionException { +} + +export class InputMismatchException extends RecognitionException { +} + +export class FailedPredicateException extends RecognitionException { +} + +export class ParseCancellationException extends RecognitionException { +} diff --git a/types/antlr4/error/index.d.ts b/types/antlr4/error/index.d.ts new file mode 100644 index 0000000000..3ef46979d3 --- /dev/null +++ b/types/antlr4/error/index.d.ts @@ -0,0 +1,3 @@ +export * from './ErrorListener'; +export * from './ErrorStrategy'; +export * from './Errors'; diff --git a/types/antlr4/index.d.ts b/types/antlr4/index.d.ts new file mode 100644 index 0000000000..1d6fc4c003 --- /dev/null +++ b/types/antlr4/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for antlr4 4.7 +// Project: https://github.com/antlr/antlr4 +// Definitions by: Marlon Chatman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export * from './Lexer'; +export * from './Parser'; +export * from './Recognizer'; +export * from './ParserRuleContext'; +export * from './IntervalSet'; +export * from './CommonTokenStream'; +export * from './InputStream'; +export * from './Token'; +import { ParserRuleContext } from './ParserRuleContext'; + +export type AntlrRule = ParserRuleContext; diff --git a/types/antlr4/tree/Tree.d.ts b/types/antlr4/tree/Tree.d.ts new file mode 100644 index 0000000000..45a91a3bfa --- /dev/null +++ b/types/antlr4/tree/Tree.d.ts @@ -0,0 +1,80 @@ +import { Interval } from '../IntervalSet'; +import { Token } from '../Token'; +import { ParserRuleContext } from '../ParserRuleContext'; + +export const INVALID_INTERVAL: Interval; + +export class ParseTree { +} + +export class RuleNode extends ParseTree { +} + +export class TerminalNode implements ParseTree { + constructor(symbol: Token); + + getChild(i: number): any; + + getSymbol(): Token; + + getParent(): any; + + getPayload(): Token; + + getSourceInterval(): Interval; + + getChildCount(): number; + + accept(visitor: ParseTreeVisitor): any; + + getText(): string; + + toString(): string; + + readonly parentCtx: any; + readonly symbol: Token; +} + +export class ErrorNode extends TerminalNode { +} + +export class ParseTreeVisitor { + visit(ctx: ParserRuleContext): any; + + visitChildren(ctx: ParserRuleContext): any; + + visitTerminal(node: TerminalNode): any; + + visitErrorNode(node: ErrorNode): any; +} + +export interface ParseTreeListener { + visitTerminal(node: TerminalNode): void; + + visitErrorNode(node: ErrorNode): void; + + enterEveryRule(node: ParserRuleContext): void; + + exitEveryRule(node: ParserRuleContext): void; +} + +export class TerminalNodeImpl extends TerminalNode { +} + +export class ErrorNodeImpl extends TerminalNode { + constructor(token: Token); + + isErrorNode(): boolean; + + accept(visitor: ParseTreeVisitor): any; +} + +export class ParseTreeWalker { + static readonly DEFAULT: ParseTreeWalker; + + walk(listener: ParseTreeListener, rule: any): void; + + enterRule(listener: ParseTreeListener, rule: any): void; + + exitRule(listener: ParseTreeListener, rule: any): void; +} diff --git a/types/antlr4/tsconfig.json b/types/antlr4/tsconfig.json new file mode 100644 index 0000000000..32f7586a75 --- /dev/null +++ b/types/antlr4/tsconfig.json @@ -0,0 +1,39 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "error/ErrorListener.d.ts", + "error/Errors.d.ts", + "error/ErrorStrategy.d.ts", + "error/index.d.ts", + "tree/Tree.d.ts", + "antlr4-tests.ts", + "BufferedTokenStream.d.ts", + "CommonTokenStream.d.ts", + "index.d.ts", + "InputStream.d.ts", + "IntervalSet.d.ts", + "Lexer.d.ts", + "Parser.d.ts", + "ParserRuleContext.d.ts", + "Recognizer.d.ts", + "RuleContext.d.ts", + "Token.d.ts" + ] +} diff --git a/types/react-dnd-test-backend/tslint.json b/types/antlr4/tslint.json similarity index 100% rename from types/react-dnd-test-backend/tslint.json rename to types/antlr4/tslint.json diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index a82ec2f36b..bd2749f737 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Khan/aphrodite // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as CSS from "csstype"; diff --git a/types/apollo-codegen/apollo-codegen-tests.ts b/types/apollo-codegen/apollo-codegen-tests.ts index 38d9733faf..2c78f26fa9 100644 --- a/types/apollo-codegen/apollo-codegen-tests.ts +++ b/types/apollo-codegen/apollo-codegen-tests.ts @@ -14,7 +14,7 @@ async function main() { "POST" ); - generate(["input.ts"], "schema.json", "types.ts", "typescript", "gql", { + generate(["input.ts"], "schema.json", "types.ts", "", "typescript", "gql", "", { passthroughCustomScalars: false, customScalarsPrefix: "S", addTypename: false, diff --git a/types/apollo-codegen/index.d.ts b/types/apollo-codegen/index.d.ts index a506f7475e..ea5d415418 100644 --- a/types/apollo-codegen/index.d.ts +++ b/types/apollo-codegen/index.d.ts @@ -1,13 +1,15 @@ -// Type definitions for apollo-codegen 0.16 +// Type definitions for apollo-codegen 0.20 // Project: https://github.com/apollographql/apollo-codegen -// Definitions by: Bradley Ayers +// Definitions by: Bradley Ayers , Maria Carrasco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { Options } from 'graphql/utilities/schemaPrinter'; + export function downloadSchema( url: string, outputPath: string, - additionalHeaders: { [name: string]: string }, + additionalHeaders: { [name: string]: string; }, insecure: boolean, method: string ): Promise; @@ -19,22 +21,29 @@ export function introspectSchema( export function printSchema( schemaPath: string, - outputPath: string + outputPath: string, + options?: Options ): Promise; +export type TargetType = 'json' | 'swift' | 'ts-legacy' | 'typescript-legacy' | 'flow-legacy' | 'scala' | 'flow' | 'typescript' | 'ts'; + export function generate( inputPaths: string[], schemaPath: string, outputPath: string, - target: "json" | "swift" | "ts" | "typescript" | "flow" | "scala", + only: string, + target: TargetType, tagName: string, + projectName: string, options: { - passthroughCustomScalars: boolean; - customScalarsPrefix: string; - addTypename: boolean; - namespace: string; - operationIdsPath: string | null; - generateOperationIds: boolean; - mergeInFieldsFromFragmentSpreads: boolean; + passthroughCustomScalars?: boolean; + customScalarsPrefix?: string; + addTypename?: boolean; + namespace?: string; + operationIdsPath?: string | null; + generateOperationIds?: boolean; + mergeInFieldsFromFragmentSpreads?: boolean; + useFlowExactObjects?: boolean; + useFlowReadOnlyTypes?: boolean; } ): void; diff --git a/types/apollo-upload-client/apollo-upload-client-tests.ts b/types/apollo-upload-client/apollo-upload-client-tests.ts new file mode 100644 index 0000000000..4db60bfaf3 --- /dev/null +++ b/types/apollo-upload-client/apollo-upload-client-tests.ts @@ -0,0 +1,16 @@ +import { createUploadLink, ReactNativeFile } from "apollo-upload-client"; + +new ReactNativeFile({ + name: "its coming home", + type: "its coming", + uri: "football's coming home", +}); + +createUploadLink({ + fetch: (uri, options) => fetch(`http://localhost/${uri}`, options), + fetchOptions: { method: "GET" }, + headers: { special: "Special header value" }, + includeExtensions: true, + uri: "http://localhost", + credentials: "beepboop", +}); diff --git a/types/apollo-upload-client/index.d.ts b/types/apollo-upload-client/index.d.ts new file mode 100644 index 0000000000..7c1e3cb7b6 --- /dev/null +++ b/types/apollo-upload-client/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for apollo-upload-client 8.1 +// Project: https://github.com/jaydenseric/apollo-upload-client#readme +// Definitions by: Edward Sammut Alessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { ApolloLink } from "apollo-link"; +import { HttpOptions } from "apollo-link-http-common"; + +export { ReactNativeFile } from "extract-files"; + +/** + * `createUploadLink` options match `createHttpLink` options + * @param linkOptions `HttpOptions` + */ +export function createUploadLink(linkOptions?: HttpOptions): ApolloLink; diff --git a/types/apollo-upload-client/package.json b/types/apollo-upload-client/package.json new file mode 100644 index 0000000000..580aaf19c4 --- /dev/null +++ b/types/apollo-upload-client/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "apollo-link": "^1.0.0", + "apollo-link-http-common": "^0.2.4" + } +} diff --git a/types/apollo-upload-client/tsconfig.json b/types/apollo-upload-client/tsconfig.json new file mode 100644 index 0000000000..2a023ff111 --- /dev/null +++ b/types/apollo-upload-client/tsconfig.json @@ -0,0 +1,23 @@ +{ + "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", + "apollo-upload-client-tests.ts" + ] +} diff --git a/types/apollo-upload-client/tslint.json b/types/apollo-upload-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/apollo-upload-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/applicationinsights-js/applicationinsights-js-tests.ts b/types/applicationinsights-js/applicationinsights-js-tests.ts index 49c68181f8..6588c3fcd3 100644 --- a/types/applicationinsights-js/applicationinsights-js-tests.ts +++ b/types/applicationinsights-js/applicationinsights-js-tests.ts @@ -17,17 +17,24 @@ const config: Microsoft.ApplicationInsights.IConfig = { autoTrackPageVisitTime: true, disableExceptionTracking: false, disableAjaxTracking: false, + disableFetchTracking: true, overridePageViewDuration: false, maxAjaxCallsPerView: -1, disableDataLossAnalysis: true, disableCorrelationHeaders: true, + correlationHeaderExcludedDomains: [], disableFlushOnBeforeUnload: false, enableSessionStorageBuffer: false, cookieDomain: "", isCookieUseDisabled: true, isRetryDisabled: true, - isPerfAnalyzerEnabled: true, - isStorageUseDisabled: true + url: "url", + isStorageUseDisabled: true, + isBeaconApiDisabled: false, + sdkExtension: "sdkExtension", + isBrowserLinkTrackingEnabled: false, + appId: "appId", + enableCorsCorrelation: false }; appInsights = { @@ -175,3 +182,8 @@ const traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", nu const traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj); const traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType); context.track(traceEnvelope); + +// UtilHelpers +let Util: typeof Microsoft.ApplicationInsights.UtilHelpers; + +Util.newId(); diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 4214837ddf..517324cde4 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for ApplicationInsights-JS 1.0 // Project: https://github.com/Microsoft/ApplicationInsights-JS // Definitions by: Kamil Szostak +// Mark Wolff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module AI { @@ -560,19 +561,24 @@ declare module Microsoft.ApplicationInsights { samplingPercentage?: number; autoTrackPageVisitTime?: boolean; disableAjaxTracking?: boolean; + disableFetchTracking?: boolean; overridePageViewDuration?: boolean; maxAjaxCallsPerView?: number; disableDataLossAnalysis?: boolean; disableCorrelationHeaders?: boolean; + correlationHeaderExcludedDomains?: string[]; disableFlushOnBeforeUnload?: boolean; enableSessionStorageBuffer?: boolean; isCookieUseDisabled?: boolean; cookieDomain?: string; isRetryDisabled?: boolean; - isPerfAnalyzerEnabled?: boolean; url?: string; isStorageUseDisabled?: boolean; isBeaconApiDisabled?: boolean; + sdkExtension?: string; + isBrowserLinkTrackingEnabled?: boolean; + appId?: string; + enableCorsCorrelation?: boolean; } /** @@ -793,10 +799,18 @@ declare module Microsoft.ApplicationInsights { */ _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any; } + + class UtilHelpers { + /** + * Generate a random ID string + */ + static newId(): string; + } } declare module 'applicationinsights-js' { const AppInsights: Microsoft.ApplicationInsights.IAppInsights; + const Util: typeof Microsoft.ApplicationInsights.UtilHelpers; } declare var appInsights: Microsoft.ApplicationInsights.IAppInsights; diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts index 7e0fd6383e..98315235ea 100644 --- a/types/arangodb/arangodb-tests.ts +++ b/types/arangodb/arangodb-tests.ts @@ -96,3 +96,13 @@ console.log( RETURN u `.toArray() ); + +const view = db._view("yolo")!; +view.properties({ + locale: "C", + commit: { + consolidate: { + bytes: { segmentThreshold: 20 } + } + } +}); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index 5c3f56020f..be738e6717 100644 --- a/types/arangodb/index.d.ts +++ b/types/arangodb/index.d.ts @@ -837,11 +837,68 @@ declare namespace ArangoDB { // Views - interface View { - // TODO - [key: string]: any; + interface ArangoSearchView { + _dbName: string; + _id: string; + name(): string; + type(): ViewType; + rename(newName: string): void; + properties( + newProperties?: ArangoSearchViewPropertiesOptions + ): ArangoSearchViewProperties; + } + + interface ArangoSearchViewConsolidate { + threshold: number; + segmentThreshold: number; + } + + interface ArangoSearchViewCollectionLink { + analyzers?: string[]; + fields?: { [key: string]: ArangoSearchViewCollectionLink | undefined }; + includeAllFields?: boolean; + trackListPositions?: boolean; + storeValues?: "none" | "id"; + } + + interface ArangoSearchViewProperties { + id: string; + name: string; + type: "arangosearch"; + commit: { + cleanupIntervalStep: number; + commitIntervalMsec: number; + consolidate: { + bytes?: ArangoSearchViewConsolidate; + bytes_accum?: ArangoSearchViewConsolidate; + count?: ArangoSearchViewConsolidate; + fill?: ArangoSearchViewConsolidate; + }; + }; + locale: string; + links: { + [key: string]: ArangoSearchViewCollectionLink | undefined; + }; + } + + interface ArangoSearchViewPropertiesOptions { + locale?: string; + commit?: { + consolidate?: + | "none" + | { + count?: Partial; + bytes?: Partial; + bytes_accum?: Partial; + fill?: Partial; + }; + commitIntervalMsec?: number; + cleanupIntervalStep?: number; + }; + links?: { + [key: string]: ArangoSearchViewCollectionLink | undefined; + }; } - type ViewProperties = object; // TODO // Global @@ -923,13 +980,13 @@ declare namespace ArangoDB { ): DocumentMetadata; // Views - _view(name: string): View | null; - _views(): View[]; + _view(name: string): ArangoSearchView | null; + _views(): ArangoSearchView[]; _createView( name: string, type: ViewType, - properties: ViewProperties - ): View; + properties: ArangoSearchViewPropertiesOptions + ): ArangoSearchView; _dropView(name: string): void; // Global @@ -1392,7 +1449,7 @@ declare module "@arangodb/foxx/router" { } declare module "@arangodb/foxx/graphql" { - import { GraphQLSchema, formatError } from "graphql"; + import { formatError, GraphQLSchema } from "graphql"; type GraphQLModule = object; type GraphQLFormatErrorFunction = typeof formatError; interface GraphQLOptions { diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 4944b00bf2..97eb679110 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.7 +// Type definitions for ArcGIS API for JavaScript 4.8 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson @@ -156,6 +156,10 @@ declare namespace __esri { export type BaseTileLayerLayerviewDestroyEventHandler = (event: BaseTileLayerLayerviewDestroyEvent) => void; + export type BingMapsLayerLayerviewCreateEventHandler = (event: BingMapsLayerLayerviewCreateEvent) => void; + + export type BingMapsLayerLayerviewDestroyEventHandler = (event: BingMapsLayerLayerviewDestroyEvent) => void; + export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; @@ -620,6 +624,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html) */ interface config { + /** + * The URL for font resources used by the [Font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) class with 2D WebGL enabled [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). To use your own hosted fonts, make sure to follow our naming conventions (e.g. "arial-unicode-ms-bold"). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#fontsUrl) + * + * @default "https://static.arcgis.com/fonts" + */ + fontsUrl: string; /** * The default [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) used by widgets and other operations, such as on-the-fly projections. * @@ -668,6 +680,10 @@ declare namespace __esri { export const config: config; + export type AfterInterceptorCallback = (response: RequestResponse) => void; + + export type BeforeInterceptorCallback = (params: any) => any; + export interface configRequest extends Object { /** @@ -685,42 +701,7 @@ declare namespace __esri { */ corsDetectionTimeout?: number; /** - * A list of servers known to support CORS specification. Out of the box, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The library is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`), but if you are already aware that a server supports CORS, then it should be added to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. The following servers are enabled by default: - * * `basemaps.arcgis.com` (added in 4.3) - * * `demographics1.arcgis.com` (added in 4.4) - * * `demographics2.arcgis.com` (added in 4.4) - * * `demographics3.arcgis.com` (added in 4.4) - * * `demographics4.arcgis.com` (added in 4.4) - * * `demographics5.arcgis.com` (added in 4.4) - * * `demographics6.arcgis.com` (added in 4.4) - * * `elevation3d.arcgis.com` - * * `geocode.arcgis.com` - * * `geoenrich.arcgis.com` - * * `js.arcgis.com` - * * `server.arcgisonline.com` - * * `services.arcgis.com` - * * `services.arcgisonline.com` - * * `services1.arcgis.com` - * * `services2.arcgis.com` - * * `services3.arcgis.com` - * * `services4.arcgis.com` - * * `services5.arcgis.com` - * * `services6.arcgis.com` - * * `services7.arcgis.com` - * * `services8.arcgis.com` - * * `services9.arcgis.com` - * * `static.arcgis.com` - * * `tiles.arcgis.com` - * * `tiles1.arcgis.com` - * * `tiles2.arcgis.com` - * * `tiles3.arcgis.com` - * * `tiles4.arcgis.com` - * * `utility.arcgis.com` (added in 4.4) - * * `utility.arcgisonline.com` - * * `www.arcgis.com` - * - * - * Example: + * A list of servers known to support CORS specification. By default, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The API is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`). If you are aware that a server supports CORS, add it to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. Example: * ```js * // Add a known server to the list. * require(["esri/config"], function(esriConfig) { @@ -749,6 +730,37 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ httpsDomains?: string[]; + /** + * Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: + * ```js + * const featureLayerUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0"; + * + * esriConfig.request.interceptors.push({ + * // set the `urls` property to the URL of the FeatureLayer so that this + * // interceptor only applies to requests made to the FeatureLayer URL + * urls: featureLayerUrl, + * // use the BeforeInterceptorCallback to check if the query of the + * // FeatureLayer has a maxAllowableOffset property set. + * // if so, then set the maxAllowableOffset to 0 + * before: function(params) { + * if (params.requestOptions.query.maxAllowableOffset) { + * params.requestOptions.query.maxAllowableOffset = 0; + * } + * }, + * // use the AfterInterceptorCallback to check if `ssl` is set to 'true' + * // on the response to the request, if it's set to 'false', change + * // the value to 'true' before returning the response + * after: function(response) { + * if (!response.ssl) { + * response.ssl = true; + * } + * } + * }); + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ + interceptors?: RequestInterceptor[]; /** * Maximum number of characters allowed in the URL for HTTP GET requests made by [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). If this limit is exceeded, HTTP POST method will be used. * @@ -807,7 +819,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ - host?: string; + host?: string | RegExp; /** * Indicates whether requests made to the associated server should include credentials such as cookies and authorization headers. * @@ -884,6 +896,50 @@ declare namespace __esri { packages?: any[]; } + /** + * Specifies the object used for intercepting and modifying requests made via [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + export interface RequestInterceptor extends Object { + /** + * Makes changes to the response after the request is sent, but before it's returned to the caller. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + after?: AfterInterceptorCallback; + /** + * Callback function that can make changes to the URL or options before the request is sent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + before?: BeforeInterceptorCallback; + /** + * Sets or adds headers into `requestOptions.headers`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + headers?: any; + /** + * Sets or adds a query parameter into `requestOptions.query`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + query?: any; + /** + * Hardcodes the response. The request will not be sent. This is resolved as the response `data`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + responseData?: any; + /** + * Specifies the URL(s) to apply to the interceptors. If the value is type `String`, then it matches if the request URL starts with that string. If null or undefined, the interceptor will apply to all relevant requests. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) + */ + urls?: string | RegExp | (string | RegExp)[]; + } + export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; @@ -1179,7 +1235,7 @@ declare namespace __esri { interface JSONSupport { /** - * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * Converts an instance of [this class]() to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#toJSON) * @@ -1254,15 +1310,6 @@ declare namespace __esri { */ readonly loadWarnings: any[]; - /** - * **Deprecated at 4.7.** `always()` may be used to execute a function if creating an instance of the class is rejected or resolved. The input function will always execute no matter the response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#always) - * - * @param callbackOrErrback The function to execute when creating an instance of the class is rejected or resolved. - * - */ - always(callbackOrErrback?: Function): IPromise; /** * Cancels a [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation if it is already in progress. * @@ -1303,15 +1350,6 @@ declare namespace __esri { * */ load(): IPromise; - /** - * **Deprecated at 4.7.** Use `otherwise()` to call a function once creating an instance of the class is rejected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#otherwise) - * - * @param errback The function to execute when creating an instance of the class fails. - * - */ - otherwise(errback?: Function): IPromise; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. * @@ -1337,15 +1375,6 @@ declare namespace __esri { } interface corePromise { - /** - * **Deprecated at 4.7.** `always()` may be used to execute a function if creating an instance of the class is rejected or resolved. The input function will always execute no matter the response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#always) - * - * @param callbackOrErrback The function to execute when creating an instance of the class is rejected or resolved. - * - */ - always(callbackOrErrback?: Function): IPromise; /** * `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. * @@ -1370,15 +1399,6 @@ declare namespace __esri { * */ isResolved(): boolean; - /** - * **Deprecated at 4.7.** Use `otherwise()` to call a function once creating an instance of the class is rejected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#otherwise) - * - * @param errback The function to execute when creating an instance of the class fails. - * - */ - otherwise(errback?: Function): IPromise; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. * @@ -2136,7 +2156,7 @@ declare namespace __esri { * * @param coordinates The MGRS notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) referenced by the MGRS coordinates. If `null`, WGS84 will be used. - * @param conversionMode The mode used by the given MGRS coordinates. **Known values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 + * @param conversionMode The mode used by the given MGRS coordinates. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 * */ fromMgrs(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; @@ -2162,7 +2182,7 @@ declare namespace __esri { * * @param coordinates The UTM notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) that the UTM coordinates are in. If `null`, WGS84 will be used. - * @param conversionMode The latitude notation scheme used by the given UTM coordinates, either a latitudinal band, or a hemisphere designator. **Known values**: latitude-band-indicators | north-south-indicators + * @param conversionMode The latitude notation scheme used by the given UTM coordinates, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators * */ fromUtm(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; @@ -2212,7 +2232,7 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toLatitudeLongitude) * * @param point The location to be represented as a formatted latitude/longitude string. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). - * @param format The mode to use when formatting the latitude/longitude string. **Known values**: dd | ddm | dms + * @param format The mode to use when formatting the latitude/longitude string. **Possible Values**: dd | ddm | dms * @param decimalPlaces The number of decimal places to use, it should be an integer from 0 to 16. * */ @@ -2239,7 +2259,7 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toMgrs) * * @param point The location to be represented in MGRS notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) - * @param conversionMode The mode to use for the returned MGRS notation string. **Known values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 + * @param conversionMode The mode to use for the returned MGRS notation string. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 * @param precision The precision with which to represent the coordinates, it should be an integer from 0 to 8. * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values. * @@ -2289,7 +2309,7 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUtm) * * @param point The location to be represented in UTM notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) - * @param conversionMode The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator. **Known values**: latitude-band-indicators | north-south-indicators + * @param conversionMode The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the UTM zone and latitude designator and each numerical easting and northing value. * */ @@ -2569,7 +2589,7 @@ declare namespace __esri { */ readonly cache: any; /** - * The extent of the geometry. For points, the extent is null. + * The extent of the geometry. For a point, the extent is null. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#extent) */ @@ -4602,7 +4622,7 @@ declare namespace __esri { * @param extent An extent used to determine the suitability of the returned transformation. The extent will be re-projected to the `inSpatialReference` if it has a different spatial reference. * */ - getTransformation(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference, extent?: Extent): GeographicTransformation; + getTransformation(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation; /** * Returns a list of all geographic transformations suitable to convert geometries from the input spatial reference to the specified output spatial reference. The list is ordered in descending order by suitability, with the most suitable being first in the list. * > **Known Limitations** @@ -4616,7 +4636,7 @@ declare namespace __esri { * @param extent An extent used to determine the suitability of the returned transformations. The extent will be re-projected to the input spatial reference if necessary. * */ - getTransformations(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference, extent?: Extent): GeographicTransformation[]; + getTransformations(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation[]; /** * Indicates if all dependencies of this module have been loaded. * @@ -5289,7 +5309,7 @@ declare namespace __esri { */ layer: Layer; /** - * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ @@ -5326,6 +5346,14 @@ declare namespace __esri { * */ getAttribute(name: string): any; + /** + * Returns the popup template applicable for the graphic. It's either the value of [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) or the `popupTemplate` from the graphic's layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) + * + * + */ + getEffectivePopupTemplate(): PopupTemplate; /** * Sets a new value to the specified attribute. * @@ -5373,7 +5401,7 @@ declare namespace __esri { */ layer?: LayerProperties; /** - * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ @@ -5409,6 +5437,28 @@ declare namespace __esri { * @default false */ readonly loaded: boolean; + /** + * Specifies the user navigation constraints relative to the ground surface. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) + */ + navigationConstraint: GroundNavigationConstraint; + /** + * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) + * + * @default 1 + */ + opacity: number; + /** + * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) + * + * @default null + */ + surfaceColor: Color; /** * Creates a deep clone of this object. @@ -5464,6 +5514,28 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) */ layers?: CollectionProperties; + /** + * Specifies the user navigation constraints relative to the ground surface. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) + */ + navigationConstraint?: GroundNavigationConstraintProperties; + /** + * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) + * + * @default 1 + */ + opacity?: number; + /** + * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) + * + * @default null + */ + surfaceColor?: Color | number[] | string; } /** @@ -5505,6 +5577,39 @@ declare namespace __esri { } + export interface GroundNavigationConstraintProperties extends Object { + /** + * The type of the constraint. It can be one of the following: + * + * Value | Description + * -----------|-------------------- + * stay-above | User can only navigate above ground surface + * none | User can navigate above and below the ground surface + * + * Default value: stay-above + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) + */ + type?: string; + } + + export interface GroundNavigationConstraint extends AnonymousAccessor { + /** + * The type of the constraint. It can be one of the following: + * + * Value | Description + * -----------|-------------------- + * stay-above | User can only navigate above ground surface + * none | User can navigate above and below the ground surface + * + * Default value: stay-above + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) + */ + type: string; + } + + export interface GroundQueryElevationOptions extends Object { /** * Indicates whether to return additional sample information for each sampled coordinate. @@ -6614,12 +6719,12 @@ declare namespace __esri { * * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row The row (y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * @param column The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param col The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. * */ - fetchTile(level: number, row: number, column: number, options?: BaseTileLayerFetchTileOptions): IPromise; + fetchTile(level: number, row: number, col: number, options?: BaseTileLayerFetchTileOptions): IPromise; /** * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: * @@ -6647,10 +6752,10 @@ declare namespace __esri { * * @param level Level of detail. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row Tile row. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * @param column Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param col Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * */ - getTileUrl(level: number, row: number, column: number): string | IPromise; + getTileUrl(level: number, row: number, col: number): string | IPromise; on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; @@ -6711,6 +6816,119 @@ declare namespace __esri { view: View; } + interface BingMapsLayer extends BaseTileLayer { + /** + * Expose Bing logo url. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#bingLogo) + */ + readonly bingLogo: string; + /** + * Copyright information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#copyright) + */ + readonly copyright: string; + /** + * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) + * + * @default "en-US" + */ + culture: string; + /** + * Bing Maps Key. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) + * + * @default null + */ + key: string; + /** + * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) + * + * @default null + */ + region: string; + /** + * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) + * + * @default "road" + */ + style: string; + + + on(name: "layerview-create", eventHandler: BingMapsLayerLayerviewCreateEventHandler): IHandle; + + on(name: "layerview-destroy", eventHandler: BingMapsLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BingMapsLayerConstructor { + /** + * This layer supports Microsoft's Bing tiled map content. Three map styles are supported - `road`, `aerial` and `hybrid`. Please note that a valid [Bing Maps key](https://msdn.microsoft.com/en-us/library/ff428642.aspx) is required to use this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html) + */ + + new(properties?: BingMapsLayerProperties): BingMapsLayer; + } + + export const BingMapsLayer: BingMapsLayerConstructor; + + interface BingMapsLayerProperties extends BaseTileLayerProperties { + /** + * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) + * + * @default "en-US" + */ + culture?: string; + /** + * Bing Maps Key. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) + * + * @default null + */ + key?: string; + /** + * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) + * + * @default null + */ + region?: string; + /** + * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) + * + * @default "road" + */ + style?: string; + } + + export interface BingMapsLayerLayerviewCreateEvent { + + layerView: LayerView; + + view: View; + } + + export interface BingMapsLayerLayerviewDestroyEvent { + + layerView: LayerView; + + view: View; + } + interface CSVLayer extends Layer { /** * Copyright information for the layer. @@ -6758,19 +6976,24 @@ declare namespace __esri { */ fields: Field[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -6860,17 +7083,23 @@ declare namespace __esri { */ url: string; + /** + * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createQuery) + * + * + */ + createQuery(): Query; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **Known Limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryExtent) * @@ -6880,15 +7109,13 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the number of features that satisfy the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **Known Limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatureCount) * @@ -6898,15 +7125,13 @@ declare namespace __esri { queryFeatureCount(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **Known Limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatures) * @@ -6916,15 +7141,13 @@ declare namespace __esri { queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. - * > **Capabilities and Limitations** The following lists capabilities with some limitations when executing a query: - * * Use [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) to query based on a SQL where clause. - * * You can perform spatial queries using the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) parameters with the following limitations: - * * The `geometry` parameter only supports [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries. - * * The only supported `spatialRelationship` is `intersects`. - * * The `distance` and `units` parameters are not supported. - * * You can query fields for statistics using onStatisticField. However, - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The `orderByField` param is not supported. + * > **Known Limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryObjectIds) * @@ -6998,19 +7221,24 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * WebGL must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -7277,7 +7505,7 @@ declare namespace __esri { rotation?: number; } - interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { + interface ElevationLayer extends Layer, ArcGISCachedService, PortalLayer { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. * @@ -7317,6 +7545,17 @@ declare namespace __esri { * */ fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; + /** + * This method returns a URL to a tile for a given level, row and column. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#getTileUrl) + * + * @param level The requested tile's level. + * @param row The requested tile's row. + * @param col The requested tile's column. + * + */ + getTileUrl(level: number, row: number, col: number): string; /** * Queries the service layer for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the service. The resolution from which the elevation is queried can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. * @@ -7358,7 +7597,7 @@ declare namespace __esri { export const ElevationLayer: ElevationLayerConstructor; - interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { + interface ElevationLayerProperties extends LayerProperties, ArcGISCachedServiceProperties, PortalLayerProperties { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. * @@ -7517,7 +7756,7 @@ declare namespace __esri { */ featureReduction: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ @@ -7529,7 +7768,7 @@ declare namespace __esri { */ readonly gdbVersion: string; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -7565,19 +7804,26 @@ declare namespace __esri { */ historicMoment: Date; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -7600,7 +7846,7 @@ declare namespace __esri { */ legendEnabled: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -7626,25 +7872,25 @@ declare namespace __esri { */ popupTemplate: PopupTemplate; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ renderer: Renderer; /** - * When `true`, indicates that M values will be returned. + * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) * - * @default false + * @default undefined */ returnM: boolean; /** - * When `true`, indicates that Z values will be returned. + * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) * - * @default false + * @default undefined */ returnZ: boolean; /** @@ -7657,13 +7903,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source: Collection; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -7854,13 +8100,13 @@ declare namespace __esri { */ featureReduction?: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields?: FieldProperties[]; /** - * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ @@ -7872,19 +8118,26 @@ declare namespace __esri { */ historicMoment?: DateProperties; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** + * * [WebGL](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-rendering) must be enabled in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) for labels to display. Be sure to review the [WebGL limitations](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#webgl-limitations). + * * Currently only FeatureLayers with point and polygon geometries are supported. + * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -7907,7 +8160,7 @@ declare namespace __esri { */ legendEnabled?: boolean; /** - * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ @@ -7933,25 +8186,25 @@ declare namespace __esri { */ popupTemplate?: PopupTemplateProperties; /** - * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ renderer?: RendererProperties; /** - * When `true`, indicates that M values will be returned. + * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) * - * @default false + * @default undefined */ returnM?: boolean; /** - * When `true`, indicates that Z values will be returned. + * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) * - * @default false + * @default undefined */ returnZ?: boolean; /** @@ -7964,13 +8217,13 @@ declare namespace __esri { */ screenSizePerspectiveEnabled?: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source?: CollectionProperties; /** - * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ @@ -8356,7 +8609,7 @@ declare namespace __esri { export interface FeatureLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. [returnZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) must be set to `true` if z-values of the features should be considered for the elevation mode. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * Defines how the graphic is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. * * Mode | Description * ------|------------ @@ -8556,6 +8809,12 @@ declare namespace __esri { * @default true */ screenSizePerspectiveEnabled: boolean; + /** + * For [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) the type is `graphics`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#type) + */ + readonly type: "graphics"; /** * Adds a graphic to the layer. @@ -9021,7 +9280,7 @@ declare namespace __esri { */ id: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. * * Value | Description * ------|------------ @@ -9131,7 +9390,7 @@ declare namespace __esri { */ id?: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. * * Value | Description * ------|------------ @@ -9274,30 +9533,24 @@ declare namespace __esri { } interface ArcGISCachedService { + /** + * The copyright text as defined by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) + */ + copyright: string; + /** + * The spatial reference of the layer as defined by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#spatialReference) + */ + readonly spatialReference: SpatialReference; /** * Contains information about the tiling scheme for the layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) */ tileInfo: TileInfo; - - /** - * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#fromJSON) - * - * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects. - * - */ - fromJSON(json: any): any; - /** - * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#toJSON) - * - * - */ - toJSON(): any; } interface ArcGISCachedServiceConstructor { @@ -9311,6 +9564,12 @@ declare namespace __esri { export const ArcGISCachedService: ArcGISCachedServiceConstructor; interface ArcGISCachedServiceProperties { + /** + * The copyright text as defined by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) + */ + copyright?: string; /** * Contains information about the tiling scheme for the layer. * @@ -9341,7 +9600,7 @@ declare namespace __esri { */ gdbVersion: string; /** - * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) * @@ -9379,6 +9638,19 @@ declare namespace __esri { */ sublayers: Collection; + /** + * Gets the parameters of the exported image to use when calling the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-map.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) + * + * @param extent The extent of the exported image + * @param width The width of the exported image + * @param height The height of the exported image + * @param options The parameter options is an object with the following properties. + * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. + * + */ + createExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceCreateExportImageParametersOptions): any; /** * Returns a deep clone of a map service's [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service. * @@ -9396,19 +9668,6 @@ declare namespace __esri { * */ findSublayerById(id: number): Sublayer; - /** - * Gets the parameters of the exported image to use when calling the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-map.htm). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#getExportImageParameters) - * - * @param extent The extent of the exported image - * @param width The width of the exported image - * @param height The height of the exported image - * @param options The parameter options is an object with the following properties. - * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - */ - getExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; } interface ArcGISDynamicMapServiceConstructor { @@ -9435,7 +9694,7 @@ declare namespace __esri { */ gdbVersion?: string; /** - * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) * @@ -9475,11 +9734,11 @@ declare namespace __esri { } - export interface ArcGISDynamicMapServiceGetExportImageParametersOptions extends Object { + export interface ArcGISDynamicMapServiceCreateExportImageParametersOptions extends Object { /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#getExportImageParameters) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) */ rotation?: number; } @@ -9524,7 +9783,7 @@ declare namespace __esri { */ fields: Field[]; /** - * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) * @@ -9578,7 +9837,7 @@ declare namespace __esri { */ multidimensionalInfo: any; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ @@ -9697,7 +9956,7 @@ declare namespace __esri { */ fields?: FieldProperties[]; /** - * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) * @@ -9751,7 +10010,7 @@ declare namespace __esri { */ multidimensionalInfo?: any; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ @@ -9798,7 +10057,13 @@ declare namespace __esri { interface ArcGISMapService { /** - * The copyright text as defined by the map service. + * Indicates the layer's supported capabilities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + readonly capabilities: ArcGISMapServiceCapabilities; + /** + * The copyright text as defined by the service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ @@ -9810,7 +10075,15 @@ declare namespace __esri { */ fullExtent: Extent; /** - * The spatial reference of the layer as defined by the map service. + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) + * + * @default true + */ + legendEnabled: boolean; + /** + * The spatial reference of the layer as defined by the service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#spatialReference) */ @@ -9821,6 +10094,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#token) */ readonly token: string; + /** + * The version of ArcGIS Server in which the map service is published. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#version) + */ + readonly version: number; } interface ArcGISMapServiceConstructor { @@ -9835,7 +10114,7 @@ declare namespace __esri { interface ArcGISMapServiceProperties { /** - * The copyright text as defined by the map service. + * The copyright text as defined by the service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ @@ -9846,6 +10125,96 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) */ fullExtent?: ExtentProperties; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) + * + * @default true + */ + legendEnabled?: boolean; + } + + + export interface ArcGISMapServiceCapabilities extends Object { + /** + * Indicates options supported by the exportMap operation. Will be `null` if the `supportsExportMap` is `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + exportMap: ArcGISMapServiceCapabilitiesExportMap; + /** + * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + exportTiles: ArcGISMapServiceCapabilitiesExportTiles; + /** + * Indicates operations that can be performed on the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + operations: ArcGISMapServiceCapabilitiesOperations; + } + + + export interface ArcGISMapServiceCapabilitiesExportMap extends Object { + /** + * Indicates if sublayers rendering can be modifyied or added using dynamic layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsDynamicLayers: boolean; + /** + * Indicates if sublayers [visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) can be changed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsSublayerVisibility: boolean; + /** + * Indicates if sublayers [definition expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) can be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsSublayerDefinitionExpression: boolean; + } + + + export interface ArcGISMapServiceCapabilitiesExportTiles extends Object { + /** + * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + maxExportTilesCount: number; + } + + + export interface ArcGISMapServiceCapabilitiesOperations extends Object { + /** + * Indicates if features in the sublayers can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsQuery: boolean; + /** + * Indicates if the service can generate images. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsExportMap: boolean; + /** + * Indicates if the tiles from the service can be exported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsExportTiles: boolean; + /** + * Indicates if the service exposes a tile map that describes the presence of tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) + */ + supportsTileMap: boolean; } interface PortalLayer { @@ -10080,8 +10449,6 @@ declare namespace __esri { new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; - - fromJSON(json: any): OpenStreetMapLayer; } export const OpenStreetMapLayer: OpenStreetMapLayerConstructor; @@ -10240,7 +10607,8 @@ declare namespace __esri { */ elevationInfo: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ @@ -10269,7 +10637,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -10412,7 +10780,8 @@ declare namespace __esri { */ elevationInfo?: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ @@ -10441,7 +10810,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -10887,7 +11256,7 @@ declare namespace __esri { */ description: string; /** - * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ @@ -10930,7 +11299,7 @@ declare namespace __esri { */ description?: string; /** - * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ @@ -10958,7 +11327,7 @@ declare namespace __esri { export interface FeatureTemplateThumbnail extends Object { /** - * The MIME type of the image. **Known Values:** image | png | jpg | jpeg + * The MIME type of the image. **Possible Values:** image | png | jpg | jpeg * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ @@ -11163,7 +11532,7 @@ declare namespace __esri { */ extent: Extent; /** - * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) * @@ -11195,7 +11564,7 @@ declare namespace __esri { */ layerIds: number[]; /** - * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ @@ -11249,7 +11618,7 @@ declare namespace __esri { */ extent?: ExtentProperties; /** - * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) * @@ -11281,7 +11650,7 @@ declare namespace __esri { */ layerIds?: number[]; /** - * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ @@ -11427,20 +11796,21 @@ declare namespace __esri { */ labelExpression: string; /** - * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo: LabelClassLabelExpressionInfo; /** - * The position of the label. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal * > **Known Limitations** - * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) then only "above-center" is supported. - * * 3D layers only support label placement for [Points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * + * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. + * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + * + * @default null */ labelPlacement: string; /** @@ -11472,7 +11842,8 @@ declare namespace __esri { */ useCodedValues: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ @@ -11490,7 +11861,7 @@ declare namespace __esri { interface LabelClassConstructor { /** - * Defines label expressions, symbols, scale ranges, label priorities, and sets of label placement options for different groups of labels on a layer. + * Defines label expressions, symbols, scale ranges, label priorities, and label placement options for labels on a layer. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) */ @@ -11510,20 +11881,21 @@ declare namespace __esri { */ labelExpression?: string; /** - * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo?: LabelClassLabelExpressionInfo; /** - * The position of the label. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal * > **Known Limitations** - * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) then only "above-center" is supported. - * * 3D layers only support label placement for [Points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * + * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. + * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. + * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries rendered with WebGL. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + * + * @default null */ labelPlacement?: string; /** @@ -11555,7 +11927,8 @@ declare namespace __esri { */ useCodedValues?: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ @@ -11565,13 +11938,13 @@ declare namespace __esri { export interface LabelClassLabelExpressionInfo extends Object { /** - * The expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** + * The SQL expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ value?: string; /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that evaluates to a string used to label features in the layer. The most simple expressions return field values. For example, to label a layer of cities with their names, simply reference the field value with the global variable: `$feature.CITY_NAME`. Expressions can be more sophisticated and use logical functions. This may be useful if you want to use classed labels. For example, the following expression appends `city` to the end of the label if the feature's population field contains a number greater than 10,000. Otherwise, `town` is appended to the end of the label. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that evaluates to a string used to label features in the layer. The most simple expressions return field values. For example, to label a layer of cities with their names, simply reference the field value with the global variable: `$feature.CITY_NAME`. Expressions can be more sophisticated and use logical functions. This may be useful if you want to use classed labels. For example, the following expression appends `city` to the end of the label if the feature's population field contains a number greater than 10,000. Otherwise, `town` is appended to the end of the label. Additionally, you can use `TextFormatting.NewLine` to add a new line to the label. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ @@ -11656,7 +12029,7 @@ declare namespace __esri { */ height: number; /** - * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ @@ -11715,7 +12088,7 @@ declare namespace __esri { */ height?: number; /** - * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ @@ -11766,7 +12139,7 @@ declare namespace __esri { */ lockRasterIds: number[]; /** - * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ @@ -11784,7 +12157,7 @@ declare namespace __esri { */ objectIds: number[]; /** - * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ @@ -11845,7 +12218,7 @@ declare namespace __esri { */ lockRasterIds?: number[]; /** - * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ @@ -11863,7 +12236,7 @@ declare namespace __esri { */ objectIds?: number[]; /** - * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ @@ -11914,7 +12287,7 @@ declare namespace __esri { */ pixels: number[][]; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ @@ -11931,42 +12304,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width: number; - - /** - * Adds another plane to the PixelBlock. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - * - * @param planeData The data to add to the PixelBlock. - * @param planeData.pixels A two dimensional array representing the pixels to add. - * @param planeData.statistics An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. - * - */ - addData(planeData: PixelBlockAddDataPlaneData): void; - /** - * Returns pixels and masks using a single array in bip format (e.g. [p_00_r, p_00_g, p_00_b, p_00_a, p_10_r, p_10_g, p_10_b, p_10_a, .....]). Use this method to get an unsigned 8 bit pixel array. The result can be used to create a webgl texture. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA) - * - * - */ - getAsRGBA(): number[]; - /** - * Similar to [getAsRGBA](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA), but returns floating point data. The result can be used to create a webgl texture (OES_texture_float). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBAFloat) - * - * - */ - getAsRGBAFloat(): number[]; - /** - * Returns the plane band count of the PixelBlock. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getPlaneCount) - * - * - */ - getPlaneCount(): number; } interface PixelBlockConstructor { @@ -11997,7 +12334,7 @@ declare namespace __esri { */ pixels?: number[][]; /** - * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ @@ -12017,22 +12354,6 @@ declare namespace __esri { } - export interface PixelBlockAddDataPlaneData extends Object { - /** - * A two dimensional array representing the pixels to add. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - */ - pixels: number[][]; - /** - * An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) - */ - statistics: any[]; - } - - export interface PixelBlockStatistics extends Object { /** * The maximum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. @@ -12108,7 +12429,7 @@ declare namespace __esri { */ functionName: string; /** - * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) * @@ -12151,7 +12472,7 @@ declare namespace __esri { */ functionName?: string; /** - * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) * @@ -12296,7 +12617,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible: boolean; /** @@ -12366,7 +12687,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ @@ -12374,8 +12695,8 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer sublayers. - * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer sublayers. + * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) */ @@ -12482,7 +12803,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) * - * @default false + * @default true */ labelsVisible?: boolean; /** @@ -12552,7 +12873,7 @@ declare namespace __esri { /** * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). * > **Known Limitations** - * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ @@ -12560,8 +12881,8 @@ declare namespace __esri { /** * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. * > **Known Limitations** - * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer sublayers. - * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6.1 map services (or later) created from ArcGIS Pro. + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on MapImageLayer sublayers. + * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) */ @@ -13481,61 +13802,25 @@ declare namespace __esri { title?: string; } - interface TiledLayer { - /** - * The tiling scheme information for the layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) - */ - tileInfo: TileInfo; - } - - interface TiledLayerConstructor { - - - new(properties?: TiledLayerProperties): TiledLayer; - - fromJSON(json: any): TiledLayer; - } - - export const TiledLayer: TiledLayerConstructor; - - interface TiledLayerProperties { - /** - * The tiling scheme information for the layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) - */ - tileInfo?: TileInfoProperties; - } - - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer, TiledLayer { + interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer { /** * The URL that points to the location of the layer's attribution data. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; - /** - * Indicates if the layer has attribution data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) - */ - readonly hasAttributionData: boolean; - /** - * Indicates whether the layer will be included in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) - * - * @default true - */ - legendEnabled: boolean; /** * An array of tile servers used for changing map tiles. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers: string[]; + /** + * For [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) the type is `tile`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#type) + */ + readonly type: "tile"; /** * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. * @@ -13550,12 +13835,13 @@ declare namespace __esri { * * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * @param column The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param col The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. + * @param options.timestamp Number to append to the tile request to prevent fetching the tile from the browser cache. * */ - fetchTile(level: number, row: number, column: number, options?: TileLayerFetchTileOptions): IPromise; + fetchTile(level: number, row: number, col: number, options?: TileLayerFetchTileOptions): IPromise; /** * This method returns a URL to a tile for a given level, row and column. * @@ -13588,15 +13874,7 @@ declare namespace __esri { export const TileLayer: TileLayerConstructor; - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties, TiledLayerProperties { - /** - * Indicates whether the layer will be included in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) - * - * @default true - */ - legendEnabled?: boolean; + interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties { /** * An array of tile servers used for changing map tiles. * @@ -13633,6 +13911,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) */ allowImageDataAccess?: boolean; + /** + * Number to append to the tile request to prevent fetching the tile from the browser cache. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) + */ + timestamp?: boolean; } interface UnknownLayer extends Layer { @@ -13705,19 +13989,31 @@ declare namespace __esri { view: View; } - interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { + interface VectorTileLayer extends Layer, ScaleRangeLayer { /** * The URL that points to the location of the layer's attribution data. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; + /** + * Indicates the layer's supported capabilities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + readonly capabilities: VectorTileLayerCapabilities; /** * The current style information of the VectorTileLayer. See the object specification below. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ readonly currentStyleInfo: VectorTileLayerCurrentStyleInfo; + /** + * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) + */ + portalItem: PortalItem; /** * The spatial reference of the layer. * @@ -13730,6 +14026,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style: any; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) + */ + tileInfo: TileInfo; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). * @@ -13744,7 +14046,7 @@ declare namespace __esri { url: string; /** - * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. + * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. When loading a style, it is the developer's responsibility to make sure that any relative urls in the style resolve correctly. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#loadStyle) * @@ -13773,7 +14075,13 @@ declare namespace __esri { export const VectorTileLayer: VectorTileLayerConstructor; - interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { + interface VectorTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + /** + * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) + */ + portalItem?: PortalItemProperties; /** * The spatial reference of the layer. * @@ -13786,6 +14094,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style?: any; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) + */ + tileInfo?: TileInfoProperties; /** * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. * @@ -13809,27 +14123,71 @@ declare namespace __esri { } + export interface VectorTileLayerCapabilities extends Object { + /** + * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + exportTiles: any; + + exportMap: VectorTileLayerCapabilitiesExportMap; + /** + * Indicates operations that can be performed on the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + operations: VectorTileLayerCapabilitiesOperations; + } + + + export interface VectorTileLayerCapabilitiesExportMap extends Object { + /** + * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + maxExportTilesCount: number; + } + + + export interface VectorTileLayerCapabilitiesOperations extends Object { + /** + * Indicates if the tiles from the service can be exported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + supportsExportTiles: boolean; + /** + * Indicates if the service exposes a tile map that describes the presence of tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) + */ + supportsTileMap: boolean; + } + + export interface VectorTileLayerCurrentStyleInfo extends Object { /** - * The URL of a vector tile service. + * Absolute URL for a vector tile service. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ serviceUrl: string; /** - * The URL of a style for vector tiles. + * Absolute URL for vector tile service style. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ styleUrl: string; /** - * The sprite URL included in a style. + * Asbolute URL for sprites included in a style. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ spriteUrl: string; /** - * The template URL of font sets for vector tiles. The URL includes `{fontstack}` and `{range}` tokens. + * Absolute template URL for font sets included in a style. The URL includes `{fontstack}` and `{range}` tokens. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ @@ -13848,7 +14206,7 @@ declare namespace __esri { layerDefinition: any; } - interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer, RefreshableLayer { + interface WebTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The attribution information for the layer. * @@ -13870,11 +14228,23 @@ declare namespace __esri { */ subDomains: string[]; /** - * The tile server names for the layer. + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) + */ + tileInfo: TileInfo; + /** + * The list of tile server urls for the layer. It's computed from the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) and the list of [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) */ - tileServers: string[]; + readonly tileServers: string[]; + /** + * For [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) the type is `web-tile`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#type) + */ + readonly type: "web-tile"; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. * @@ -13882,6 +14252,32 @@ declare namespace __esri { */ urlTemplate: string; + /** + * This method fetches a tile for the given level, row and column present in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) + * + * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param column The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param options Optional settings for the tile request. The options have the following properties. + * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. + * @param options.timestamp A timestamp to append to the tile url to avoid loading a cached version of the tile. + * + */ + fetchTile(level: number, row: number, column: number, options?: WebTileLayerFetchTileOptions): IPromise; + /** + * This method returns a URL to a tile for a given level, row and column. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#getTileUrl) + * + * @param level The requested tile's level. + * @param row The requested tile's row. + * @param column The requested tile's column. + * + */ + getTileUrl(level: number, row: number, column: number): string; + on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; @@ -13896,13 +14292,11 @@ declare namespace __esri { */ new(properties?: WebTileLayerProperties): WebTileLayer; - - fromJSON(json: any): WebTileLayer; } export const WebTileLayer: WebTileLayerConstructor; - interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WebTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The attribution information for the layer. * @@ -13916,11 +14310,11 @@ declare namespace __esri { */ subDomains?: string[]; /** - * The tile server names for the layer. + * The tiling scheme information for the layer. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ - tileServers?: string[]; + tileInfo?: TileInfoProperties; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. * @@ -13943,6 +14337,22 @@ declare namespace __esri { view: View; } + + export interface WebTileLayerFetchTileOptions extends Object { + /** + * Indicates if the access to pixels of the image is allowed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) + */ + allowImageDataAccess?: boolean; + /** + * A timestamp to append to the tile url to avoid loading a cached version of the tile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) + */ + timestamp?: boolean; + } + interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. @@ -14480,13 +14890,23 @@ declare namespace __esri { ground?: GroundProperties | string; } + /** + * A convenience module for importing [PointCloudRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html) + */ + interface pointCloudRenderers { + } + + export const pointCloudRenderers: pointCloudRenderers; + interface PopupTemplate extends Accessor, JSONSupport { /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ - actions: Collection; + actions: Collection; /** * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. @@ -14565,11 +14985,11 @@ declare namespace __esri { interface PopupTemplateProperties { /** - * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ - actions?: CollectionProperties; + actions?: CollectionProperties; /** * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. @@ -14707,7 +15127,7 @@ declare namespace __esri { */ expression: string; /** - * Indicates the return type of the Arcade expression. This is an optional property. **Known Values:** string | number + * Indicates the return type of the Arcade expression. This is an optional property. **Possible Values:** string | number * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) */ @@ -14735,7 +15155,7 @@ declare namespace __esri { */ label?: string; /** - * For editable popups, defines the text box format. **Known Values:** rich-text | text-area | text-box + * For editable popups, defines the text box format. **Possible Values:** rich-text | text-area | text-box * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ @@ -14757,7 +15177,7 @@ declare namespace __esri { export interface PopupTemplateFieldInfosFormat extends Object { /** - * Used only with Date fields. Specifies how the date should appear in a popup. **Known Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * Used only with Date fields. Specifies how the date should appear in a popup. **Possible Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ @@ -14876,7 +15296,7 @@ declare namespace __esri { interface Portal extends Accessor, Loadable { /** - * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Known Values:** public | private + * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ @@ -15064,6 +15484,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery: string; + /** + * Indicates whether the organization has content categories. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) + * + * @default false + */ + hasCategorySchema: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. * @@ -15157,7 +15585,7 @@ declare namespace __esri { */ portalHostname: string; /** - * The portal mode. **Known Values:** multitenant | singletenant + * The portal mode. **Possible Values:** multitenant | singletenant * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ @@ -15219,7 +15647,7 @@ declare namespace __esri { */ readonly thumbnailUrl: string; /** - * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Known Values:** english | metric + * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ @@ -15272,6 +15700,14 @@ declare namespace __esri { * */ fetchBasemaps(basemapGalleryGroupQuery?: string): IPromise; + /** + * If present, fetches the organization's category schema. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchCategorySchema) + * + * + */ + fetchCategorySchema(): IPromise; /** * Fetches the featured groups in the Portal. * @@ -15280,6 +15716,14 @@ declare namespace __esri { * */ fetchFeaturedGroups(): IPromise; + /** + * Fetches and returns the associated regions with the portal instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchRegions) + * + * + */ + fetchRegions(): IPromise; /** * Executes a query against the Portal to return an array of [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects that match the input query. * @@ -15333,7 +15777,7 @@ declare namespace __esri { interface PortalProperties extends LoadableProperties { /** - * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Known Values:** public | private + * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ @@ -15521,6 +15965,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery?: string; + /** + * Indicates whether the organization has content categories. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) + * + * @default false + */ + hasCategorySchema?: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. * @@ -15600,7 +16052,7 @@ declare namespace __esri { */ portalHostname?: string; /** - * The portal mode. **Known Values:** multitenant | singletenant + * The portal mode. **Possible Values:** multitenant | singletenant * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ @@ -15650,7 +16102,7 @@ declare namespace __esri { */ templatesGroupQuery?: string; /** - * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Known Values:** english | metric + * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ @@ -15781,7 +16233,7 @@ declare namespace __esri { interface PortalGroup extends Accessor { /** - * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ @@ -15861,6 +16313,14 @@ declare namespace __esri { */ readonly url: string; + /** + * If present, fetches the group's category schema. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchCategorySchema) + * + * + */ + fetchCategorySchema(): IPromise; /** * Fetches the current members of the group. This method is only available to members or administrators of the group. View the ArcGIS REST API documentation for the [Group Users](https://developers.arcgis.com/rest/users-groups-and-items/group-users.htm) for more details. * @@ -15899,7 +16359,7 @@ declare namespace __esri { interface PortalGroupProperties { /** - * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ @@ -15981,12 +16441,24 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) */ accessInformation: string; + /** + * Contains an array of objects containing proxy information for premium platform services. This is most widely seen in registered applications that work with premium and subscriber services, e.g. routing and analysis services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) + */ + readonly applicationProxies: PortalItemApplicationProxies[]; /** * Average rating. Uses a weighted average called "Bayesian average." * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating: number; + /** + * An array of organization categories that are set on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) + */ + categories: string[]; /** * The date the item was created. * @@ -16011,6 +16483,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent: Extent; + /** + * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) + */ + groupCategories: string[]; /** * The unique id for the item. * @@ -16098,6 +16576,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal: Portal; + /** + * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) + * + * @default null + */ + screenshots: string[]; /** * The size of the item (in bytes). * @@ -16169,7 +16655,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchData) * - * @param responseType The format of the response. **Known Values:** json | xml | text | blob | array-buffer | document + * @param responseType The format of the response. **Possible Values:** json | xml | text | blob | array-buffer | document * */ fetchData(responseType?: string): IPromise; @@ -16252,6 +16738,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating?: number; + /** + * An array of organization categories that are set on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) + */ + categories?: string[]; /** * The date the item was created. * @@ -16276,6 +16768,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent?: ExtentProperties; + /** + * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) + */ + groupCategories?: string[]; /** * The unique id for the item. * @@ -16330,6 +16828,14 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal?: PortalProperties; + /** + * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) + * + * @default null + */ + screenshots?: string[]; /** * The size of the item (in bytes). * @@ -16375,6 +16881,28 @@ declare namespace __esri { } + export interface PortalItemApplicationProxies extends Object { + /** + * The URL of the premium map service layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) + */ + sourceUrl: string; + /** + * The proxy URL for the source URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) + */ + proxyUrl: string; + /** + * The proxy ID registered in ArcGIS Online or ArcGIS Enterprise Portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) + */ + proxyId: string; + } + + export interface PortalItemFetchRelatedItemsParams extends Object { /** * The type of relationship between the two items. See [Relationship types](https://developers.arcgis.com/rest/users-groups-and-items/relationship-types.htm) for a complete listing of types. @@ -16411,6 +16939,18 @@ declare namespace __esri { } interface PortalQueryParams extends Accessor { + /** + * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: + * * individual string elements or + * * an array of strings. + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) + */ + categories: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). * @@ -16494,6 +17034,18 @@ declare namespace __esri { export const PortalQueryParams: PortalQueryParamsConstructor; interface PortalQueryParamsProperties { + /** + * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: + * * individual string elements or + * * an array of strings. + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) + */ + categories?: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). * @@ -16661,7 +17213,7 @@ declare namespace __esri { interface PortalUser extends Accessor { /** - * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Known Values:** private | org | public + * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ @@ -16727,7 +17279,7 @@ declare namespace __esri { */ region: string; /** - * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ @@ -16745,7 +17297,7 @@ declare namespace __esri { */ readonly thumbnailUrl: string; /** - * The user's personal units of measure setting. **Known Values:** english | metric + * The user's personal units of measure setting. **Possible Values:** english | metric * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ @@ -16784,6 +17336,15 @@ declare namespace __esri { * */ deleteItem(item: PortalItem): IPromise; + /** + * Deletes items from the user's portal content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItems) + * + * @param items The portal items to remove. + * + */ + deleteItems(items: PortalItem[]): IPromise; /** * Fetches all of the user's folders used to organize portal content. * @@ -16842,7 +17403,7 @@ declare namespace __esri { interface PortalUserProperties { /** - * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Known Values:** private | org | public + * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ @@ -16908,7 +17469,7 @@ declare namespace __esri { */ region?: string; /** - * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ @@ -16920,7 +17481,7 @@ declare namespace __esri { */ roleId?: string; /** - * The user's personal units of measure setting. **Known Values:** english | metric + * The user's personal units of measure setting. **Possible Values:** english | metric * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ @@ -16981,6 +17542,16 @@ declare namespace __esri { start?: number; } + /** + * A convenience module for importing [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html) + */ + interface renderers { + } + + export const renderers: renderers; + interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. @@ -17238,6 +17809,127 @@ declare namespace __esri { title: string; } + interface HeatmapRenderer extends Renderer { + /** + * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) + * + * @default 10 + */ + blurRadius: number; + /** + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * ```js + * [ + * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, + * { ratio: 0.75, color: "rgba(255, 140, 0, 1)" }, + * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } + * ] + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) + */ + colorStops: HeatmapColorStop[]; + /** + * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) + */ + field: string; + /** + * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) + * + * @default 100 + */ + maxPixelIntensity: number; + /** + * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) + * + * @default 0 + */ + minPixelIntensity: number; + /** + * The type of renderer. For HeatmapRenderer this value is always `heatmap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#type) + */ + readonly type: "heatmap"; + + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#clone) + * + * + */ + clone(): HeatmapRenderer; + } + + interface HeatmapRendererConstructor { + /** + * The HeatmapRenderer renders point [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) as a raster surface, emphasizing areas with a high density of points. This renderer uses a [Gaussian Blur](https://en.wikipedia.org/wiki/Gaussian_blur) to determine the strength of the influence of each point over an area determined by the [blurRadius](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius). A Gaussian, or normal, distribution is used to spread the color of the point so it appears to be a fuzzy circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) + */ + + new(properties?: HeatmapRendererProperties): HeatmapRenderer; + + fromJSON(json: any): HeatmapRenderer; + } + + export const HeatmapRenderer: HeatmapRendererConstructor; + + interface HeatmapRendererProperties extends RendererProperties { + /** + * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) + * + * @default 10 + */ + blurRadius?: number; + /** + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * ```js + * [ + * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, + * { ratio: 0.75, color: "rgba(255, 140, 0, 1)" }, + * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } + * ] + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) + */ + colorStops?: HeatmapColorStopProperties[]; + /** + * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) + */ + field?: string; + /** + * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) + * + * @default 100 + */ + maxPixelIntensity?: number; + /** + * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) + * + * @default 0 + */ + minPixelIntensity?: number; + } + interface PointCloudClassBreaksRenderer extends PointCloudRenderer { /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: @@ -17384,6 +18076,12 @@ declare namespace __esri { * @default 10 */ pointsPerInch: number; + /** + * The point cloud renderer type. **Possible values:** point-cloud-class-breaks | point-cloud-rgb | point-cloud-stretch | point-cloud-unique-value + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#type) + */ + readonly type: string; /** * Creates a deep clone of the renderer. @@ -17482,12 +18180,6 @@ declare namespace __esri { * @default 1 */ scaleFactor?: number; - /** - * Minimum screen space size in points. Applies to `splat` only. **Deprecated since version 4.5** - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) - */ - minSize?: number; } interface PointCloudRGBRenderer extends PointCloudRenderer { @@ -17782,6 +18474,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) */ authoringInfo: AuthoringInfo; + /** + * The renderer type. **Possible values:** class-breaks | heatmap | simple | unique-value + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#type) + */ + readonly type: string; } interface RendererConstructor { @@ -18106,7 +18804,7 @@ declare namespace __esri { /** * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with a function. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) - * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). + * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not currently supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) */ @@ -18658,7 +19356,7 @@ declare namespace __esri { * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -18687,7 +19385,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.theme - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -18707,7 +19405,7 @@ declare namespace __esri { * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -18764,7 +19462,7 @@ declare namespace __esri { * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.theme - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -18967,11 +19665,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -19041,7 +19739,7 @@ declare namespace __esri { */ basemap?: string | Basemap; /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -19119,11 +19817,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -19277,7 +19975,7 @@ declare namespace __esri { */ basemap?: string | Basemap; /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -19347,7 +20045,7 @@ declare namespace __esri { /** * When generating 3D symbols (except for layers with a `mesh` geometry type), a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + * [Read more...](global.html) */ view?: View; /** @@ -19531,7 +20229,7 @@ declare namespace __esri { * @param params.locationScheme In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -19578,11 +20276,11 @@ declare namespace __esri { /** * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * [Read more...](global.html) */ view?: SceneView; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -19741,7 +20439,7 @@ declare namespace __esri { /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + * [Read more...](global.html) */ view?: View; } @@ -19836,7 +20534,7 @@ declare namespace __esri { * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -19869,7 +20567,7 @@ declare namespace __esri { * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20130,11 +20828,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20254,11 +20952,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20376,7 +21074,7 @@ declare namespace __esri { /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + * [Read more...](global.html) */ view?: View; /** @@ -20494,7 +21192,7 @@ declare namespace __esri { * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. * - * **Known Values:** count | value + * **Possible Values:** count | value * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or a string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. * @param params.valueExpressionTitle Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. @@ -20502,7 +21200,7 @@ declare namespace __esri { * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20660,7 +21358,7 @@ declare namespace __esri { * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. * - * **Known Values:** count | value + * **Possible Values:** count | value * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) @@ -20701,11 +21399,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20809,7 +21507,7 @@ declare namespace __esri { * @param params.sizeOptions Options for configuring the size portion of the visualization. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -20983,11 +21681,11 @@ declare namespace __esri { /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. * * | Value | Description | * | ----- | ----------- | @@ -21007,7 +21705,7 @@ declare namespace __esri { export interface univariateColorSizeCreateContinuousRendererParamsColorOptions extends Object { /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -21155,7 +21853,7 @@ declare namespace __esri { /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + * [Read more...](global.html) */ view?: View; /** @@ -21169,7 +21867,7 @@ declare namespace __esri { export interface univariateColorSizeCreateVisualVariablesParamsColorOptions extends Object { /** - * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -21469,7 +22167,7 @@ declare namespace __esri { /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + * [Read more...](global.html) */ view?: View; /** @@ -21657,7 +22355,7 @@ declare namespace __esri { /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + * [Read more...](global.html) */ view?: View; /** @@ -21850,7 +22548,7 @@ declare namespace __esri { /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + * [Read more...](global.html) */ view?: View; /** @@ -21945,7 +22643,7 @@ declare namespace __esri { /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + * [Read more...](global.html) */ view?: View; /** @@ -21999,9 +22697,9 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.theme - * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22036,13 +22734,13 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ geometryType: string; /** - * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22058,7 +22756,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22082,7 +22780,7 @@ declare namespace __esri { */ id: string; /** - * Indicates which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. * * | Value | Description | Example | * | ----- | ----------- | ------- | @@ -22189,7 +22887,7 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @@ -22208,7 +22906,7 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) */ @@ -22216,7 +22914,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22361,7 +23059,7 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @@ -22512,7 +23210,7 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ @@ -22520,7 +23218,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; /** @@ -22597,8 +23295,8 @@ declare namespace __esri { * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh - * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh + * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Possible Values:** point-cloud-class | default * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @@ -22745,13 +23443,13 @@ declare namespace __esri { */ basemap: string | Basemap; /** - * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ geometryType: string; /** - * Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Possible Values:** point-cloud-class | default * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) * @@ -22767,7 +23465,7 @@ declare namespace __esri { /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + * [Read more...](global.html) */ view?: SceneView; } @@ -22806,11 +23504,23 @@ declare namespace __esri { interface AuthoringInfo extends Accessor, JSONSupport { /** - * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod: string; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + field1: any; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + field2: any; /** * An array of string values representing field names used for creating predominance renderers. * @@ -22818,19 +23528,31 @@ declare namespace __esri { */ fields: string[]; /** - * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * focus for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) + */ + focus: string; + /** + * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit: string; /** - * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * numClasses for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) + */ + numClasses: number; + /** + * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval: number; /** - * Indicates the renderer type generated from one of the Smart Mapping functions. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -22864,11 +23586,23 @@ declare namespace __esri { interface AuthoringInfoProperties { /** - * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod?: string; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) + */ + field1?: any; + /** + * field for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) + */ + field2?: any; /** * An array of string values representing field names used for creating predominance renderers. * @@ -22876,19 +23610,31 @@ declare namespace __esri { */ fields?: string[]; /** - * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * focus for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) + */ + focus?: string; + /** + * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit?: string; /** - * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * numClasses for relationship. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) + */ + numClasses?: number; + /** + * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval?: number; /** - * Indicates the renderer type generated from one of the Smart Mapping functions. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ @@ -22933,25 +23679,25 @@ declare namespace __esri { */ startTime: string | number; /** - * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style: string; /** - * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme: string; /** - * The type of visual variable generated. **Known Values:** color | size | opacity + * The type of visual variable generated. **Possible Values:** color | size | opacity * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type: string; /** - * If an age or timeline renderer was generated, indicates the time units used. **Known Values:** seconds | minutes | hours | days | months | years + * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ @@ -23009,31 +23755,78 @@ declare namespace __esri { */ startTime?: string | number; /** - * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style?: string; /** - * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme?: string; /** - * The type of visual variable generated. **Known Values:** color | size | opacity + * The type of visual variable generated. **Possible Values:** color | size | opacity * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type?: string; /** - * If an age or timeline renderer was generated, indicates the time units used. **Known Values:** seconds | minutes | hours | days | months | years + * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ units?: string; } + interface HeatmapColorStop extends Accessor { + /** + * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) + */ + color: Color; + /** + * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) + */ + ratio: number; + + /** + * Creates a deep clone of the color stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#clone) + * + * + */ + clone(): HeatmapColorStop; + } + + interface HeatmapColorStopConstructor { + + + new(properties?: HeatmapColorStopProperties): HeatmapColorStop; + } + + export const HeatmapColorStop: HeatmapColorStopConstructor; + + interface HeatmapColorStopProperties { + /** + * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) + */ + color?: Color | number[] | string; + /** + * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) + */ + ratio?: number; + } + interface supportJsonUtils { /** @@ -23417,28 +24210,9 @@ declare namespace __esri { * * @param url The request URL. * @param options An object with the following properties that describe the request. - * @param options.callbackParamName Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. - * @param options.query If the request URL points to a web server that requires parameters, specify them here. - * @param options.responseType Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image - * @param options.headers Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. - * @param options.timeout Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. - * @param options.method Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Known Values:** auto | post - * @param options.body If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. - * @param options.useProxy Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. - * @param options.cacheBust Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. - * @param options.allowImageDataAccess Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. - * @param options.authMode - * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). - * - * | Known Value | Description | - * |-------------|-------------| - * | auto | The user will be signed in when a secure resource is requested. | - * | anonymous | An error will be returned when a secure resource is requested. | - * | immediate | The user will be signed in before the resource is requested. | - * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | * */ - esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; + esriRequest(url: string, options?: RequestOptions): IPromise; } const __requestMapped: request; @@ -23503,78 +24277,70 @@ declare namespace __esri { export type GetHeader = (headerName: string) => string; - - export interface requestEsriRequestOptions extends Object { + /** + * An object with the following properties that describe the request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) + */ + export interface RequestOptions extends Object { + /** + * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Possible Values:** auto | post + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) + */ + method?: string; /** * Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ callbackParamName?: string; - /** - * If the request URL points to a web server that requires parameters, specify them here. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - */ - query?: any; /** * Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default json + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ responseType?: string; /** * Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ headers?: any; /** * Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default 60000 + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ timeout?: number; /** - * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Known Values:** auto | post + * If the request URL points to a web server that requires parameters, specify them here. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default auto + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ - method?: string; + query?: any; /** * If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ body?: FormData | HTMLFormElement | string; /** * Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default false + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ useProxy?: boolean; /** * Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default false + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ cacheBust?: boolean; /** * Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default false + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ allowImageDataAccess?: boolean; /** @@ -23588,100 +24354,157 @@ declare namespace __esri { * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | * * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * - * @default auto + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ authMode?: string; } - interface Action extends Accessor { + /** + * Returns a promise that resolves to an object with the following specification. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + export interface RequestResponse extends Object { + /** + * The requested data. Should match the `responseType` with the data return type. Possible types are: [json](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object), [xml](https://developer.mozilla.org/en-US/docs/Web/API/XMLDocument), [text](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob), [array-buffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [document](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument), and [image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + data?: any; + /** + * The options specified by the user in the data request. See [RequestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) for available properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + requestOptions?: RequestOptions; + /** + * If ssl is enabled or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + ssl?: boolean; + /** + * The URL used to request the data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + url?: string; + /** + * Method for getting a header sent from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) + */ + getHeader?: GetHeader; + } + + interface ActionBase { + /** + * Indicates whether the action is currently active. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#active) + * + * @default false + */ + active: boolean; /** * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#className) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#className) */ className: string; /** - * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. + * Indicates whether this action is disabled. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#disabled) + * + * @default false + */ + disabled: boolean; + /** + * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#event:trigger-action) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#id) */ id: string; - /** - * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) - */ - image: string; /** * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#title) */ title: string; + /** + * Specifies the type of action. Choose between ["button"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or ["toggle"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). Currently, these two are the only supported types. A "slider" type will follow-up in a future release. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#type) + * + * @default null + */ + type: string; /** * Indicates if the action is visible. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#visible) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#visible) * * @default true */ visible: boolean; + } + + interface ActionBaseConstructor { + + + new(): ActionBase; + } + + export const ActionBase: ActionBaseConstructor; + + interface ActionButton extends ActionBase { + /** + * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#image) + */ + image: string; /** * Creates a deep clone of this object. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#clone) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#clone) * * */ - clone(): Action; + clone(): ActionButton; } - interface ActionConstructor { + interface ActionButtonConstructor { - new(properties?: ActionProperties): Action; + + new(properties?: any): ActionButton; } - export const Action: ActionConstructor; + export const ActionButton: ActionButtonConstructor; - interface ActionProperties { + interface ActionToggle extends ActionBase { /** - * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html#clone) + * * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#className) */ - className?: string; - /** - * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) - */ - id?: string; - /** - * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) - */ - image?: string; - /** - * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) - */ - title?: string; - /** - * Indicates if the action is visible. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#visible) - * - * @default true - */ - visible?: boolean; + clone(): ActionToggle; } + interface ActionToggleConstructor { + + + + new(properties?: any): ActionToggle; + } + + export const ActionToggle: ActionToggleConstructor; + interface LayersMixin { /** * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). @@ -23704,11 +24527,11 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) * - * @param layer Layer to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * @param layer Layer or a Promise<Layer> to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. * */ - add(layer: Layer, index?: number): void; + add(layer: Layer | IPromise, index?: number): void; /** * Adds a layer or an array of layers to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @@ -23792,6 +24615,16 @@ declare namespace __esri { layers?: CollectionProperties | LayerProperties[]; } + /** + * A convenience module for importing [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing symbols one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html) + */ + interface symbols { + } + + export const symbols: symbols; + interface Callout3D extends Accessor, JSONSupport { /** * Creates a deep clone of the callout. @@ -24274,6 +25107,50 @@ declare namespace __esri { } interface Font extends Accessor, JSONSupport { + /** + * The text decoration. **Possible Values:** underline | line-through | none + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#decoration) + * + * @default none + */ + decoration: "underline" | "line-through" | "none"; + /** + * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) + * + * @default sans-serif + */ + family: string; + /** + * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) + * + * @default 9 + */ + size: number; + /** + * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique + * > **Known Limitations** `oblique` is not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) + * + * @default normal + */ + style: "normal" | "italic" | "oblique"; + /** + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) + * + * @default normal + */ + weight: "normal" | "bold" | "bolder" | "lighter"; + /** * Creates a deep clone of the font object. * @@ -24285,11 +25162,7 @@ declare namespace __esri { } interface FontConstructor { - /** - * The font used to display [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) added to the [graphics layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html) - */ + new(properties?: FontProperties): Font; @@ -24299,7 +25172,49 @@ declare namespace __esri { export const Font: FontConstructor; interface FontProperties { - + /** + * The text decoration. **Possible Values:** underline | line-through | none + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#decoration) + * + * @default none + */ + decoration?: "underline" | "line-through" | "none"; + /** + * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) + * + * @default sans-serif + */ + family?: string; + /** + * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) + * + * @default 9 + */ + size?: number | string; + /** + * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique + * > **Known Limitations** `oblique` is not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) + * + * @default normal + */ + style?: "normal" | "italic" | "oblique"; + /** + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D WebGL enabled [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) + * + * @default normal + */ + weight?: "normal" | "bold" | "bolder" | "lighter"; } interface IconSymbol3DLayer extends Symbol3DLayer { @@ -24705,7 +25620,7 @@ declare namespace __esri { interface MarkerSymbol extends Symbol { /** * The angle of the marker in degrees. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle) * @@ -24714,7 +25629,7 @@ declare namespace __esri { angle: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#xoffset) * @@ -24723,7 +25638,7 @@ declare namespace __esri { xoffset: number; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#yoffset) * @@ -24749,7 +25664,7 @@ declare namespace __esri { interface MarkerSymbolProperties extends SymbolProperties { /** * The angle of the marker in degrees. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle) * @@ -24758,7 +25673,7 @@ declare namespace __esri { angle?: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#xoffset) * @@ -24767,7 +25682,7 @@ declare namespace __esri { xoffset?: number | string; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#yoffset) * @@ -24814,11 +25729,17 @@ declare namespace __esri { interface ObjectSymbol3DLayer extends Symbol3DLayer { /** - * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. + * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. + * * For `href` resources, the origin coincides with the origin of the 3D model. + * + * + * **Possible Values:** center | top | bottom | origin * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) * - * @default center + * @default origin */ anchor: string; /** @@ -24904,11 +25825,17 @@ declare namespace __esri { interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { /** - * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. + * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. + * * For `href` resources, the origin coincides with the origin of the 3D model. + * + * + * **Possible Values:** center | top | bottom | origin * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) * - * @default center + * @default origin */ anchor?: string; /** @@ -25417,7 +26344,7 @@ declare namespace __esri { */ color: Color; /** - * The fill style. Valid values are listed in the table below: + * The fill style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25430,7 +26357,7 @@ declare namespace __esri { * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) * @@ -25478,7 +26405,7 @@ declare namespace __esri { */ color?: Color | number[] | string; /** - * The fill style. Valid values are listed in the table below: + * The fill style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25491,7 +26418,7 @@ declare namespace __esri { * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) * @@ -25502,28 +26429,42 @@ declare namespace __esri { interface SimpleLineSymbol extends LineSymbol { /** - * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * + * Possible Value | Example + * ---------------|--------- + * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * * > **Known Limitations** - * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) * - * @default butt + * @default round */ - cap: string; + cap: "butt" | "round" | "square"; /** - * Specifies the join style. **Known Values:** miter | round | bevel - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * + * Possible Value | Example + * ---------------|--------- + * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) * - * @default miter + * @default round */ - join: string; + join: "miter" | "round" | "bevel"; /** * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) * @@ -25531,7 +26472,7 @@ declare namespace __esri { */ miterLimit: number; /** - * Specifies the line style. Valid values are listed in the table below: + * Specifies the line style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25548,7 +26489,7 @@ declare namespace __esri { * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) * @@ -25588,28 +26529,42 @@ declare namespace __esri { interface SimpleLineSymbolProperties extends LineSymbolProperties { /** - * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * + * Possible Value | Example + * ---------------|--------- + * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-butt.png) + * round | ![sls-cap-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-round.png) + * square | ![sls-cap-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-cap-square.png) + * * > **Known Limitations** - * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) * - * @default butt + * @default round */ - cap?: string; + cap?: "butt" | "round" | "square"; /** - * Specifies the join style. **Known Values:** miter | round | bevel - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * + * Possible Value | Example + * ---------------|--------- + * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-bevel.png) + * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-miter.png) + * round | ![sls-join-round](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/sls-join-round.png) + * + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) * - * @default miter + * @default round */ - join?: string; + join?: "miter" | "round" | "bevel"; /** * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) * @@ -25617,7 +26572,7 @@ declare namespace __esri { */ miterLimit?: number | string; /** - * Specifies the line style. Valid values are listed in the table below: + * Specifies the line style. Possible values are listed in the table below: * * Value | Description * ------|------------- @@ -25634,7 +26589,7 @@ declare namespace __esri { * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) * - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) * @@ -25661,7 +26616,7 @@ declare namespace __esri { outline: SimpleLineSymbol; /** * The SVG path of the icon. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ @@ -25740,7 +26695,7 @@ declare namespace __esri { outline?: SimpleLineSymbolProperties; /** * The SVG path of the icon. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ @@ -26001,7 +26956,7 @@ declare namespace __esri { interface TextSymbol extends Symbol { /** * The angle of the text. `0` is horizontal and the angle moves clockwise. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#angle) * @@ -26042,9 +26997,7 @@ declare namespace __esri { /** * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ @@ -26052,16 +27005,14 @@ declare namespace __esri { /** * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize: number; /** - * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#horizontalAlignment) * @@ -26078,7 +27029,7 @@ declare namespace __esri { kerning: boolean; /** * Determines whether every character in the text string is rotated. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#rotated) * @@ -26098,8 +27049,8 @@ declare namespace __esri { */ readonly type: "text"; /** - * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#verticalAlignment) * @@ -26108,7 +27059,7 @@ declare namespace __esri { verticalAlignment: string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#xoffset) * @@ -26117,7 +27068,7 @@ declare namespace __esri { xoffset: number; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#yoffset) * @@ -26137,7 +27088,7 @@ declare namespace __esri { interface TextSymbolConstructor { /** - * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. + * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html), in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Text symbols can also be used to define the symbol property of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) */ @@ -26152,7 +27103,7 @@ declare namespace __esri { interface TextSymbolProperties extends SymbolProperties { /** * The angle of the text. `0` is horizontal and the angle moves clockwise. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#angle) * @@ -26193,26 +27144,22 @@ declare namespace __esri { /** * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ - haloColor?: Color; + haloColor?: Color | number[] | string; /** * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). * > **Known Limitations** - * * Not supported in IE 9 or below. * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize?: number | string; /** - * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#horizontalAlignment) * @@ -26229,7 +27176,7 @@ declare namespace __esri { kerning?: boolean; /** * Determines whether every character in the text string is rotated. - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#rotated) * @@ -26243,8 +27190,8 @@ declare namespace __esri { */ text?: string; /** - * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#verticalAlignment) * @@ -26253,7 +27200,7 @@ declare namespace __esri { verticalAlignment?: string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#xoffset) * @@ -26262,7 +27209,7 @@ declare namespace __esri { xoffset?: number | string; /** * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#yoffset) * @@ -26277,7 +27224,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ - font: TextSymbol3DLayerFont; + font: Font; /** * The halo surrounding the text. * @@ -26285,7 +27232,7 @@ declare namespace __esri { */ halo: TextSymbol3DLayerHalo; /** - * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) * @@ -26335,7 +27282,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ - font?: TextSymbol3DLayerFont; + font?: FontProperties; /** * The halo surrounding the text. * @@ -26343,7 +27290,7 @@ declare namespace __esri { */ halo?: TextSymbol3DLayerHaloProperties; /** - * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) * @@ -26359,34 +27306,6 @@ declare namespace __esri { } - export interface TextSymbol3DLayerFont extends Object { - /** - * The font family. See [MDN: font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default Arial - */ - family?: string; - /** - * The font weight. **Known Values:** normal | bold - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default normal - */ - weight?: string; - /** - * The font style. **Known Values:** normal | italic - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) - * - * @default normal - */ - style?: string; - } - - export interface TextSymbol3DLayerHaloProperties extends Object { /** * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. @@ -26679,7 +27598,7 @@ declare namespace __esri { * @param params.strings An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` * @param params.sr The spatial reference or well-known ID to convert the input string coordinates to. * @param params.conversionType The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd - * @param params.conversionMode Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for valid values and their descriptions. + * @param params.conversionMode Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). * */ @@ -26844,7 +27763,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ - sr: SpatialReference | string; + sr: SpatialReference | string | number; /** * The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd * @@ -26854,7 +27773,7 @@ declare namespace __esri { */ conversionType?: string; /** - * Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for valid values and their descriptions. + * Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ @@ -26868,7 +27787,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ - sr: SpatialReference | string; + sr: SpatialReference | string | number; /** * An array of XY-coordinates (in JSON format) to be converted. * @@ -27444,7 +28363,7 @@ declare namespace __esri { interface PrintTask extends Task { /** - * The mode for the print task execution. **Known Values:** async | sync + * The mode for the print task execution. **Possible Values:** async | sync * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#mode) * @@ -27934,13 +28853,13 @@ declare namespace __esri { */ directionsLanguage: string; /** - * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** - * Defines the amount of direction information returned. The default value is standard. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ @@ -27972,7 +28891,7 @@ declare namespace __esri { */ facilities: DataLayer | FeatureSet; /** - * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ @@ -27990,13 +28909,21 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. See NAOutputLine for a list of valid values. + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * + * Possible Value | Description + * ---------------|------------ + * none | No lines are returned + * straight | Only returns straight lines + * true-shape | Return the true shape of the lines + * true-shape-with-measure | Return the true shape of the lines with their measurements + * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ @@ -28032,7 +28959,7 @@ declare namespace __esri { */ restrictionAttributes: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ @@ -28094,19 +29021,25 @@ declare namespace __esri { */ returnRoutes: boolean; /** - * The arrival or departure date and time. For example, if the travelDirection is set to `TO_FACILITY` and `timeOfDayUsage` is set to "end" and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* + * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay: Date; /** - * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. See NATravelDirection for a list of valid values. + * Options for traveling to or from the facility. Default values are defined by the network layer. + * + * Possible Value | Description + * ---------------|------------ + * from-facility | Sets travel direction from the facility + * to-facility | Sets travel direction to the facility + * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ @@ -28174,13 +29107,13 @@ declare namespace __esri { */ directionsLanguage?: string; /** - * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** - * Defines the amount of direction information returned. The default value is standard. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ @@ -28212,7 +29145,7 @@ declare namespace __esri { */ facilities?: DataLayerProperties | FeatureSetProperties; /** - * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ @@ -28230,13 +29163,21 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. See NAOutputLine for a list of valid values. + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * + * Possible Value | Description + * ---------------|------------ + * none | No lines are returned + * straight | Only returns straight lines + * true-shape | Return the true shape of the lines + * true-shape-with-measure | Return the true shape of the lines with their measurements + * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ @@ -28272,7 +29213,7 @@ declare namespace __esri { */ restrictionAttributes?: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ @@ -28334,19 +29275,25 @@ declare namespace __esri { */ returnRoutes?: boolean; /** - * The arrival or departure date and time. For example, if the travelDirection is set to `TO_FACILITY` and `timeOfDayUsage` is set to "end" and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* + * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** - * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage?: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. See NATravelDirection for a list of valid values. + * Options for traveling to or from the facility. Default values are defined by the network layer. + * + * Possible Value | Description + * ---------------|------------ + * from-facility | Sets travel direction from the facility + * to-facility | Sets travel direction to the facility + * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ @@ -28427,7 +29374,7 @@ declare namespace __esri { */ polylineBarriers: Polyline[]; /** - * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ @@ -28492,7 +29439,7 @@ declare namespace __esri { */ polylineBarriers?: PolylineProperties[]; /** - * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ @@ -29312,7 +30259,7 @@ declare namespace __esri { */ description: string; /** - * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ @@ -29337,7 +30284,7 @@ declare namespace __esri { */ description?: string; /** - * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ @@ -29920,7 +30867,7 @@ declare namespace __esri { */ jobId: string; /** - * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ @@ -29951,7 +30898,7 @@ declare namespace __esri { */ jobId?: string; /** - * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ @@ -30430,7 +31377,15 @@ declare namespace __esri { */ exportOptions: PrintTemplateExportOptions; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) + * + * @default false + */ + forceFeatureAttributes: boolean; + /** + * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) * @@ -30514,7 +31469,15 @@ declare namespace __esri { */ exportOptions?: PrintTemplateExportOptions; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) + * + * @default false + */ + forceFeatureAttributes?: boolean; + /** + * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) * @@ -30617,7 +31580,7 @@ declare namespace __esri { */ copyrightText: string; /** - * The unit used for the scalebar. **Known Values:** `Miles` | `Kilometers` | `Meters` | `Feet` + * The unit used for the scalebar. **Possible Values:** `Miles` | `Kilometers` | `Meters` | `Feet` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) * @@ -30745,73 +31708,90 @@ declare namespace __esri { */ datumTransformation: number; /** - * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance: number; /** - * Specify the geodatabase version to display. + * Specifies the geodatabase version to display for feature service queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by `spatialRelationship` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry: Geometry; /** - * Specify the number of decimal places for the geometries returned by the query operation. + * Specifies the number of decimal places for geometries returned by the query operation. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision: number; /** - * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics: string[]; /** - * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` property of the layers being queried is set to `true`. This setting is provided in the layer resource. + * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment: Date; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset: number; /** - * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) + * + * @default 1 + */ + maxRecordCountFactor: number; + /** + * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption: string; /** - * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the **Max Record Count** of the service, which can be found at the REST endpoint of the FeatureLayer. + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num: number; /** - * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * A comma delimited list of ObjectIDs for the features in the layer being queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds: number[]; /** - * One or more field names that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** + * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. + * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields: string[]; /** - * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** + * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) */ @@ -30823,43 +31803,47 @@ declare namespace __esri { */ outSpatialReference: SpatialReference; /** - * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics: StatisticDefinition[]; /** - * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires ArcGIS Server service 10.5 or greater. + * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues: QueryParameterValues[]; /** - * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize: Symbol; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. *Only works with ArcGIS Online hosted services.* + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters: QueryQuantizationParameters; /** - * Filters features from the layer that are within the specified range values. Requires ArcGIS Server service 10.5 or greater. + * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues: QueryRangeValues[]; /** - * The string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter: string; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) * @@ -30867,7 +31851,9 @@ declare namespace __esri { */ returnCentroid: boolean; /** - * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** + * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) * @@ -30875,7 +31861,8 @@ declare namespace __esri { */ returnDistinctValues: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) * @@ -30883,7 +31870,8 @@ declare namespace __esri { */ returnExceededLimitFeatures: boolean; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) * @@ -30891,35 +31879,31 @@ declare namespace __esri { */ returnGeometry: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) - * - * @default false */ returnM: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) - * - * @default false */ returnZ: boolean; /** - * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: * * Value | Description * ------|------------- - * intersects | Part of a feature from feature class 1 intersects a feature from feature class 2. - * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. - * crosses | The feature from feature class 1 crosses a feature from feature class 2. - * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Features from feature class 1 overlap features in feature class 2. - * touches | The feature from feature class 1 touches the border of a feature from feature class 2. - * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. - * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) @@ -30928,7 +31912,8 @@ declare namespace __esri { */ spatialRelationship: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Known Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) * @@ -30936,13 +31921,14 @@ declare namespace __esri { */ sqlFormat: string; /** - * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start: number; /** - * Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in the Services Directory. + * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) * @@ -30950,7 +31936,9 @@ declare namespace __esri { */ text: string; /** - * The unit for calculating the buffer distance. if unit is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service spatial reference. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ @@ -30974,7 +31962,7 @@ declare namespace __esri { interface QueryConstructor { /** - * Query is used to define parameters to filter a layer's features, either by its attributes or its geometry. Once a Query object is created, you can set its properties to conform to the filtering requirements of the application. Once a Query object is created and its properties are set, it is then ready to be passed into an executable function in [QueryTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) (e.g. `QueryTask.execute(Query)`). The returned result is often a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). + * This class defines parameters for executing queries for features from a layer or layer view. Once a Query object's properties are defined, it can then be passed into an [executable function](?search=queryfeatures), which will return the features in a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) */ @@ -30994,73 +31982,90 @@ declare namespace __esri { */ datumTransformation?: number; /** - * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance?: number; /** - * Specify the geodatabase version to display. + * Specifies the geodatabase version to display for feature service queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion?: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by `spatialRelationship` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry?: GeometryProperties; /** - * Specify the number of decimal places for the geometries returned by the query operation. + * Specifies the number of decimal places for geometries returned by the query operation. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision?: number; /** - * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * One or more field names that will be used to group the statistics. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics?: string[]; /** - * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` property of the layers being queried is set to `true`. This setting is provided in the layer resource. + * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment?: DateProperties; /** - * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not defined, the spatial reference of the view is used. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** - * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) + * + * @default 1 + */ + maxRecordCountFactor?: number; + /** + * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption?: string; /** - * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the **Max Record Count** of the service, which can be found at the REST endpoint of the FeatureLayer. + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num?: number; /** - * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * A comma delimited list of ObjectIDs for the features in the layer being queried. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds?: number[]; /** - * One or more field names that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** + * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. + * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields?: string[]; /** - * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** + * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) */ @@ -31072,43 +32077,47 @@ declare namespace __esri { */ outSpatialReference?: SpatialReferenceProperties; /** - * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics?: StatisticDefinitionProperties[]; /** - * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires ArcGIS Server service 10.5 or greater. + * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues?: QueryParameterValues[]; /** - * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize?: SymbolProperties; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. *Only works with ArcGIS Online hosted services.* + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters?: QueryQuantizationParameters; /** - * Filters features from the layer that are within the specified range values. Requires ArcGIS Server service 10.5 or greater. + * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues?: QueryRangeValues[]; /** - * The string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter?: string; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) * @@ -31116,7 +32125,9 @@ declare namespace __esri { */ returnCentroid?: boolean; /** - * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** + * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) * @@ -31124,7 +32135,8 @@ declare namespace __esri { */ returnDistinctValues?: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) * @@ -31132,7 +32144,8 @@ declare namespace __esri { */ returnExceededLimitFeatures?: boolean; /** - * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) * @@ -31140,35 +32153,31 @@ declare namespace __esri { */ returnGeometry?: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) - * - * @default false */ returnM?: boolean; /** - * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) - * - * @default false */ returnZ?: boolean; /** - * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: * * Value | Description * ------|------------- - * intersects | Part of a feature from feature class 1 intersects a feature from feature class 2. - * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. - * crosses | The feature from feature class 1 crosses a feature from feature class 2. - * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * contains | Returns features from the layer or layer view that are completely contained by the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * crosses | Returns features from the layer or layer view that cross the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * envelope-intersects | Returns features from the layer or layer view that intersect the envelope (or extent) of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. - * overlaps | Features from feature class 1 overlap features in feature class 2. - * touches | The feature from feature class 1 touches the border of a feature from feature class 2. - * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. - * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * overlaps | Returns features from the layer or layer view that overlap the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) @@ -31177,7 +32186,8 @@ declare namespace __esri { */ spatialRelationship?: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Known Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) * @@ -31185,13 +32195,14 @@ declare namespace __esri { */ sqlFormat?: string; /** - * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start?: number; /** - * Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in the Services Directory. + * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) * @@ -31199,7 +32210,9 @@ declare namespace __esri { */ text?: string; /** - * The unit for calculating the buffer distance. if unit is not specified, the unit is derived from the geometry spatial reference. If the geometry spatial reference is not specified, the unit is derived from the feature service spatial reference. This parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. + * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ @@ -31237,13 +32250,13 @@ declare namespace __esri { */ extent?: Extent; /** - * Geometry coordinates are optimized for viewing and displaying of data. **Known Values:** view + * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ mode?: string; /** - * The integer's coordinates will be returned relative to the origin position defined by this property value. **Known Values:** upper-left | lower-left + * The integer's coordinates will be returned relative to the origin position defined by this property value. **Possible Values:** upper-left | lower-left * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) * @@ -31604,13 +32617,13 @@ declare namespace __esri { */ directionsLanguage: string; /** - * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** - * Defines the amount of direction information returned. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) * @@ -31658,7 +32671,7 @@ declare namespace __esri { */ ignoreInvalidLocations: boolean; /** - * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ @@ -31670,13 +32683,13 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** none | straight | true-shape | true-shape-with-measure + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) * @@ -31720,7 +32733,7 @@ declare namespace __esri { */ restrictionAttributes: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ @@ -31856,13 +32869,13 @@ declare namespace __esri { */ directionsLanguage?: string; /** - * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** - * Defines the amount of direction information returned. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) * @@ -31910,7 +32923,7 @@ declare namespace __esri { */ ignoreInvalidLocations?: boolean; /** - * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ @@ -31922,13 +32935,13 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** none | straight | true-shape | true-shape-with-measure + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) * @@ -31972,7 +32985,7 @@ declare namespace __esri { */ restrictionAttributes?: string[]; /** - * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ @@ -32195,7 +33208,7 @@ declare namespace __esri { */ facilities: DataLayer | FeatureSet; /** - * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ @@ -32215,7 +33228,7 @@ declare namespace __esri { */ outputGeometryPrecision: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ @@ -32349,7 +33362,7 @@ declare namespace __esri { */ splitPolygonsAtBreaks: boolean; /** - * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ @@ -32455,7 +33468,7 @@ declare namespace __esri { */ facilities?: DataLayerProperties | FeatureSetProperties; /** - * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ @@ -32475,7 +33488,7 @@ declare namespace __esri { */ outputGeometryPrecision?: number; /** - * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ @@ -32609,7 +33622,7 @@ declare namespace __esri { */ splitPolygonsAtBreaks?: boolean; /** - * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ @@ -32760,19 +33773,19 @@ declare namespace __esri { interface StatisticDefinition extends Accessor, JSONSupport { /** - * Defines the field for which statistics will be calculated. + * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField: string; /** - * Specifies the output field name. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName: string; /** - * Defines the type of statistic. **Known Values:** count | sum | min | max | avg | stddev | var + * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ @@ -32791,19 +33804,19 @@ declare namespace __esri { interface StatisticDefinitionProperties { /** - * Defines the field for which statistics will be calculated. + * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField?: string; /** - * Specifies the output field name. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName?: string; /** - * Defines the type of statistic. **Known Values:** count | sum | min | max | avg | stddev | var + * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ @@ -37831,7 +38844,7 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) * * @param drawAction - * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of known values and type of draw action it creates. **Known Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse + * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of possible values and type of draw action it creates. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse * * Geometry type | Draw action instance * ------------- | -------------------- @@ -37842,16 +38855,16 @@ declare namespace __esri { * rectangle, circle, ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html) * @param drawOptions Object of the drawing options for the geometry to be created. * @param drawOptions.mode - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** * * Value | Description | * ----- | ----------- | - * hybrid | Vertices are added while the pointer is clicked or dragged. - * freehand | Vertices are added while the pointer is dragged. + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. * */ - create(drawAction: string, drawOptions: DrawCreateDrawOptions): DrawAction; + create(drawAction: string, drawOptions?: DrawCreateDrawOptions): DrawAction; /** * Resets the drawing by clearing the active action. * @@ -37864,7 +38877,7 @@ declare namespace __esri { interface DrawConstructor { /** - * The Draw class provides advanced drawing capabilities for developers who need complete control over creating temporary geometries. For example, if you want to prevent users from drawing self-intersecting lines or overlapping polygons, then you can use this class to implement these rules. The draw experience is built upon draw actions, which use the view events to generate a set of coordinates for creating new geometries. Each geometry type has a corresponding draw action class. + * The Draw class provides advanced drawing capabilities for developers who need complete control over creating temporary graphics with different geometries. For example, if you want to prevent users from drawing graphics with self-intersecting lines or overlapping polygons, then you can use this class to implement these rules. The draw experience is built upon draw actions, which use the view events to generate a set of coordinates for creating new geometries. Each geometry type has a corresponding draw action class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) */ @@ -37892,18 +38905,16 @@ declare namespace __esri { export interface DrawCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** * * Value | Description | * ----- | ----------- | - * hybrid | Vertices are added while the pointer is clicked or dragged. - * freehand | Vertices are added while the pointer is dragged. + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) - * - * @default hybrid */ mode?: string; } @@ -37987,19 +38998,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: MultipointDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: MultipointDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: MultipointDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: MultipointDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: MultipointDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: MultipointDrawActionRedoEventHandler): IHandle; } interface MultipointDrawActionConstructor { @@ -38014,82 +39012,6 @@ declare namespace __esri { } - export interface MultipointDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface MultipointDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface MultipointDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface PointDrawAction extends DrawAction { /** * An array of x,y coordinates for the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. @@ -38106,11 +39028,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; } interface PointDrawActionConstructor { @@ -38125,31 +39042,9 @@ declare namespace __esri { } - export interface PointDrawActionCursorUpdateEvent { - - coordinates: number[]; - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - } - - export interface PointDrawActionDrawCompleteEvent { - - coordinates: number[]; - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - } - interface PolygonDrawAction extends DrawAction { /** - * The drawing mode. **Known Values:** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** * * Value | Description | * ----- | ----------- | @@ -38178,19 +39073,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: PolygonDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: PolygonDrawActionRedoEventHandler): IHandle; } interface PolygonDrawActionConstructor { @@ -38203,7 +39085,7 @@ declare namespace __esri { interface PolygonDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. **Known Values:** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** * * Value | Description | * ----- | ----------- | @@ -38219,85 +39101,9 @@ declare namespace __esri { mode?: string; } - export interface PolygonDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface PolygonDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolygonDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface PolylineDrawAction extends DrawAction { /** - * The drawing mode. **Known Values:** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** * * Value | Description | * ----- | ----------- | @@ -38326,19 +39132,6 @@ declare namespace __esri { * */ complete(): void; - - - on(name: "cursor-update", eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; - - on(name: "vertex-remove", eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "undo", eventHandler: PolylineDrawActionUndoEventHandler): IHandle; - - on(name: "redo", eventHandler: PolylineDrawActionRedoEventHandler): IHandle; } interface PolylineDrawActionConstructor { @@ -38351,7 +39144,7 @@ declare namespace __esri { interface PolylineDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. **Known Values:** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** * * Value | Description | * ----- | ----------- | @@ -38367,83 +39160,21 @@ declare namespace __esri { mode?: string; } - export interface PolylineDrawActionCursorUpdateEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionDrawCompleteEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; - } - - export interface PolylineDrawActionRedoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionUndoEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - - export interface PolylineDrawActionVertexRemoveEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; - } - interface SegmentDrawAction extends DrawAction { + /** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * freehand | Vertices are added while the pointer is dragged. + * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) + * + * @default freehand + */ + mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. * @@ -38452,20 +39183,13 @@ declare namespace __esri { readonly vertices: number[][]; /** - * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. + * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#event:draw-complete) event. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#complete) * * */ complete(): void; - - - on(name: "cursor-update", eventHandler: SegmentDrawActionCursorUpdateEventHandler): IHandle; - - on(name: "draw-complete", eventHandler: SegmentDrawActionDrawCompleteEventHandler): IHandle; - - on(name: "vertex-add", eventHandler: SegmentDrawActionVertexAddEventHandler): IHandle; } interface SegmentDrawActionConstructor { @@ -38477,46 +39201,273 @@ declare namespace __esri { export const SegmentDrawAction: SegmentDrawActionConstructor; interface SegmentDrawActionProperties extends DrawActionProperties { - + /** + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * freehand | Vertices are added while the pointer is dragged. + * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) + * + * @default freehand + */ + mode?: string; } - export interface SegmentDrawActionCursorUpdateEvent { + export class BaseLayerView2D { + /** + * References the layer this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) represents. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#layer) + */ + layer: Layer; + /** + * The array of [Tile](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) objects computed to cover the MapView's visible area. This array is updated when the view is animating or the user is interacting with it. Then if tiles have been added or removed, [tilesChanged()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tiles) + */ + tiles: Tile[]; + /** + * References the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) belongs to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#view) + */ + view: MapView; - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; + /** + * Method called when after the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is created and right before it's asked to draw the layer's content. Typically this method is implemented to start watching property changes on the layer for example. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#attach) + * + * + */ + attach(): void; + /** + * Method called after the layer is removed and the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is about to be removed. Typically, this method is implemented to free resources like watchers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#detach) + * + * + */ + detach(): void; + /** + * The method to implement that is responsible of drawing the content of the layer. This method is called every time the MapView's state changes, or if [requestRender()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) has been called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) + * + * @param renderParameters + * @param renderParameters.context The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. + * @param renderParameters.stationary The stationary state of the `MapView`. + * @param renderParameters.state The object that describes view state. + * + */ + render(renderParameters: BaseLayerView2DRenderRenderParameters): void; + /** + * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) can call this method to ask the MapView to schedule a new rendering frame. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) + * + * + */ + protected requestRender(): void; + /** + * Method to implement, which notifies of tiles being added or removed for the current view state. This function can be implemented to start and stop fetching new data, or allocate and dispose resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) + * + * @param added The tile objects added for the current view viewport. + * @param removed The tile objects removed from the view viewport. + * + */ + tilesChanged(added: Tile[], removed: Tile[]): void; } - export interface SegmentDrawActionDrawCompleteEvent { - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertices: number[][]; + export interface BaseLayerView2DRenderRenderParameters extends Object { + /** + * The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) + */ + context: CanvasRenderingContext2D; + /** + * The stationary state of the `MapView`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) + */ + stationary: boolean; + /** + * The object that describes view state. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) + */ + state: ViewState; } - export interface SegmentDrawActionVertexAddEvent { - - defaultPrevented: boolean; - - preventDefault: Function; - - type: string; - - vertexIndex: number; - - vertices: number[][]; + /** + * Represents a tile reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + export interface Tile extends Object { + /** + * The tile string identifier in the format `level/row/col/world` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + id: string; + /** + * The level identifier of the [LOD](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html) to which the tile belongs + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + level: number; + /** + * The row identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + row: number; + /** + * The column identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + col: number; + /** + * When the projection allows world wrapping (e.g. Web Mercator), identifies the instance of the world this tile's `level`/`row`/`col`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + world: number; + /** + * The number of map units per pixel in the tile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + resolution: number; + /** + * The map scale at the tile's level. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + scale: number; + /** + * The coordinates of the top-left corner of the tile as an array of two numbers. The coordinates are in un-normalized map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + coords: number[]; + /** + * The bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) + */ + bounds: number[]; } + interface ViewState { + /** + * Represents the view's center point as an array of two numbers `[x, y]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#center) + */ + readonly center: number[]; + /** + * The extent represents the visible portion of a map within the view as an instance of Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) + */ + readonly extent: Extent; + /** + * Represents the size of one pixel in map units. The value of `resolution` is the result of the division of the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) width by the [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#resolution) + */ + readonly resolution: number; + /** + * The clockwise rotation of due north in relation to the top of the view in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#rotation) + */ + readonly rotation: number; + /** + * Represents the map scale at the center of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#scale) + */ + readonly scale: number; + /** + * Represents the width and height of the view in pixels, e.g. `[width, height]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size) + */ + readonly size: number[]; + + /** + * Creates a deep clone of ViewState object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#clone) + * + * + */ + clone(): ViewState; + /** + * Copies the properties from a given view state. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#copy) + * + * @param state The view state to copy the properties from. + * + */ + copy(state: ViewState): ViewState; + /** + * Converts the x and y screen coordinates to map coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toMap) + * + * @param out The receiving array of the conversion. + * @param x The horizontal screen coordinate to convert. + * @param y The vertical screen coordinate to convert. + * + */ + toMap(out: number[], x: number, y: number): number[]; + /** + * Converts the x and y map coordinates to screen coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen) + * + * @param out The receiving array of the conversion. + * @param x The horizontal screen coordinate to convert. + * @param y The vertical screen coordinate to convert. + * + */ + toScreen(out: number[], x: number, y: number): number[]; + /** + * Converts the x and y map coordinates to screen coordinates. This method is similar to [toScreen](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen), without applying the view state rotation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreenNoRotation) + * + * @param out The receiving array of the conversion. + * @param x The horizontal screen coordinate to convert. + * @param y The vertical screen coordinate to convert. + * + */ + toScreenNoRotation(out: number[], x: number, y: number): number[]; + } + + interface ViewStateConstructor { + + + + new(properties?: any): ViewState; + } + + export const ViewState: ViewStateConstructor; + /** * map/scene on screen. The ArcGIS API for JavaScript offers a low-level interface to access the SceneView's WebGL context, and thus enables creating custom visualizations that interact with the scene the same way as built-in layers. Developers can either write WebGL code directly, or integrate with third-party WebGL libraries. * @@ -39093,12 +40044,13 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not currently supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryExtent) * @@ -39108,12 +40060,13 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatureCount) * @@ -39122,28 +40075,30 @@ declare namespace __esri { */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). If query parameters are not provided, all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatures) * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. * */ - queryFeatures(params?: Query | QueryProperties): IPromise; + queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * Polyline, and Point geometries are not supported in the `geometry` query parameter. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryObjectIds) * @@ -39166,6 +40121,13 @@ declare namespace __esri { } interface FeatureLayerView extends LayerView { + /** + * The layer being viewed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#layer) + */ + readonly layer: FeatureLayer; + /** * Highlights the given feature(s). * > **Known Limitations** In 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this method is only supported for [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that have opted in to [WebGL rendering](esri-layers-FeatureLayer.html#webgl-rendering). @@ -39178,15 +40140,14 @@ declare namespace __esri { highlight(target?: Graphic | Graphic[] | number | number[]): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param) - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) * @@ -39196,15 +40157,14 @@ declare namespace __esri { queryExtent(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param) - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) * @@ -39213,34 +40173,32 @@ declare namespace __esri { */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. * */ - queryFeatures(params?: Query | QueryProperties): IPromise; + queryFeatures(params?: Query | QueryProperties): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. To query for ObjectIDs of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) method. - * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** - * * For spatial queries: - * * [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'` can be used to query against layers of any geometry type. - * * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries with `spatialRelationship = 'intersects'` can only be used to query against point layers. - * * Polyline, and Point geometries are not supported. - * * SQL expressions cannot be used in `outFields` nor `onStatisticField` (in the `outStatistics` param). - * * The following Query parameters are currently not supported: - * * `orderByField` - * * `distance` and `units` + * > **Known Limitations** **3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) limitations** Queries with `outStatistics` and any other parameter involving statistics are currently not supported. **SVG limitations (default)** Only the `geometry` , `objectIds`, and `spatialRelationship` properties are supported in the query object. Spatial queries only support [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) geometries with `spatialRelationship = 'intersects'`. **WebGL limitations** + * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. + * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. + * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): + * * GDM 2000 (4742) – Malaysia + * * Gusterberg (Ferro) (8042) – Austria/Czech Republic + * * ISN2016 (8086) - Iceland + * * SVY21 (4757) - Singapore * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) * @@ -39732,7 +40690,7 @@ declare namespace __esri { * * Object with a combination of `target`, `center` and `scale` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) and is equivalent to specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). * * - * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). Take note that if you pass in an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) as the `target` geometry, the `goTo` method will zoom to the nearest LOD of the basemap. + * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). If a tiled map service is used as the basemap and `snapToZoom` property is set to `true` in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints), the `goTo` method will zoom to the level of detail (LOD) of the basemap that is nearest to the defined `target`. If `snapToZoom` property is set to `false`, the `goTo` method will zoom to the exact `target`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) * @@ -40518,6 +41476,14 @@ declare namespace __esri { } interface SceneView extends View, BreakpointsOwner { + /** + * Allows the view to be partially or fully transparent when composited with the webpage elements behind it. This property can only be set once at construction time. When alpha compositing is enabled, web scenes are less performant. It's important to set this property to `true` only when you need to apply transparency on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) + * + * @default false + */ + alphaCompositingEnabled: boolean; /** * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. @@ -40557,6 +41523,20 @@ declare namespace __esri { * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; + * + * // Set a background color + * const view = new SceneView({ + * container: "view", + * map: map, + * environment: { + * background: { + * type: "color", + * color: [255, 252, 244, 1] + * }, + * starsEnabled: false, + * atmosphereEnabled: false + * } + * }); * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -40807,6 +41787,14 @@ declare namespace __esri { export const SceneView: SceneViewConstructor; interface SceneViewProperties extends ViewProperties, BreakpointsOwnerProperties { + /** + * Allows the view to be partially or fully transparent when composited with the webpage elements behind it. This property can only be set once at construction time. When alpha compositing is enabled, web scenes are less performant. It's important to set this property to `true` only when you need to apply transparency on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) + * + * @default false + */ + alphaCompositingEnabled?: boolean; /** * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. @@ -40846,6 +41834,20 @@ declare namespace __esri { * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; + * + * // Set a background color + * const view = new SceneView({ + * container: "view", + * map: map, + * environment: { + * background: { + * type: "color", + * color: [255, 252, 244, 1] + * }, + * starsEnabled: false, + * atmosphereEnabled: false + * } + * }); * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) @@ -41257,7 +42259,7 @@ declare namespace __esri { */ clipDistance?: SceneViewConstraintsClipDistanceProperties; /** - * When enabled, prevents the user from navigating below the surface in a local SceneView. + * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ @@ -41284,7 +42286,7 @@ declare namespace __esri { */ clipDistance?: SceneViewConstraintsClipDistance; /** - * When enabled, prevents the user from navigating below the surface in a local SceneView. + * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ @@ -41432,6 +42434,12 @@ declare namespace __esri { export interface SceneViewEnvironmentProperties extends Object { + /** + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ + background?: BackgroundProperties; /** * Lighting conditions of the scene. * @@ -41461,6 +42469,12 @@ declare namespace __esri { } export interface SceneViewEnvironment extends AnonymousAccessor { + /** + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ + background?: Background; /** * Lighting conditions of the scene. * @@ -41535,7 +42549,7 @@ declare namespace __esri { */ date?: DateProperties; /** - * Indicates whether to show shadows cast by the sun + * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) * @@ -41570,7 +42584,7 @@ declare namespace __esri { */ date?: Date; /** - * Indicates whether to show shadows cast by the sun + * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) * @@ -41648,7 +42662,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ - center?: number[]; + center?: number[] | Point; /** * The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. * @@ -41678,7 +42692,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ - position?: number; + position?: Point; } @@ -41865,10 +42879,10 @@ declare namespace __esri { * * @param component The component(s) to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param component.index The placement index of the component. This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * @param position The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual - * @param position.position The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position.position The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position.index The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. * */ @@ -41878,7 +42892,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#empty) * - * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * */ empty(position?: string): void; @@ -41889,8 +42903,8 @@ declare namespace __esri { * * @param component The component(s) to move. This value can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual - * @param position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * */ move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; @@ -41949,7 +42963,7 @@ declare namespace __esri { */ component: Widget | HTMLElement | string; /** - * The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ @@ -41965,7 +42979,7 @@ declare namespace __esri { export interface UIAddPosition extends Object { /** - * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ @@ -41987,7 +43001,7 @@ declare namespace __esri { */ component: Widget | HTMLElement | string; /** - * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ @@ -42210,7 +43224,7 @@ declare namespace __esri { interface ViewAnimation extends Accessor, corePromise { /** - * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Known Values:** running | finished | stopped + * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Possible Values:** running | finished | stopped * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) * @@ -42928,13 +43942,111 @@ declare namespace __esri { search?: SearchProperties; } + interface Background extends Accessor, JSONSupport { + /** + * Creates a deep clone of the Background. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html#clone) + * + * + */ + clone(): Background; + } + + interface BackgroundConstructor { + /** + * The background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) that lies behind the sky, atmosphere and stars. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) + */ + + new(properties?: BackgroundProperties): Background; + + fromJSON(json: any): Background; + } + + export const Background: BackgroundConstructor; + + interface BackgroundProperties { + + } + + interface ColorBackground extends Background, JSONSupport { + /** + * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) + * + * @default black + */ + color: Color; + + /** + * Creates a deep clone of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#clone) + * + * + */ + clone(): ColorBackground; + } + + interface ColorBackgroundConstructor { + /** + * This type of [Background](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) allows to set a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) as the background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The view environment stars and atmosphere will show on top of the background when enabled. To have a clear background color only, make sure to set both the [view.environment.starsEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) and [view.environment.atmosphereEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) properties to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) + */ + + new(properties?: ColorBackgroundProperties): ColorBackground; + + fromJSON(json: any): ColorBackground; + } + + export const ColorBackground: ColorBackgroundConstructor; + + interface ColorBackgroundProperties extends BackgroundProperties { + /** + * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) + * + * @default black + */ + color?: Color | number[] | string; + } + interface Environment extends Accessor { + /** + * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) + * + * @default true + */ + atmosphereEnabled: boolean; + /** + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) + * + * @default null + */ + background: Background; /** * Settings for defining the lighting of the scene. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting: Lighting; + /** + * Specifies whether stars should be displayed in the sky. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) + * + * @default true + */ + starsEnabled: boolean; /** * Creates a deep clone of this object. @@ -42955,12 +44067,36 @@ declare namespace __esri { export const Environment: EnvironmentConstructor; interface EnvironmentProperties { + /** + * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) + * + * @default true + */ + atmosphereEnabled?: boolean; + /** + * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) + * + * @default null + */ + background?: BackgroundProperties; /** * Settings for defining the lighting of the scene. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting?: LightingProperties; + /** + * Specifies whether stars should be displayed in the sky. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) + * + * @default true + */ + starsEnabled?: boolean; } interface websceneInitialViewProperties extends Accessor, corePromise { @@ -42977,7 +44113,7 @@ declare namespace __esri { */ spatialReference: SpatialReference; /** - * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) * @@ -43023,7 +44159,7 @@ declare namespace __esri { */ spatialReference?: SpatialReferenceProperties; /** - * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) * @@ -43048,7 +44184,7 @@ declare namespace __esri { */ date: Date; /** - * The type of direct shadows. + * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) * @@ -43092,7 +44228,7 @@ declare namespace __esri { */ date?: DateProperties; /** - * The type of direct shadows. + * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) * @@ -43177,6 +44313,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment: Environment; + /** + * Ground properties for this slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) + */ + ground: SlideGround; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). * @@ -43307,6 +44449,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment?: EnvironmentProperties; + /** + * Ground properties for this slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) + */ + ground?: SlideGroundProperties; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). * @@ -43450,6 +44598,25 @@ declare namespace __esri { } + export interface SlideGroundProperties extends Object { + /** + * Ground opacity + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) + */ + opacity?: number; + } + + export interface SlideGround extends AnonymousAccessor { + /** + * Ground opacity + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) + */ + opacity?: number; + } + + export interface SlideThumbnailProperties extends Object { /** * The URI pointing to the thumbnail image representing the slide. @@ -43611,6 +44778,12 @@ declare namespace __esri { } interface AreaMeasurement3D extends Widget { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) + */ + unit: string; /** * List of unit options in the widget drop down list. * @@ -43655,6 +44828,12 @@ declare namespace __esri { export const AreaMeasurement3D: AreaMeasurement3DConstructor; interface AreaMeasurement3DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) + */ + unit?: string; /** * List of unit options in the widget drop down list. * @@ -43700,7 +44879,7 @@ declare namespace __esri { */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Known Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unit) */ @@ -43742,7 +44921,7 @@ declare namespace __esri { export interface AreaMeasurement3DViewModelMeasurement extends Object { /** - * Describes the mode in which the measurement was taken. In `euclidean` mode, the area and perimeter length are computed from a flat polygon with straight segments on the perimeter in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid. **Known Values:** euclidean | geodesic + * Describes the mode in which the measurement was taken. In `euclidean` mode, the area and perimeter length are computed from a flat polygon with straight segments on the perimeter in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ @@ -43796,7 +44975,7 @@ declare namespace __esri { */ readonly attributionText: string; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) */ @@ -43881,7 +45060,7 @@ declare namespace __esri { */ readonly items: Collection; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** ready | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#state) * @@ -43937,7 +45116,7 @@ declare namespace __esri { */ activeBasemap: Basemap; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ @@ -43997,7 +45176,7 @@ declare namespace __esri { */ activeBasemap?: BasemapProperties; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ @@ -44042,7 +45221,7 @@ declare namespace __esri { */ source: LocalBasemapsSource | PortalBasemapsSource; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** ready | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#state) * @@ -44117,7 +45296,7 @@ declare namespace __esri { */ readonly error: Error; /** - * The item's state. **Known Values:** loading | ready | error + * The item's state. **Possible Values:** loading | ready | error * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#state) * @@ -44215,6 +45394,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query: any | string; + /** + * Callback for updating basemaps after being fetched and filtered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) + */ + updateBasemapsCallback: Function; } interface PortalBasemapsSourceConstructor { @@ -44244,6 +45429,12 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query?: any | string; + /** + * Callback for updating basemaps after being fetched and filtered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) + */ + updateBasemapsCallback?: Function; } interface BasemapToggle extends Widget { @@ -44359,7 +45550,7 @@ declare namespace __esri { */ nextBasemap: Basemap; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** ready | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#state) * @@ -44419,6 +45610,194 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } + interface Bookmarks extends Widget, GoTo { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) + */ + bookmarks: Collection; + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#iconClass) + */ + readonly iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#label) + */ + readonly label: string; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) + */ + view: MapView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) + */ + viewModel: BookmarksViewModel; + + /** + * Zoom to a specific bookmark. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#goTo) + * + * @param Bookmark The bookmark to zoom to. + * + */ + goTo(Bookmark: Bookmark): IPromise; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#render) + * + * + */ + render(): any; + } + + interface BookmarksConstructor { + /** + * The Bookmarks widget allows end users to quickly navigate to a particular area of interest. It displays a list of bookmarks, which typically are defined inside the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) + */ + + new(properties?: BookmarksProperties): Bookmarks; + } + + export const Bookmarks: BookmarksConstructor; + + interface BookmarksProperties extends WidgetProperties, GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) + */ + bookmarks?: CollectionProperties; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) + */ + view?: MapViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) + */ + viewModel?: BookmarksViewModelProperties; + } + + interface Bookmark { + /** + * The `active` property is true while goTo() is animating. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#active) + * + * @default false + */ + active: boolean; + /** + * The extent of the specified bookmark item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#extent) + */ + extent: Extent; + /** + * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#name) + */ + name: string; + /** + * The URL for a thumbnail image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) + */ + thumbnail: BookmarkThumbnail; + } + + interface BookmarkConstructor { + + + + new(properties?: any): Bookmark; + } + + export const Bookmark: BookmarkConstructor; + + + export interface BookmarkThumbnail extends Object { + /** + * URL to a thumbnail to display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html#thumbnail) + */ + url?: string; + } + + interface BookmarksViewModel extends Accessor, GoTo { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) + */ + bookmarks: Collection; + /** + * The view model's state. **Possible Values:** loading | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) + */ + view: MapView; + + /** + * Zoom to a specific bookmark. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#goTo) + * + * @param Bookmark The bookmark to zoom to. + * + */ + goTo(Bookmark: Bookmark): IPromise; + } + + interface BookmarksViewModelConstructor { + + + new(properties?: BookmarksViewModelProperties): BookmarksViewModel; + } + + export const BookmarksViewModel: BookmarksViewModelConstructor; + + interface BookmarksViewModelProperties extends GoToProperties { + /** + * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-Bookmark.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) + */ + bookmarks?: CollectionProperties; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) + */ + view?: MapViewProperties; + } + interface ColorSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. @@ -44681,9 +46060,9 @@ declare namespace __esri { label: string; } - interface Compass extends Widget { + interface Compass extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#iconClass) */ @@ -44737,7 +46116,7 @@ declare namespace __esri { export const Compass: CompassConstructor; - interface CompassProperties extends WidgetProperties { + interface CompassProperties extends WidgetProperties, GoToProperties { /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). * @@ -44752,7 +46131,7 @@ declare namespace __esri { viewModel?: CompassViewModelProperties; } - interface CompassViewModel extends Accessor { + interface CompassViewModel extends Accessor, GoTo { /** * The orientation axes (x, y, z). * @@ -44762,7 +46141,7 @@ declare namespace __esri { */ orientation: any; /** - * The view model's state. **Known Values:** compass | rotation | disabled + * The view model's state. **Possible Values:** compass | rotation | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#state) * @@ -44798,7 +46177,7 @@ declare namespace __esri { export const CompassViewModel: CompassViewModelConstructor; - interface CompassViewModelProperties { + interface CompassViewModelProperties extends GoToProperties { /** * The orientation axes (x, y, z). * @@ -44815,7 +46194,7 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - interface CoordinateConversion extends Widget { + interface CoordinateConversion extends Widget, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. * @@ -44835,7 +46214,7 @@ declare namespace __esri { */ formats: Collection; /** - * Describes the current mode of the widget. **Known Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. * @@ -44853,7 +46232,7 @@ declare namespace __esri { */ multipleConversions: boolean; /** - * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Known Values:** auto | expand-up | expand-down + * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) * @@ -44913,7 +46292,7 @@ declare namespace __esri { export const CoordinateConversion: CoordinateConversionConstructor; - interface CoordinateConversionProperties extends WidgetProperties { + interface CoordinateConversionProperties extends WidgetProperties, GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. * @@ -44933,7 +46312,7 @@ declare namespace __esri { */ formats?: CollectionProperties; /** - * Describes the current mode of the widget. **Known Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. * @@ -44951,7 +46330,7 @@ declare namespace __esri { */ multipleConversions?: boolean; /** - * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Known Values:** auto | expand-up | expand-down + * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) * @@ -44980,7 +46359,7 @@ declare namespace __esri { viewModel?: CoordinateConversionViewModelProperties; } - interface CoordinateConversionViewModel extends Accessor { + interface CoordinateConversionViewModel extends Accessor, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. * @@ -45006,7 +46385,7 @@ declare namespace __esri { */ locationSymbol: SimpleMarkerSymbol | PictureMarkerSymbol; /** - * Describes the current mode of the widget. **Known Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. * @@ -45024,7 +46403,7 @@ declare namespace __esri { */ requestDelay: number; /** - * The view model's state. **Known Values:** ready | loading | disabled + * The view model's state. **Possible Values:** ready | loading | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#state) * @@ -45078,7 +46457,7 @@ declare namespace __esri { export const CoordinateConversionViewModel: CoordinateConversionViewModelConstructor; - interface CoordinateConversionViewModelProperties { + interface CoordinateConversionViewModelProperties extends GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. * @@ -45104,7 +46483,7 @@ declare namespace __esri { */ locationSymbol?: SimpleMarkerSymbolProperties | PictureMarkerSymbolProperties; /** - * Describes the current mode of the widget. **Known Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. * @@ -45235,23 +46614,28 @@ declare namespace __esri { * @default null */ name: string; + /** + * The [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) for this format. Coordinates generated for a format will be derived from points in this spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#spatialReference) + */ + spatialReference: SpatialReference; + /** + * The view model of the [CoordinateConversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) widget that is utilizing this format. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#viewModel) + */ + viewModel: CoordinateConversionViewModel; } export const Format: Format; /** - * Information describing how a Format should be projected. Used to define custom Formats. 1. If the conversion can be performed synchronously, a convert function should be defined. 2. If the conversion cannot be performed synchronously, a convertDeferred function should be defined. 3. Alternatively, a [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) can be provided, and the Format will project to this Spatial Reference. + * This object describes how a Format should be projected and formatted for display. Used to define custom Formats that require custom conversion and/or projection logic. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) */ export interface ConversionInfo extends Object { - /** - * The SpatialReference to project to. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - */ - spatialReference?: SpatialReference; - /** * A function that takes a point and returns a [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position). * @@ -45260,14 +46644,6 @@ declare namespace __esri { * */ convert(): void; - /** - * A function that takes a point and returns a promise that resolves into a [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - * - * - */ - convertDeferred(): void; /** * A function that takes a string and returns a Point. * @@ -45325,9 +46701,9 @@ declare namespace __esri { coordinate: string; } - interface Directions extends Widget { + interface Directions extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#iconClass) */ @@ -45425,7 +46801,7 @@ declare namespace __esri { export const Directions: DirectionsConstructor; - interface DirectionsProperties extends WidgetProperties { + interface DirectionsProperties extends WidgetProperties, GoToProperties { /** * The maximum number of stops allowed for routing. * @@ -45476,7 +46852,7 @@ declare namespace __esri { viewModel?: DirectionsViewModelProperties; } - interface DirectionsViewModel extends Accessor { + interface DirectionsViewModel extends Accessor, GoTo { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). * @@ -45655,7 +47031,7 @@ declare namespace __esri { export const DirectionsViewModel: DirectionsViewModelConstructor; - interface DirectionsViewModelProperties { + interface DirectionsViewModelProperties extends GoToProperties { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). * @@ -45759,7 +47135,7 @@ declare namespace __esri { */ description: string; /** - * Number indicating the message type returned from the service. This number correlates to one of the known values listed below. + * Number indicating the message type returned from the service. This number correlates to one of the possible values listed below. * * Number | Value * ------|------------ @@ -46033,7 +47409,7 @@ declare namespace __esri { /** * The view of the widget. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + * [Read more...](global.html) */ view?: MapView | SceneView; /** @@ -46045,6 +47421,12 @@ declare namespace __esri { } interface DirectLineMeasurement3D extends Widget { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) + */ + unit: string; /** * List of unit options in the widget drop down list. * @@ -46089,6 +47471,12 @@ declare namespace __esri { export const DirectLineMeasurement3D: DirectLineMeasurement3DConstructor; interface DirectLineMeasurement3DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) + */ + unit?: string; /** * List of unit options in the widget drop down list. * @@ -46134,7 +47522,7 @@ declare namespace __esri { */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Known Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit) */ @@ -46176,7 +47564,7 @@ declare namespace __esri { export interface DirectLineMeasurement3DViewModelMeasurement extends Object { /** - * Describes the mode in which the measurement was taken. In `euclidean` mode, the distances are measured as straight lines in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the distances are measured as geodesic lines on the WGS84 ellipsoid. **Known Values:** euclidean | geodesic + * Describes the mode in which the measurement was taken. In `euclidean` mode, the distances are measured as straight lines in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the distances are measured as geodesic lines on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ @@ -46265,7 +47653,7 @@ declare namespace __esri { */ readonly expanded: boolean; /** - * Icon font used to style the Expand button. + * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ @@ -46390,7 +47778,7 @@ declare namespace __esri { */ content?: Node | string | WidgetProperties; /** - * Icon font used to style the Expand button. + * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ @@ -46468,7 +47856,7 @@ declare namespace __esri { */ group: string; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** ready | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#state) * @@ -46784,7 +48172,7 @@ declare namespace __esri { */ element: HTMLElement; /** - * The view model's state. **Known Values:** active | ready | feature-unsupported | disabled + * The view model's state. **Possible Values:** active | ready | feature-unsupported | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#state) * @@ -46847,9 +48235,9 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - interface Home extends Widget { + interface Home extends Widget, GoTo { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#iconClass) */ @@ -46912,7 +48300,7 @@ declare namespace __esri { export const Home: HomeConstructor; - interface HomeProperties extends WidgetProperties { + interface HomeProperties extends WidgetProperties, GoToProperties { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. * @@ -46936,7 +48324,7 @@ declare namespace __esri { viewpoint?: ViewpointProperties; } - interface HomeViewModel extends Accessor, Evented { + interface HomeViewModel extends Accessor, Evented, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | going-home * @@ -46981,7 +48369,7 @@ declare namespace __esri { export const HomeViewModel: HomeViewModelConstructor; - interface HomeViewModelProperties { + interface HomeViewModelProperties extends GoToProperties { /** * The view associated with the widget instance. * @@ -47003,7 +48391,7 @@ declare namespace __esri { interface LayerList extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#iconClass) */ @@ -47019,7 +48407,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ - listItemCreatedFunction: Function; + listItemCreatedFunction: ListItemCreatedHandler; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. * @@ -47056,7 +48444,7 @@ declare namespace __esri { */ render(): any; /** - * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#triggerAction) * @@ -47064,7 +48452,7 @@ declare namespace __esri { * @param item An item associated with the action. * */ - triggerAction(action: Action, item: ListItem): void; + triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListConstructor { @@ -47081,7 +48469,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ - listItemCreatedFunction?: Function; + listItemCreatedFunction?: ListItemCreatedHandler; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. * @@ -47124,7 +48512,7 @@ declare namespace __esri { */ readonly operationalItems: Collection; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** loading | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#state) * @@ -47139,7 +48527,7 @@ declare namespace __esri { view: MapView | SceneView; /** - * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#triggerAction) * @@ -47147,7 +48535,7 @@ declare namespace __esri { * @param item An item associated with the action. * */ - triggerAction(action: Action, item: ListItem): void; + triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListViewModelConstructor { @@ -47187,7 +48575,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) */ - actionsSections: Collection>; + actionsSections: Collection>; /** * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer. * @@ -47362,9 +48750,11 @@ declare namespace __esri { export const ListItemPanel: ListItemPanelConstructor; + export type ListItemCreatedHandler = (event: any) => void; + interface Legend extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#iconClass) */ @@ -47469,7 +48859,7 @@ declare namespace __esri { layer: Layer; } - interface Locate extends Widget { + interface Locate extends Widget, GoTo { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. * @@ -47493,11 +48883,17 @@ declare namespace __esri { */ graphic: Graphic; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#label) + */ + readonly label: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). * @@ -47557,7 +48953,7 @@ declare namespace __esri { export const Locate: LocateConstructor; - interface LocateProperties extends WidgetProperties { + interface LocateProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. * @@ -47581,7 +48977,7 @@ declare namespace __esri { */ graphic?: GraphicProperties; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ @@ -47616,7 +49012,7 @@ declare namespace __esri { viewModel?: LocateViewModelProperties; } - interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | locating * @@ -47648,13 +49044,13 @@ declare namespace __esri { export const LocateViewModel: LocateViewModelConstructor; - interface LocateViewModelProperties extends GeolocationPositioningProperties { + interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties { } interface NavigationToggle extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#iconClass) */ @@ -47826,13 +49222,21 @@ declare namespace __esri { view?: SceneViewProperties; } - interface Popup extends Widget, Evented { + interface Popup extends Widget, GoTo, Evented { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ - actions: Collection; + actions: Collection; + /** + * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) + * + * @default "auto" + */ + alignment: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. * @@ -47864,7 +49268,7 @@ declare namespace __esri { */ content: string | HTMLElement | Widget; /** - * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Known Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right + * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Possible Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#currentDockPosition) */ @@ -47904,7 +49308,8 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -48070,13 +49475,21 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties extends WidgetProperties { + interface PopupProperties extends WidgetProperties, GoToProperties { /** - * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ - actions?: CollectionProperties; + actions?: CollectionProperties; + /** + * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) + * + * @default "auto" + */ + alignment?: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. * @@ -48134,7 +49547,8 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) * @@ -48191,13 +49605,19 @@ declare namespace __esri { visible?: boolean; } - interface PopupViewModel extends Accessor, Evented { + interface PopupViewModel extends Accessor, Evented, GoTo { /** - * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ - actions: Collection; + actions: Collection; + /** + * A collection of [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggles](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) used within the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#allActions) + */ + readonly allActions: Collection; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. * @@ -48227,7 +49647,8 @@ declare namespace __esri { */ features: Graphic[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -48275,7 +49696,7 @@ declare namespace __esri { */ selectedFeatureIndex: number; /** - * The view model's state. **Known Values:** ready | disabled + * The view model's state. **Possible Values:** ready | disabled * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#state) * @@ -48351,13 +49772,13 @@ declare namespace __esri { export const PopupViewModel: PopupViewModelConstructor; - interface PopupViewModelProperties { + interface PopupViewModelProperties extends GoToProperties { /** - * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ - actions?: CollectionProperties; + actions?: CollectionProperties; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. * @@ -48379,7 +49800,8 @@ declare namespace __esri { */ features?: GraphicProperties[]; /** - * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * > **Known Limitation** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) rendered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) * @@ -48426,7 +49848,7 @@ declare namespace __esri { export interface PopupViewModelTriggerActionEvent { - action: Action; + action: ActionButton | ActionToggle; } @@ -48499,7 +49921,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ - content?: string; + content?: string | HTMLElement | Widget; /** * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. * @@ -48546,7 +49968,7 @@ declare namespace __esri { interface Print extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#iconClass) */ @@ -48725,9 +50147,19 @@ declare namespace __esri { */ dpi: string; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) + * + * @default false + */ + forceFeatureAttributes: boolean; + /** + * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) + * + * @default pdf */ format: string; /** @@ -48753,6 +50185,8 @@ declare namespace __esri { * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + * + * @default letter-ansi-a-landscape */ layout: string; /** @@ -48823,9 +50257,19 @@ declare namespace __esri { */ dpi?: string; /** - * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) + * + * @default false + */ + forceFeatureAttributes?: boolean; + /** + * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) + * + * @default pdf */ format?: string; /** @@ -48851,6 +50295,8 @@ declare namespace __esri { * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + * + * @default letter-ansi-a-landscape */ layout?: string; /** @@ -48885,13 +50331,13 @@ declare namespace __esri { interface ScaleBar extends Widget { /** - * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style: string; /** - * Units to use for the scale bar. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) * @@ -48935,13 +50381,13 @@ declare namespace __esri { interface ScaleBarProperties extends WidgetProperties { /** - * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style?: string; /** - * Units to use for the scale bar. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) * @@ -48988,11 +50434,13 @@ declare namespace __esri { view?: MapViewProperties; } - interface widgetsSearch extends Widget { + interface widgetsSearch extends Widget, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSource) + * + * @default null */ readonly activeSource: FeatureLayer | Locator; /** @@ -49020,17 +50468,19 @@ declare namespace __esri { */ autoSelect: boolean; /** - * The default source used for the Search widget. These can range from a [Locator Source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) to a [Feature Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#defaultSource) - */ - readonly defaultSource: LocatorSource | FeatureLayerSource; - /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#iconClass) */ readonly iconClass: string; + /** + * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) + * + * @default true + */ + includeDefaultSources: boolean | Function; /** * The widget's default label. * @@ -49090,8 +50540,16 @@ declare namespace __esri { * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) + * + * @default null */ popupTemplate: PopupTemplate; + /** + * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) + */ + portal: Portal; /** * The graphic used to highlight the resulting feature or location. * @@ -49111,7 +50569,7 @@ declare namespace __esri { * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) */ - results: any[]; + readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * @@ -49143,14 +50601,6 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ sources: Collection; - /** - * The current state of the widget. **Known Values:** ready | disabled | searching - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#state) - * - * @default ready - */ - readonly state: string; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * @@ -49242,7 +50692,7 @@ declare namespace __esri { export const widgetsSearch: widgetsSearchConstructor; - interface widgetsSearchProperties extends WidgetProperties { + interface widgetsSearchProperties extends WidgetProperties, GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -49267,6 +50717,14 @@ declare namespace __esri { * @default true */ autoSelect?: boolean; + /** + * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) + * + * @default true + */ + includeDefaultSources?: boolean | Function; /** * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). @@ -49320,8 +50778,16 @@ declare namespace __esri { * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) + * + * @default null */ popupTemplate?: PopupTemplateProperties; + /** + * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) + */ + portal?: PortalProperties; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. * @@ -49330,12 +50796,6 @@ declare namespace __esri { * @default true */ resultGraphicEnabled?: boolean; - /** - * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) - */ - results?: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * @@ -49383,7 +50843,7 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface SearchViewModel extends Accessor, Evented { + interface SearchViewModel extends Accessor, Evented, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). * @@ -49406,40 +50866,79 @@ declare namespace __esri { * @default "Find address or place" */ allPlaceholder: string; + /** + * The combined collection of [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) and [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). The [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) displays first in the Search UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allSources) + */ + readonly allSources: Collection; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) + * + * @default true */ autoSelect: boolean; /** - * The default source used for the Search widget. + * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [FeaturelayerSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) and/or [LocatorSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSource) + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) */ - readonly defaultSource: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + readonly defaultSources: Collection; + /** + * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) + * + * @default PictureMarkerSymbol + */ + defaultSymbol: Symbol; + /** + * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) + * + * @default true + */ + includeDefaultSources: boolean | Function; + /** + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) + */ + locationEnabled: boolean; /** * The maximum character length of the search text. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) + * + * @default 128 */ maxInputLength: number; /** * The maximum number of results returned by the widget if not specified by the source. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) + * + * @default 6 */ maxResults: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) + * + * @default 6 */ maxSuggestions: number; /** * The minimum number of characters needed for the search if not specified by the source. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) + * + * @default 1 */ minSuggestCharacters: number; /** @@ -49452,24 +50951,38 @@ declare namespace __esri { * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + * + * @default true */ popupEnabled: boolean; /** * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + * + * @default true */ popupOpenOnSelect: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) + * + * @default null */ popupTemplate: PopupTemplate; + /** + * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) + */ + portal: Portal; /** * The graphic used to highlight the resulting feature or location. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) + * + * @default null */ readonly resultGraphic: Graphic; /** @@ -49484,12 +50997,16 @@ declare namespace __esri { * An array of current results from the search. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) + * + * @default null */ - results: any[]; + readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + * + * @default true */ searchAllEnabled: boolean; /** @@ -49502,8 +51019,18 @@ declare namespace __esri { * The result selected from a search. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedResult) + * + * @default null */ readonly selectedResult: any; + /** + * The selected SuggestResult. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedSuggestion) + * + * @default null + */ + readonly selectedSuggestion: Geometry | SearchViewModelSuggestResult; /** * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) @@ -49515,28 +51042,44 @@ declare namespace __esri { * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ sources: Collection; + /** + * The current state of the widget. This property was removed from [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) and should now be accessed within the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html). **Possible Values:** ready | disabled | searching + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#state) + * + * @default ready + */ + readonly state: string; /** * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) + * + * @default 150 */ suggestionDelay: number; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestions) + * + * @default null */ readonly suggestions: SearchViewModelSuggestResult[]; /** * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + * + * @default true */ suggestionsEnabled: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) + * + * @default null */ view: MapView | SceneView; @@ -49557,6 +51100,14 @@ declare namespace __esri { * */ search(searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][]): IPromise; + /** + * Returns search results near your current location. It checks whether [locationEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) is `true`. If so, and your browser supports [geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation), it will return search results nearby your current location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchNearby) + * + * + */ + searchNearby(): IPromise; /** * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e.`supportsPagination = true`. * @@ -49589,7 +51140,7 @@ declare namespace __esri { export const SearchViewModel: SearchViewModelConstructor; - interface SearchViewModelProperties { + interface SearchViewModelProperties extends GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. * @@ -49610,50 +51161,95 @@ declare namespace __esri { * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) + * + * @default true */ autoSelect?: boolean; + /** + * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) + * + * @default PictureMarkerSymbol + */ + defaultSymbol?: SymbolProperties; + /** + * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) + * + * @default true + */ + includeDefaultSources?: boolean | Function; + /** + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) + */ + locationEnabled?: boolean; /** * The maximum character length of the search text. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) + * + * @default 128 */ maxInputLength?: number; /** * The maximum number of results returned by the widget if not specified by the source. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) + * + * @default 6 */ maxResults?: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) + * + * @default 6 */ maxSuggestions?: number; /** * The minimum number of characters needed for the search if not specified by the source. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) + * + * @default 1 */ minSuggestCharacters?: number; /** * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + * + * @default true */ popupEnabled?: boolean; /** * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + * + * @default true */ popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) + * + * @default null */ popupTemplate?: PopupTemplateProperties; + /** + * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) + */ + portal?: PortalProperties; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. * @@ -49662,16 +51258,12 @@ declare namespace __esri { * @default true */ resultGraphicEnabled?: boolean; - /** - * An array of current results from the search. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) - */ - results?: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + * + * @default true */ searchAllEnabled?: boolean; /** @@ -49695,18 +51287,24 @@ declare namespace __esri { * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) + * + * @default 150 */ suggestionDelay?: number; /** * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + * + * @default true */ suggestionsEnabled?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) + * + * @default null */ view?: MapViewProperties | SceneViewProperties; } @@ -51061,7 +52659,7 @@ declare namespace __esri { interface SketchViewModel extends Accessor, Evented { /** - * Graphic representing the temporary geometry that is being drawn on the view. + * Graphic representing the sketch that is being drawn on the view. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) */ @@ -51073,29 +52671,56 @@ declare namespace __esri { */ layer: GraphicsLayer; /** - * A simple marker symbol used for representing the point geometry that is being drawn. + * A simple marker symbol used for representing the point geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-marker", + * style: "circle", + * size: 6, + * color: [255, 255, 255], + * outline: { + * color: [50, 50, 50], + * width: 1 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol: SimpleMarkerSymbol; /** - * A simple fill symbol used for representing the polygon geometry that is being drawn. + * A simple fill symbol used for representing the polygon geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-fill", + * color: [150, 150, 150, 0.2], + * outline: { + * color: [50, 50, 50], + * width: 2 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; /** - * A simple line symbol used for representing the polyline geometry that is being drawn. + * A simple line symbol used for representing the polyline geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-line", + * color: [130, 130, 130], + * width: 2 + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol: SimpleLineSymbol; /** - * The view model's state. **Known Values:** ready | disabled + * The sketch view model's state. **Possible Values:** ready | disabled | creating | updating * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#state) - * - * @default disabled */ readonly state: string; /** @@ -51106,7 +52731,7 @@ declare namespace __esri { view: MapView; /** - * Completes the active drawing and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:draw-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. + * Completes the active drawing and fires the [create-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) * @@ -51114,33 +52739,23 @@ declare namespace __esri { */ complete(): void; /** - * Creates an instance of the requested draw action type. See the table below for a list of known values and type of draw action it creates. **Known Values:** point | multipoint | polyline | polygon | rectangle | circle - * - * Geometry type | Draw action instance - * ------------- | -------------------- - * point | [PointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html) - * multipoint | [MultipointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html) - * polyline | [PolylineDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html) - * polygon | [PolygonDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html) - * rectangle/square, circle/ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html) - * - * **Note:** Creating circle does not work in all spatial references. + * Creates the requested draw action. **Note:** Creating a circle geometry does not work in all spatial references. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) * - * @param drawAction Name of the draw action tool. + * @param drawAction Name of the draw action tool. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle * @param drawOptions Object of the drawing options for the geometry to be created. * @param drawOptions.mode - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** * * Value | Description | * ----- | ----------- | - * hybrid | Vertices are added while the pointer is clicked or dragged. - * freehand | Vertices are added while the pointer is dragged. + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. * */ - create(drawAction: string, drawOptions: SketchViewModelCreateDrawOptions): void; + create(drawAction: string, drawOptions?: SketchViewModelCreateDrawOptions): void; /** * Resets SketchViewModel to prepare for another create operation. Reset discards the current drawing, if called mid drawing. * @@ -51150,19 +52765,19 @@ declare namespace __esri { */ reset(): void; /** - * Starts an update operation for the selected geometry and fires [update-start](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-start) event. + * Initializes an update operation for the selected geometry and fires [update-init](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-init) event. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) * - * @param geometry The geometry to be updated. + * @param graphic The graphic to be updated. * */ - update(geometry: Geometry): void; + update(graphic: Graphic): void; } interface SketchViewModelConstructor { /** - * SketchViewModel simplifies the process of adding temporary geometries to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). It saves the effort of writing lots of code for sketching different geometry types. SketchViewModel is intended for basic usage, without advanced features such as preventing self-intersecting lines or overlapping polygons. If more control is required for creating temporary geometries, then use the [Draw](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) class instead. + * SketchViewModel simplifies the process of adding and updating graphics on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SketchViewModel is intended to be used with [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Its [events](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#events-summary) allow control of a graphic's geometry. Use the [DrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) class if more fine-grained control is needed with vertices when creating graphics. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) */ @@ -51180,19 +52795,48 @@ declare namespace __esri { */ layer?: GraphicsLayerProperties; /** - * A simple marker symbol used for representing the point geometry that is being drawn. + * A simple marker symbol used for representing the point geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-marker", + * style: "circle", + * size: 6, + * color: [255, 255, 255], + * outline: { + * color: [50, 50, 50], + * width: 1 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol?: SimpleMarkerSymbolProperties; /** - * A simple fill symbol used for representing the polygon geometry that is being drawn. + * A simple fill symbol used for representing the polygon geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-fill", + * color: [150, 150, 150, 0.2], + * outline: { + * color: [50, 50, 50], + * width: 2 + * } + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; /** - * A simple line symbol used for representing the polyline geometry that is being drawn. + * A simple line symbol used for representing the polyline geometry that is being drawn. The default value is the following: + * ```js + * { + * type: "simple-line", + * color: [130, 130, 130], + * width: 2 + * } + * ``` * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ @@ -51208,18 +52852,16 @@ declare namespace __esri { export interface SketchViewModelCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode only applies when creating `polygon` and `polyline` geometries. **Known Values:** + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** * * Value | Description | * ----- | ----------- | - * hybrid | Vertices are added while the pointer is clicked or dragged. - * freehand | Vertices are added while the pointer is dragged. + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. * * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) - * - * @default hybrid */ mode?: string; } @@ -51310,6 +52952,32 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } + interface GoTo { + /** + * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) + */ + goToOverride: GoToOverride; + } + + interface GoToConstructor { + + + new(): GoTo; + } + + export const GoTo: GoToConstructor; + + interface GoToProperties { + /** + * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) + */ + goToOverride?: GoToOverride; + } + interface widget { /** @@ -51381,7 +53049,29 @@ declare namespace __esri { export const widget: widget; - interface Track extends Widget { + export type GoToOverride = (view: MapView | SceneView, goToParameters: GoToParameters) => void; + + /** + * The following parameters passed to either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. For additional information on what can be passed to its `target` or `options`, please refer to documentation for either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) + */ + export interface GoToParameters extends Object { + /** + * The target location/viewpoint to animate to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) + */ + target: any; + /** + * Animation options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) + */ + options?: any; + } + + interface Track extends Widget, GoTo { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. * @@ -51405,7 +53095,7 @@ declare namespace __esri { */ graphic: Graphic; /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#iconClass) */ @@ -51491,7 +53181,7 @@ declare namespace __esri { export const Track: TrackConstructor; - interface TrackProperties extends WidgetProperties { + interface TrackProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. * @@ -51544,7 +53234,7 @@ declare namespace __esri { viewModel?: TrackViewModelProperties; } - interface TrackViewModel extends Accessor, Evented, GeolocationPositioning { + interface TrackViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | tracking | waiting * @@ -51592,7 +53282,7 @@ declare namespace __esri { export const TrackViewModel: TrackViewModelConstructor; - interface TrackViewModelProperties extends GeolocationPositioningProperties { + interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties { } @@ -51999,7 +53689,7 @@ declare namespace __esri { interface Zoom extends Widget { /** - * The widget's default icon font. + * The widget's default CSS icon class. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#iconClass) */ @@ -52011,7 +53701,7 @@ declare namespace __esri { */ readonly label: string; /** - * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) * @@ -52071,7 +53761,7 @@ declare namespace __esri { interface ZoomProperties extends WidgetProperties { /** - * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) * @@ -52167,18 +53857,6 @@ declare namespace __esri { view?: MapViewProperties | SceneViewProperties; } - export type MultipointDrawActionCursorUpdateEventHandler = (event: MultipointDrawActionCursorUpdateEvent) => void; - - export type MultipointDrawActionDrawCompleteEventHandler = (event: MultipointDrawActionDrawCompleteEvent) => void; - - export type MultipointDrawActionRedoEventHandler = (event: MultipointDrawActionRedoEvent) => void; - - export type MultipointDrawActionUndoEventHandler = (event: MultipointDrawActionUndoEvent) => void; - - export type MultipointDrawActionVertexAddEventHandler = (event: MultipointDrawActionVertexAddEvent) => void; - - export type MultipointDrawActionVertexRemoveEventHandler = (event: MultipointDrawActionVertexRemoveEvent) => void; - export type OpenStreetMapLayerLayerviewCreateEventHandler = (event: OpenStreetMapLayerLayerviewCreateEvent) => void; export type OpenStreetMapLayerLayerviewDestroyEventHandler = (event: OpenStreetMapLayerLayerviewDestroyEvent) => void; @@ -52187,34 +53865,6 @@ declare namespace __esri { export type PointCloudLayerLayerviewDestroyEventHandler = (event: PointCloudLayerLayerviewDestroyEvent) => void; - export type PointDrawActionCursorUpdateEventHandler = (event: PointDrawActionCursorUpdateEvent) => void; - - export type PointDrawActionDrawCompleteEventHandler = (event: PointDrawActionDrawCompleteEvent) => void; - - export type PolygonDrawActionCursorUpdateEventHandler = (event: PolygonDrawActionCursorUpdateEvent) => void; - - export type PolygonDrawActionDrawCompleteEventHandler = (event: PolygonDrawActionDrawCompleteEvent) => void; - - export type PolygonDrawActionRedoEventHandler = (event: PolygonDrawActionRedoEvent) => void; - - export type PolygonDrawActionUndoEventHandler = (event: PolygonDrawActionUndoEvent) => void; - - export type PolygonDrawActionVertexAddEventHandler = (event: PolygonDrawActionVertexAddEvent) => void; - - export type PolygonDrawActionVertexRemoveEventHandler = (event: PolygonDrawActionVertexRemoveEvent) => void; - - export type PolylineDrawActionCursorUpdateEventHandler = (event: PolylineDrawActionCursorUpdateEvent) => void; - - export type PolylineDrawActionDrawCompleteEventHandler = (event: PolylineDrawActionDrawCompleteEvent) => void; - - export type PolylineDrawActionRedoEventHandler = (event: PolylineDrawActionRedoEvent) => void; - - export type PolylineDrawActionUndoEventHandler = (event: PolylineDrawActionUndoEvent) => void; - - export type PolylineDrawActionVertexAddEventHandler = (event: PolylineDrawActionVertexAddEvent) => void; - - export type PolylineDrawActionVertexRemoveEventHandler = (event: PolylineDrawActionVertexRemoveEvent) => void; - export type PopupViewModelTriggerActionEventHandler = (event: PopupViewModelTriggerActionEvent) => void; export type SceneLayerLayerviewCreateEventHandler = (event: SceneLayerLayerviewCreateEvent) => void; @@ -52269,12 +53919,6 @@ declare namespace __esri { export type SearchViewModelSuggestStartEventHandler = (event: SearchViewModelSuggestStartEvent) => void; - export type SegmentDrawActionCursorUpdateEventHandler = (event: SegmentDrawActionCursorUpdateEvent) => void; - - export type SegmentDrawActionDrawCompleteEventHandler = (event: SegmentDrawActionDrawCompleteEvent) => void; - - export type SegmentDrawActionVertexAddEventHandler = (event: SegmentDrawActionVertexAddEvent) => void; - export type StreamLayerLayerviewCreateEventHandler = (event: StreamLayerLayerviewCreateEvent) => void; export type StreamLayerLayerviewDestroyEventHandler = (event: StreamLayerLayerviewDestroyEvent) => void; @@ -52490,6 +54134,11 @@ declare module "esri/layers/BaseElevationLayer" { export = BaseElevationLayer; } +declare module "esri/layers/BingMapsLayer" { + import BingMapsLayer = __esri.BingMapsLayer; + export = BingMapsLayer; +} + declare module "esri/layers/CSVLayer" { import CSVLayer = __esri.CSVLayer; export = CSVLayer; @@ -52780,6 +54429,11 @@ declare module "esri/renderers/ClassBreaksRenderer" { export = ClassBreaksRenderer; } +declare module "esri/renderers/HeatmapRenderer" { + import HeatmapRenderer = __esri.HeatmapRenderer; + export = HeatmapRenderer; +} + declare module "esri/renderers/Renderer" { import Renderer = __esri.Renderer; export = Renderer; @@ -52830,9 +54484,19 @@ declare module "esri/renderers/support/AuthoringInfoVisualVariable" { export = AuthoringInfoVisualVariable; } -declare module "esri/support/Action" { - import Action = __esri.Action; - export = Action; +declare module "esri/renderers/support/HeatmapColorStop" { + import HeatmapColorStop = __esri.HeatmapColorStop; + export = HeatmapColorStop; +} + +declare module "esri/support/actions/ActionButton" { + import ActionButton = __esri.ActionButton; + export = ActionButton; +} + +declare module "esri/support/actions/ActionToggle" { + import ActionToggle = __esri.ActionToggle; + export = ActionToggle; } declare module "esri/symbols/ExtrudeSymbol3DLayer" { @@ -53355,6 +55019,11 @@ declare module "esri/views/ui/DefaultUI" { export = DefaultUI; } +declare module "esri/views/2d/ViewState" { + import ViewState = __esri.ViewState; + export = ViewState; +} + declare module "esri/views/2d/draw/Draw" { import Draw = __esri.Draw; export = Draw; @@ -53390,6 +55059,11 @@ declare module "esri/views/2d/draw/SegmentDrawAction" { export = SegmentDrawAction; } +declare module "esri/views/2d/layers/BaseLayerView2D" { + import BaseLayerView2D = __esri.BaseLayerView2D; + export = BaseLayerView2D; +} + declare module "esri/webmap/InitialViewProperties" { import InitialViewProperties = __esri.InitialViewProperties; export = InitialViewProperties; @@ -53445,6 +55119,16 @@ declare module "esri/webscene/applicationProperties/Viewing" { export = Viewing; } +declare module "esri/webscene/background/Background" { + import Background = __esri.Background; + export = Background; +} + +declare module "esri/webscene/background/ColorBackground" { + import ColorBackground = __esri.ColorBackground; + export = ColorBackground; +} + declare module "esri/widgets/AreaMeasurement3D" { import AreaMeasurement3D = __esri.AreaMeasurement3D; export = AreaMeasurement3D; @@ -53465,6 +55149,11 @@ declare module "esri/widgets/BasemapToggle" { export = BasemapToggle; } +declare module "esri/widgets/Bookmarks" { + import Bookmarks = __esri.Bookmarks; + export = Bookmarks; +} + declare module "esri/widgets/ColorSlider" { import ColorSlider = __esri.ColorSlider; export = ColorSlider; @@ -53610,6 +55299,16 @@ declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { export = BasemapToggleViewModel; } +declare module "esri/widgets/Bookmarks/Bookmark" { + import Bookmark = __esri.Bookmark; + export = Bookmark; +} + +declare module "esri/widgets/Bookmarks/BookmarksViewModel" { + import BookmarksViewModel = __esri.BookmarksViewModel; + export = BookmarksViewModel; +} + declare module "esri/widgets/Compass/CompassViewModel" { import CompassViewModel = __esri.CompassViewModel; export = CompassViewModel; @@ -53740,11 +55439,6 @@ declare module "esri/layers/DynamicLayer" { export = DynamicLayer; } -declare module "esri/layers/TiledLayer" { - import TiledLayer = __esri.TiledLayer; - export = TiledLayer; -} - declare module "esri/layers/mixins/ArcGISCachedService" { import ArcGISCachedService = __esri.ArcGISCachedService; export = ArcGISCachedService; @@ -53790,6 +55484,11 @@ declare module "esri/renderers/VisualVariablesMixin" { export = VisualVariablesMixin; } +declare module "esri/support/actions/ActionBase" { + import ActionBase = __esri.ActionBase; + export = ActionBase; +} + declare module "esri/support/LayersMixin" { import LayersMixin = __esri.LayersMixin; export = LayersMixin; @@ -53815,6 +55514,11 @@ declare module "esri/widgets/support/GeolocationPositioning" { export = GeolocationPositioning; } +declare module "esri/widgets/support/GoTo" { + import GoTo = __esri.GoTo; + export = GoTo; +} + declare module "esri/config" { import config = __esri.config; export = config; @@ -54038,3 +55742,84 @@ declare module "esri/geometry" { export type Geometry = Extent | Multipoint | Point | Polygon | Polyline | Mesh; } + + + +declare module "esri/pointCloudRenderers" { + export import PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; + export import PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; + export import PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; + export import PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; + + export type PointCloudRenderer = PointCloudClassBreaksRenderer | PointCloudRGBRenderer | PointCloudStretchRenderer | PointCloudUniqueValueRenderer; +} + + + + + +declare module "esri/renderers" { + export import ClassBreaksRenderer = __esri.ClassBreaksRenderer; + export import HeatmapRenderer = __esri.HeatmapRenderer; + export import SimpleRenderer = __esri.SimpleRenderer; + export import UniqueValueRenderer = __esri.UniqueValueRenderer; + + export type Renderer = ClassBreaksRenderer | HeatmapRenderer | SimpleRenderer | UniqueValueRenderer; +} + + + +declare module "esri/symbols" { + export import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; + export import FillSymbol3DLayer = __esri.FillSymbol3DLayer; + export import Font = __esri.Font; + export import IconSymbol3DLayer = __esri.IconSymbol3DLayer; + export import LabelSymbol3D = __esri.LabelSymbol3D; + export import LineSymbol3D = __esri.LineSymbol3D; + export import LineSymbol3DLayer = __esri.LineSymbol3DLayer; + export import MeshSymbol3D = __esri.MeshSymbol3D; + export import ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; + export import PathSymbol3DLayer = __esri.PathSymbol3DLayer; + export import PictureFillSymbol = __esri.PictureFillSymbol; + export import PictureMarkerSymbol = __esri.PictureMarkerSymbol; + export import PointSymbol3D = __esri.PointSymbol3D; + export import PolygonSymbol3D = __esri.PolygonSymbol3D; + export import SimpleFillSymbol = __esri.SimpleFillSymbol; + export import SimpleLineSymbol = __esri.SimpleLineSymbol; + export import SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; + export import TextSymbol = __esri.TextSymbol; + export import TextSymbol3DLayer = __esri.TextSymbol3DLayer; + export import WebStyleSymbol = __esri.WebStyleSymbol; + + export type FillSymbol = PictureFillSymbol | SimpleFillSymbol; + export type MarkerSymbol = PictureMarkerSymbol | SimpleMarkerSymbol; + + export type Symbol2D = ( + PictureFillSymbol | + PictureMarkerSymbol | + SimpleFillSymbol | + SimpleLineSymbol | + SimpleMarkerSymbol | + TextSymbol + ); + + export type Symbol3D = ( + LabelSymbol3D | + LineSymbol3D | + MeshSymbol3D | + PointSymbol3D | + PolygonSymbol3D + ); + + export type Symbol3DLayer = ( + ExtrudeSymbol3DLayer | + FillSymbol3DLayer | + IconSymbol3DLayer | + LineSymbol3DLayer | + ObjectSymbol3DLayer | + PathSymbol3DLayer | + TextSymbol3DLayer + ); + + export type Symbol = Symbol2D | Symbol3D | WebStyleSymbol; +} diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index e4161412b5..5ce4cfa06c 100644 --- a/types/arcgis-js-api/v3/index.d.ts +++ b/types/arcgis-js-api/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 3.24 +// Type definitions for ArcGIS API for JavaScript 3.25 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -45,7 +45,6 @@ declare module "esri" { import PrintTemplate = require("esri/tasks/PrintTemplate"); import QueryTask = require("esri/tasks/QueryTask"); import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE"); - import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes"); import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes"); import TextSymbol = require("esri/symbols/TextSymbol"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); @@ -1896,14 +1895,29 @@ declare module "esri" { values: number[]; } export interface ReportPlayerOptions { + /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ + allowKeyboardNavigation?: boolean; /** Specifies which export options are available for the report. */ dataProvider?: DataProviderGE; - /** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */ - isSlidesView?: boolean; + /** Specifies how the ReportPlayer should zoom by default. */ + defaultZoomBehavior?: string; + /** Indicates whether interactive experience for panels should be enabled. */ + enableDataDrilling?: boolean; /** Specifies the resize mode of the ReportPlayer. */ - resizeMode?: PlayerResizeModes; + resizeMode?: string; + /** If true, indicates that panels should scale to fit the window. */ + scaleSlidesToFitWindow?: boolean; + /** Indicates whether the analysis area title will be shown in the toolbar. */ + showAreaTitle?: boolean; + /** Indicates whether the toolbar will be shown in a compact popup view. */ + showToolbarInPopup?: boolean; /** Specifies the theme of the ReportPlayer. */ theme?: PlayerThemes; + /** + * Specifies the display of the report in full page view, slide view, or stacked panel view. + * @deprecated + */ + viewMode?: string; } export interface RingBufferOptions { /** The radii to use to create ring buffers */ @@ -7549,22 +7563,45 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerThemes" { export = PlayerThemes; } +declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerViewModes" { + /** An enumerator of available view modes displaying the Report Player. */ + class PlayerViewModes { + /** Displays one full page at a time. */ + static FULL_PAGES: any; + /** Panels will be shown in the slides view mode. */ + static PANELS_IN_SLIDES: any; + /** Panels will be shown in a single stack. */ + static PANELS_IN_STACK: any; + } + export = PlayerViewModes; +} + declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { import esri = require("esri"); import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE"); - import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes"); - import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes"); /** The ReportPlayer widget runs infographic report templates for a provided analysis area. */ class ReportPlayer { + /** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */ + allowKeyboardNavigation: boolean; /** Data Provider for the ReportPlayer which allows you to specify which export options are available when running the report. */ dataProvider: DataProviderGE; - /** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */ - isSlidesView: boolean; + /** Specifies how the ReportPlayer should zoom by default. */ + defaultZoomBehavior: string; + /** Indicates whether interactive experience for panels should be enabled. */ + enableDataDrilling: boolean; /** Specifies the resize mode of the ReportPlayer. */ - resizeModes: PlayerResizeModes; + resizeMode: string; + /** If true, indicates that panels should scale to fit the window. */ + scaleSlidesToFitWindow: boolean; + /** Indicates whether the analysis area title will be shown in the toolbar. */ + showAreaTitle: boolean; + /** Indicates whether the toolbar will be shown in a compact popup view. */ + showToolbarInPopup: boolean; /** Specifies the theme of the ReportPlayer. */ - theme: PlayerThemes; + theme: string; + /** Specifies the display of the report in full page view, slide view, or stacked panel view. */ + viewMode: string; /** * Creates a new ReportPlayer dijit using the given DOM node. * @param params Various parameters that can be used to configure the ReportPlayer. @@ -7577,6 +7614,22 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" { * @param playParams See the object specifications table below for the structure of the playParams object. */ playReport(dataProviderParams: any, playParams?: any): any; + /** + * Sets the width and height of the ReportPlayer when resizeMode is set to PlayerResizeModes.MANUAL. + * @param width The width in pixels. + * @param height The height in pixels. + */ + resize(width?: number, height?: number): any; + /** + * Sets the maximum height for the Report Player. + * @param number The height in pixels. + */ + setMaxHeight(number: number): number; + /** + * Sets the maximum width for the Report Player. + * @param number The width in pixels. + */ + setMaxWidth(number: number): number; } export = ReportPlayer; } @@ -11463,6 +11516,8 @@ declare module "esri/layers/VectorTileLayer" { /** A VectorTileLayer renders cached tiles of data. */ class VectorTileLayer extends Layer { + /** The current style information of the VectorTileLayer. */ + currentStyleInfo: any; /** The full extent of the layer. */ fullExtent: Extent; /** The initial extent of the layer. */ @@ -11608,7 +11663,7 @@ declare module "esri/layers/WCSLayer" { import Point = require("esri/geometry/Point"); import Layer = require("esri/layers/layer"); - /** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */ + /** The WCSLayer works with OGC Web Coverage Services. */ class WCSLayer { /** Resamples pixel by bilinear interpolation. */ static INTERPOLATION_BILINEAR: any; @@ -12566,7 +12621,7 @@ declare module "esri/opsdashboard/DataSourceProxy" { import Query = require("esri/tasks/query"); import Graphic = require("esri/graphic"); - /** DataSourceProxy is a proxy class that represents a operations dashboard data source. */ + /** (Currently in Mature Support) DataSourceProxy is a proxy class that represents a operations dashboard data source. */ class DataSourceProxy { /** Read-only: The name of the display field. */ displayFieldName: string; @@ -12634,7 +12689,7 @@ declare module "esri/opsdashboard/ExtensionBase" { import esri = require("esri"); import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); - /** ExtensionBase is a base class used by all the extension proxies. */ + /** (Currently in Mature Support) ExtensionBase is a base class used by all the extension proxies. */ class ExtensionBase { /** "circle" */ static CIRCLE: any; @@ -12712,7 +12767,7 @@ declare module "esri/opsdashboard/ExtensionBase" { declare module "esri/opsdashboard/ExtensionConfigurationBase" { import ExtensionBase = require("esri/opsdashboard/ExtensionBase"); - /** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ + /** (Currently in Mature Support) ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */ class ExtensionConfigurationBase extends ExtensionBase { /** The object that will store the Widget/MapTool/FeatureAction configuration. */ config: any; @@ -12728,7 +12783,7 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" { declare module "esri/opsdashboard/FeatureActionConfigurationProxy" { import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); - /** FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */ + /** (Currently in Mature Support) FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */ class FeatureActionConfigurationProxy extends ExtensionConfigurationBase { } export = FeatureActionConfigurationProxy; @@ -12738,7 +12793,7 @@ declare module "esri/opsdashboard/FeatureActionFeatures" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import Graphic = require("esri/graphic"); - /** FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */ + /** (Currently in Mature Support) FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */ class FeatureActionFeatures { /** The DataSourceProxy from which the collection of features belongs to. */ dataSourceProxy: DataSourceProxy; @@ -12782,7 +12837,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" { import Renderer = require("esri/renderers/Renderer"); import Graphic = require("esri/graphic"); - /** GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */ + /** (Currently in Mature Support) GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */ class GraphicsLayerProxy { /** Read-only: The current host graphics layer maximum visible scale. */ maxScale: number; @@ -12843,7 +12898,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" { declare module "esri/opsdashboard/MapToolConfigurationProxy" { import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase"); - /** MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */ + /** (Currently in Mature Support) MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */ class MapToolConfigurationProxy extends ExtensionConfigurationBase { } export = MapToolConfigurationProxy; @@ -12854,7 +12909,7 @@ declare module "esri/opsdashboard/MapToolProxy" { import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); import Geometry = require("esri/geometry/Geometry"); - /** MapToolProxy is a class used to define an operations dashboard extension map tool. */ + /** (Currently in Mature Support) MapToolProxy is a class used to define an operations dashboard extension map tool. */ class MapToolProxy { /** Read-only: The available size for the map tool user experience on the host map widget. */ availableDisplaySize: number; @@ -12907,7 +12962,7 @@ declare module "esri/opsdashboard/MapWidgetProxy" { import Point = require("esri/geometry/Point"); import Extent = require("esri/geometry/Extent"); - /** MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */ + /** (Currently in Mature Support) MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */ class MapWidgetProxy { /** Read-only: The map id. */ id: string; @@ -12954,7 +13009,7 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy"); - /** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ + /** (Currently in Mature Support) WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */ class WidgetConfigurationProxy extends ExtensionConfigurationBase { /** * Called by the host application when the user has changed the selected data source in the data source selector. @@ -12990,7 +13045,7 @@ declare module "esri/opsdashboard/WidgetProxy" { import Graphic = require("esri/graphic"); import Geometry = require("esri/geometry/Geometry"); - /** WidgetProxy is a class used to define an operations dashboard extension widget. */ + /** (Currently in Mature Support) WidgetProxy is a class used to define an operations dashboard extension widget. */ class WidgetProxy extends ExtensionBase { /** Read-only: If the widget was configured to consume data sources, the dataSourceConfig array will hold a collection of dataSourceConfig objects. */ dataSourceConfigs: any[]; @@ -13051,7 +13106,7 @@ declare module "esri/opsdashboard/featureActionProxy" { import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy"); import FeatureSet = require("esri/tasks/FeatureSet"); - /** featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */ + /** (Currently in Mature Support) featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */ class featureActionProxy extends ExtensionBase { /** Event raised when the feature action should execute for a set of features. */ on(type: "execute", listener: (event: { config: any; dataSourceProxy: DataSourceProxy; featureSet: FeatureSet; target: featureActionProxy }) => void): esri.Handle; @@ -13903,6 +13958,11 @@ declare module "esri/renderers/smartMapping" { * @param params See the Object Specifications table below for the structure of the params object. */ createPredominanceRenderer(params: any): any; + /** + * Creates a renderer for exploring the relationship between two numeric attributes. + * @param params See the object specifications table below for the structure of the params object. + */ + createRelationshipRenderer(params: any): any; /** * Defines the size of the symbol where feature size is proportional to data value. * @param params See the object specifications table below for the structure of the params object. @@ -15776,6 +15836,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" { class ImageServiceIdentifyParameters { /** Input geometry that defines the location to be identified. */ geometry: Geometry; + /** If the returnCatalogItems parameter is set to true, this parameter will take effect. */ + maxItemCount: number; /** Specifies the mosaic rules defining the image sorting order. */ mosaicRule: MosaicRule; /** The pixel or RGB color value representing no information. */ @@ -15794,6 +15856,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" { returnCatalogItems: boolean; /** When true, each feature in the catalog items includes the geometry. */ returnGeometry: boolean; + /** If true, returns the pixel values of all mosaicked raster catalog items under the requested geometry. */ + returnPixelValues: boolean; /** Specify a time extent. */ timeExtent: TimeExtent; /** Creates a new ImageServiceIdentifyParameters object. */ @@ -18456,3 +18520,16 @@ declare module "esri/workers/WorkerClient" { export = WorkerClient; } +declare module "sri/dijit/geoenrichment/ReportPlayer/PlayerZoomBehaviors" { + /** Enumerator of available zoom behavior options for the ReportPlayer. */ + class PlayerZoomBehaviors { + /** The Report Player zooms in to fit a full page in the viewable area. */ + static FIT_PAGE: any; + /** The Report Player zooms to fit the full page's width in the viewable area. */ + static FIT_PAGE_WIDTH: any; + /** The zoom will be set to 100% (not zoomed). */ + static RESET: any; + } + export = PlayerZoomBehaviors; +} + diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index dbb1df1de7..d61950b657 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -67,3 +67,15 @@ archiver.use(() => {}); archiver.finalize(); archiver.symlink('./path', './target'); + +function fakeHandler(err: Archiver.ArchiverError) { + console.log(err.code); + console.log(err.message); + console.log(err.stack); + console.log(err.data); +} + +const fakeError = new Archiver.ArchiverError('code', 'foo'); + +archiver.on('error', fakeHandler); +archiver.on('warning', fakeHandler); diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index d33e8ec6dd..a9cafca24b 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -24,9 +24,26 @@ declare namespace archiver { mode?: number; } + interface ProgressData { + entries: { + total: number; + processed: number; + }; + fs: { + totalBytes: number; + processedBytes: number; + }; + } + /** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */ type EntryDataFunction = (entry: EntryData) => false | EntryData; + class ArchiverError extends Error { + code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones. + data: any; + constructor(code: string, data: any); + } + interface Archiver extends stream.Transform { abort(): this; append(source: stream.Readable | Buffer | string, name?: EntryData): this; @@ -44,6 +61,13 @@ declare namespace archiver { use(plugin: Function): this; symlink(filepath: string, target: string): this; + + on(event: 'error' | 'warning', listener: (error: ArchiverError) => void): this; + on(event: 'data', listener: (data: EntryData) => void): this; + on(event: 'progress', listener: (progress: ProgressData) => void): this; + on(event: 'close' | 'drain' | 'finish', listener: () => void): this; + on(event: 'pipe' | 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string, listener: (...args: any[]) => void): this; } type ArchiverOptions = CoreOptions & TransformOptions & ZipOptions & TarOptions; diff --git a/types/array-sort/array-sort-tests.ts b/types/array-sort/array-sort-tests.ts new file mode 100644 index 0000000000..bfd19b1bbf --- /dev/null +++ b/types/array-sort/array-sort-tests.ts @@ -0,0 +1,16 @@ +import arraySort from 'array-sort'; + +const numberArr = [1, 2, 3]; +const objArr = [{foo: "asd"}, {foo: "fas"}]; + +arraySort(objArr); +arraySort(numberArr); + +arraySort(objArr, "foo"); +arraySort(objArr, "foo", {reverse: true}); + +arraySort(objArr, ["foo"]); +arraySort(objArr, ["foo"], {reverse: true}); + +arraySort(numberArr, ["foo", (a, b) => -1]); +arraySort(numberArr, [(a, b) => 1], {reverse: true}); diff --git a/types/array-sort/index.d.ts b/types/array-sort/index.d.ts new file mode 100644 index 0000000000..3c886d386d --- /dev/null +++ b/types/array-sort/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for array-sort 1.0 +// Project: https://github.com/jonschlinkert/array-sort +// Definitions by: Daniel Schmidt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Comparator = (a: T, b: T) => number; +type ComparisonArg = string | Comparator; +type ComparisonArgs = ComparisonArg | Array>; + +interface Options { + readonly reverse: boolean; +} + +declare function arraySort( + arr: T[], + props?: ComparisonArgs, + options?: Options +): T[]; + +export default arraySort; diff --git a/types/array-sort/tsconfig.json b/types/array-sort/tsconfig.json new file mode 100644 index 0000000000..e3ae7fe409 --- /dev/null +++ b/types/array-sort/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "array-sort-tests.ts" + ] +} diff --git a/types/array-sort/tslint.json b/types/array-sort/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/array-sort/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index 9bbfb62508..4a0ce5a05f 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -2,10 +2,7 @@ // Project: https://github.com/Asana/node-asana // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; declare namespace asana { diff --git a/types/asap/asap-tests.ts b/types/asap/asap-tests.ts new file mode 100644 index 0000000000..3ffb3d97bb --- /dev/null +++ b/types/asap/asap-tests.ts @@ -0,0 +1,36 @@ +import asap = require("asap"); +import rawAsap = require("asap/raw"); + +class Callable { + call(): void { + "'Callable' invoked"; + } +} +function f(): void { + "'f' invoked"; +} + +// $ExpectType void +asap(f); + +// $ExpectType void +asap((): void => { + "'arrow' invoked"; +}); + +// $ExpectType void +asap(new Callable()); + +// $ExpectType void +rawAsap(f); + +// $ExpectType void +rawAsap((): void => { + "'arrow' invoked"; +}); + +// $ExpectType void +rawAsap(new Callable()); + +// $ExpectType void +rawAsap.requestFlush(); diff --git a/types/asap/index.d.ts b/types/asap/index.d.ts new file mode 100644 index 0000000000..c5fc69aee3 --- /dev/null +++ b/types/asap/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for asap 2.0 +// Project: https://github.com/kriskowal/asap +// Definitions by: fpascutti +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Task { + call(...args: any[]): any; +} + +/** + * Executes a task as soon as possible. + * @param task Function or any object that implements `call()`. + */ +declare function asap(task: Task): void; +export = asap; diff --git a/types/asap/raw.d.ts b/types/asap/raw.d.ts new file mode 100644 index 0000000000..c587a9c5b2 --- /dev/null +++ b/types/asap/raw.d.ts @@ -0,0 +1,16 @@ +interface Task { + call(...args: any[]): any; +} + +/** + * Executes a task as soon as possible. + * @param task Function or any object that implements `call()`. + */ +declare function rawAsap(task: Task): void; +declare namespace rawAsap { + /** + * Flushes the event queue. + */ + function requestFlush(): void; +} +export = rawAsap; diff --git a/types/asap/tsconfig.json b/types/asap/tsconfig.json new file mode 100644 index 0000000000..ea8a3d1091 --- /dev/null +++ b/types/asap/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "asap-tests.ts", + "index.d.ts", + "raw.d.ts" + ] +} diff --git a/types/asap/tslint.json b/types/asap/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/asap/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/assert-equal-jsx/index.d.ts b/types/assert-equal-jsx/index.d.ts index e017fcf57c..735ab5974a 100644 --- a/types/assert-equal-jsx/index.d.ts +++ b/types/assert-equal-jsx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/thejameskyle/assert-equal-jsx // Definitions by: Josh Toft // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; diff --git a/types/atlaskit__button/index.d.ts b/types/atlaskit__button/index.d.ts index e9a613fabd..95ac1e0961 100644 --- a/types/atlaskit__button/index.d.ts +++ b/types/atlaskit__button/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ // Definitions by: Jimmy Luong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, diff --git a/types/atlaskit__calendar/index.d.ts b/types/atlaskit__calendar/index.d.ts index e92776c1f3..e1c76eb397 100644 --- a/types/atlaskit__calendar/index.d.ts +++ b/types/atlaskit__calendar/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, HTMLAttributes, FocusEvent } from 'react'; diff --git a/types/atlaskit__inline-edit/index.d.ts b/types/atlaskit__inline-edit/index.d.ts index 4ee82ee4c3..d2d706c5a4 100644 --- a/types/atlaskit__inline-edit/index.d.ts +++ b/types/atlaskit__inline-edit/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactElement, Component } from 'react'; export default class InlineEdit extends Component {} diff --git a/types/atlaskit__layer/index.d.ts b/types/atlaskit__layer/index.d.ts index 2f50a5abcf..03673c47a3 100644 --- a/types/atlaskit__layer/index.d.ts +++ b/types/atlaskit__layer/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactNode } from 'react'; diff --git a/types/atlaskit__single-select/index.d.ts b/types/atlaskit__single-select/index.d.ts index 6536869512..4910c10a11 100644 --- a/types/atlaskit__single-select/index.d.ts +++ b/types/atlaskit__single-select/index.d.ts @@ -2,7 +2,7 @@ // Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/ // Definitions by: Lee Standen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { Component, ReactNode, SyntheticEvent } from 'react'; diff --git a/types/atlassian-crowd-client/api.d.ts b/types/atlassian-crowd-client/api.d.ts new file mode 100644 index 0000000000..0064382605 --- /dev/null +++ b/types/atlassian-crowd-client/api.d.ts @@ -0,0 +1,10 @@ +import { Settings } from "./settings"; + +declare class CrowdApi { + settings: Settings; + constructor(settings: Settings); + request(method: string, path: string, data?: any): Promise; + log(...args: any[]): void; +} + +export = CrowdApi; diff --git a/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts b/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts new file mode 100644 index 0000000000..c43c272343 --- /dev/null +++ b/types/atlassian-crowd-client/atlassian-crowd-client-tests.ts @@ -0,0 +1,44 @@ +import CrowdClient = require("atlassian-crowd-client"); +import Attributes = require("atlassian-crowd-client/lib/models/attributes"); +import Group = require("atlassian-crowd-client/lib/models/group"); +import Session = require("atlassian-crowd-client/lib/models/session"); +import User = require("atlassian-crowd-client/lib/models/user"); + +// Initialize the Crowd client: +const crowd = new CrowdClient({ + baseUrl: "https://crowd.example.com/", + application: { + name: "demo", + password: "example" + } +}); + +// Create a new user: +crowd.user.create(new User("John", "Doe", "John Doe", "johndoe@example.com", "johndoe", "secret")); +// Remove +crowd.user.remove("johndoe"); + +// Authenticate to Crowd: +crowd.session.create("someusername", "somepassword").then((session: Session) => { + // Fetch the user profile: + crowd.session.getUser(session.token).then((user: User) => { + console.log("Hello, " + user.displayname); + }); +}); + +// Find all active groups (using Crowd Query Language): +crowd.search.group("active=true").then((groups: string[] | Group[]) => { + console.log("Found groups: " + groups.length); +}); + +const group = new Group("testgroup1", "Test group"); + +const attributes = new Attributes({ + foo: "Foo", + bar: ["Bar", "Baz"], + obj: { a: "A" } +}); + +crowd.group.attributes.set(group.groupname, attributes).then(() => { + console.log("Group attribute is set."); +}); diff --git a/types/atlassian-crowd-client/index.d.ts b/types/atlassian-crowd-client/index.d.ts new file mode 100644 index 0000000000..a2e5d8e88f --- /dev/null +++ b/types/atlassian-crowd-client/index.d.ts @@ -0,0 +1,117 @@ +// Type definitions for atlassian-crowd-client 2.0 +// Project: https://github.com/ghengeveld/atlassian-crowd-client +// Definitions by: mtgto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import CrowdApi = require("./api"); +import { Settings } from "./settings"; +import Attributes = require("./lib/models/attributes"); +import Group = require("./lib/models/group"); +import User = require("./lib/models/user"); +import Session = require("./lib/models/session"); +import ValidationFactors = require("./lib/models/validation-factors"); + +export = CrowdClient; +declare class CrowdClient extends CrowdApi { + settings: Settings; + + constructor(settings: Settings); + + user: { + get: (username: string, withAttributes?: boolean) => Promise; + create: (user: User) => Promise; + update: (username: string, user: User) => Promise; + rename: (oldname: string, newname: string) => Promise; + remove: (username: string) => Promise; + attributes: { + list: (username: string) => Promise; + set: (username: string, attributes: Attributes) => Promise; + remove: (username: string, attributename: string) => Promise; + password: { + set: (username: string, password: string) => Promise; + reset: (username: string) => Promise; + }; + username: { + request: (email: string) => Promise; + }; + }; + groups: { + get: (username: string, groupname: string, nested?: boolean) => Promise; + list: (username: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (username: string, groupname: string) => Promise; + remove: (username: string, groupname: string) => Promise; + }; + }; + group: { + get: (groupname: string, withAttributes?: boolean) => Promise; + create: (group: Group) => Promise; + update: (groupname: string, group: Group) => Promise; + remove: (groupname: string) => Promise; + attributes: { + list: (groupname: string) => Promise; + set: (groupname: string, attributes: Attributes) => Promise; + remove: (groupname: string, attributename: string) => Promise; + }; + users: { + get: (groupname: string, username: string, nested?: boolean) => Promise; + list: ( + groupname: string, + nested?: boolean, + startIndex?: number, + maxResults?: number, + expand?: boolean, + ) => Promise; + add: (groupname: string, username: string) => Promise; + remove: (groupname: string, username: string) => Promise; + }; + parents: { + get: (groupname: string, parentname: string, nested?: boolean) => Promise; + list: (groupname: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (groupname: string, parentname: string) => Promise; + }; + children: { + get: (groupname: string, childname: string, nested?: boolean) => Promise; + list: (groupname: string, nested?: boolean, startIndex?: number, maxResults?: number) => Promise; + add: (groupname: string, childname: string) => Promise; + remove: (groupname: string, childname: string) => Promise; + }; + membership: () => Promise; + }; + authentication: { + authenticate: (username: string, password: string) => Promise; + }; + search: { + user: ( + restriction: string, + expand?: boolean, + startIndex?: number, + maxResults?: number, + ) => Promise; + group: ( + restriction: string, + expand?: boolean, + startIndex?: number, + maxResults?: number, + ) => Promise; + }; + session: { + getUser: (token: string) => Promise; + validate: (token: string, validationFactors?: ValidationFactors) => Promise; + create: ( + username: string, + password: string, + validationFactors?: ValidationFactors, + duration?: number, + ) => Promise; + createUnvalidated: ( + username: string, + validationFactors?: ValidationFactors, + duration?: number, + ) => Promise; + remove: (token: string) => Promise; + removeAll: (username: string, exclude?: string) => Promise; + }; + config: { + cookie: () => Promise; + }; +} diff --git a/types/atlassian-crowd-client/lib/models/attributes.d.ts b/types/atlassian-crowd-client/lib/models/attributes.d.ts new file mode 100644 index 0000000000..3385311546 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/attributes.d.ts @@ -0,0 +1,8 @@ +export = Attributes; +declare class Attributes { + readonly attributes: {[name: string]: any}; + + constructor(attributePairs: {[name: string]: any}); + toCrowd(stringify?: (attr: any) => string): any; + static fromCrowd(attributesArr: ReadonlyArray<{name: string}>, parse?: (json: string) => any): Attributes; +} diff --git a/types/atlassian-crowd-client/lib/models/group.d.ts b/types/atlassian-crowd-client/lib/models/group.d.ts new file mode 100644 index 0000000000..e7dc70b6df --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/group.d.ts @@ -0,0 +1,18 @@ +export = Group; +declare class Group { + readonly groupname: string; + readonly description: string; + readonly active: boolean; + readonly attributes?: any; + + constructor(groupname: string, description?: string, active?: boolean, attributes?: any); + toCrowd(): GroupObj; + static fromCrowd(obj: {name: string, description?: string, active?: boolean, attributes: any}): Group; +} + +interface GroupObj { + readonly type: "GROUP"; + readonly name: string; + readonly description: string; + readonly active: boolean; +} diff --git a/types/atlassian-crowd-client/lib/models/session.d.ts b/types/atlassian-crowd-client/lib/models/session.d.ts new file mode 100644 index 0000000000..2ef16a0814 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/session.d.ts @@ -0,0 +1,16 @@ +export = Session; +declare class Session { + readonly token: string; + readonly createdAt: Date; + readonly expiresAt: Date; + + constructor(token: string, createdAt: Date, expiresAt: Date); + toCrowd(): SessionObj; + static fromCrowd(obj: SessionObj): Session; +} + +interface SessionObj { + readonly token: string; + readonly "created-date": number; + readonly "expiry-date": number; +} diff --git a/types/atlassian-crowd-client/lib/models/user.d.ts b/types/atlassian-crowd-client/lib/models/user.d.ts new file mode 100644 index 0000000000..cf5fdeb115 --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/user.d.ts @@ -0,0 +1,25 @@ +export = User; +declare class User { + readonly firstname: string; + readonly lastname: string; + readonly displayname: string; + readonly email: string; + readonly username: string; + readonly password?: string; + readonly active: boolean; + readonly attributes: {[key: string]: any}; + + constructor(firstname: string, lastname: string, displayname: string, email: string, username: string, password?: string, active?: boolean, attributes?: any); + toCrowd(): UserObj; + static fromCrowd(userObj: UserObj): User; +} + +interface UserObj { + readonly "name": string; + readonly "first-name": string; + readonly "last-name": string; + readonly "display-name": string; + readonly "email": string; + readonly "active": boolean; + readonly "password"?: { value: string }; +} diff --git a/types/atlassian-crowd-client/lib/models/validation-factors.d.ts b/types/atlassian-crowd-client/lib/models/validation-factors.d.ts new file mode 100644 index 0000000000..60e418f80d --- /dev/null +++ b/types/atlassian-crowd-client/lib/models/validation-factors.d.ts @@ -0,0 +1,12 @@ +export = ValidationFactors; +declare class ValidationFactors { + readonly validationFactors: any; + + constructor(validationFactorPairs: any); + toCrowd(): ValidationFactorsObj; + static fromCrowd(validationFactorsObj: ValidationFactorsObj): ValidationFactors; +} + +interface ValidationFactorsObj { + validationFactors: any[]; +} diff --git a/types/atlassian-crowd-client/settings.d.ts b/types/atlassian-crowd-client/settings.d.ts new file mode 100644 index 0000000000..755c26038a --- /dev/null +++ b/types/atlassian-crowd-client/settings.d.ts @@ -0,0 +1,12 @@ +export interface Settings { + readonly baseUrl: string; + readonly application: { + readonly name: string; + readonly password: string; + } + readonly nesting?: boolean; + readonly sessionTimeout?: number; + readonly debug?: boolean; + readonly attributesParser?: (json: string) => any; + readonly attributesEncoder?: (obj: any) => string; +} diff --git a/types/atlassian-crowd-client/tsconfig.json b/types/atlassian-crowd-client/tsconfig.json new file mode 100644 index 0000000000..51cfc0966c --- /dev/null +++ b/types/atlassian-crowd-client/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "atlassian-crowd-client-tests.ts" + ] +} diff --git a/types/atlassian-crowd-client/tslint.json b/types/atlassian-crowd-client/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/atlassian-crowd-client/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/atob/index.d.ts b/types/atob/index.d.ts index 632880f7a6..1feb3481e8 100644 --- a/types/atob/index.d.ts +++ b/types/atob/index.d.ts @@ -2,6 +2,6 @@ // Project: https://git.coolaj86.com/coolaj86/atob.js.git // Definitions by: John Wright // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.1 export default function(str: string): string; diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 232c20a034..c403569ab2 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Atom 1.27 +// Type definitions for Atom 1.28 // Project: https://github.com/atom/atom // Definitions by: GlenCFL // smhxx @@ -7,7 +7,7 @@ // TypeScript Version: 2.3 // NOTE: only those classes exported within this file should be retain that status below. -// https://github.com/atom/atom/blob/v1.27.0/exports/atom.js +// https://github.com/atom/atom/blob/v1.28.0/exports/atom.js /// @@ -5844,7 +5844,7 @@ export interface TextEditorObservedEvent { // information under certain contexts. // NOTE: the config schema with these defaults can be found here: -// https://github.com/atom/atom/blob/v1.27.0/src/config-schema.js +// https://github.com/atom/atom/blob/v1.28.0/src/config-schema.js /** * Allows you to strongly type Atom configuration variables. Additional key:value * pairings merged into this interface will result in configuration values under @@ -5957,7 +5957,16 @@ export interface ConfigValues { * changes will miss any events caused by applications other than Atom, but may help * prevent crashes or freezes. */ - "core.fileSystemWatcher": "native"|"atom"; + "core.fileSystemWatcher": "native"|"experimental"|"poll"|"atom"; + + /** Experimental: Use the new Tree-sitter parsing system for supported languages. */ + "core.useTreeSitterParsers": boolean; + + /** + * Specify whether Atom should use the operating system's color profile (recommended) + * or an alternative color profile. + */ + "core.colorProfile": "default"|"srgb"; "editor.commentStart": string|null; diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index d05ee2251e..f13599ebae 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -9,7 +9,9 @@ webAuth.authorize({ audience: 'https://mystore.com/api/v2', scope: 'read:order write:order', responseType: 'token', - redirectUri: 'https://example.com/auth/callback' + redirectUri: 'https://example.com/auth/callback', + language: 'en', + prompt: 'login', }); webAuth.parseHash((err, authResult) => { diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index c7224599bd..033a4bcbde 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -760,6 +760,9 @@ export interface AuthorizeOptions { nonce?: string; scope?: string; audience?: string; + language?: string; + prompt?: string; + mode?: "login" | "signUp"; } export interface CheckSessionOptions extends AuthorizeOptions { diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 0c64fd361b..4b5c60e716 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -39,7 +39,10 @@ const showOptions : Auth0LockShowOptions = { type: "error", text: "an error has occurred" }, - rememberLastLogin: false + rememberLastLogin: false, + languageDictionary: { + title: "test" + } }; lock.show(showOptions); @@ -87,6 +90,7 @@ const themeOptions : Auth0LockConstructorOptions = { icon: 'http://baz.com/icon.png' } }, + hideMainScreenTitle: false, labeledSubmitButton: false, logo: "https://example.com/assets/logo.png", primaryColor: "green" @@ -140,7 +144,8 @@ const multiVariantOptions : Auth0LockConstructorOptions = { signUpTerms: "I agree to the terms of service ...", title: "My Company", }, - autofocus: false + autofocus: false, + allowShowPassword: true, }; new Auth0Lock(CLIENT_ID, DOMAIN, multiVariantOptions); diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 27639834db..622ac3d36c 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Brian Caruso // Dan Caddigan // Larry Faudree +// Will Caulfield // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -75,6 +76,7 @@ interface Auth0LockThemeButtonOptions { interface Auth0LockThemeOptions { authButtons?: Auth0LockThemeButtonOptions; + hideMainScreenTitle?: boolean; labeledSubmitButton?: boolean; logo?: string; primaryColor?: string; @@ -114,6 +116,7 @@ interface Auth0LockConstructorOptions { allowForgotPassword?: boolean; allowLogin?: boolean; allowSignUp?: boolean; + allowShowPassword?: boolean; assetsUrl?: string; auth?: Auth0LockAuthOptions; autoclose?: boolean; @@ -161,6 +164,7 @@ interface Auth0LockShowOptions { initialScreen?: "login" | "signUp" | "forgotPassword"; flashMessage?: Auth0LockFlashMessageOptions; rememberLastLogin?: boolean; + languageDictionary?: any; } interface AuthResult { diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 94e7d63cb3..f4251364d2 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -29,6 +29,40 @@ management // Handle the error. }); +// Search users without paging - callback style +management.getUsers({search_engine: 'v3', q: 'name:"jane"', per_page: 25}, (err: Error, users: auth0.User[]) => { + if (err) { + // Handle error + } + console.log(users); +}); + +// Search users without paging - promise style +management.getUsers({search_engine: 'v3', q: 'name:"jane"', per_page: 25}) + .then((users) => { + console.log(users); + }) + .catch((err) => { + // Handle the error + }); + +// Search users with paging - callback style +management.getUsers({search_engine: 'v3', q: 'name:"jane"', per_page: 25, include_totals: true}, (err: Error, userPage: auth0.UserPage) => { + if (err) { + // Handle error + } + console.log(userPage.total); +}); + +// Search users with paging - promise style +management.getUsers({search_engine: 'v3', q: 'name:"jane"', per_page: 25, include_totals: true}) + .then((users: auth0.UserPage) => { + console.log(users.total); + }) + .catch((err) => { + // Handle the error + }); + // Using a callback. management.getUser({id: 'user_id'},(err: Error, user: auth0.User) => { if (err) { diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index aa82e908e5..e03ad5aa06 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for auth0 2.9.1 +// Type definitions for auth0 2.9.2 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Promise from 'bluebird'; @@ -68,7 +68,6 @@ export interface UpdateUserData extends UserData { export interface GetUsersData { per_page?: number; page?: number; - include_totals?: boolean; sort?: string; connection?: string; fields?: string; @@ -77,6 +76,10 @@ export interface GetUsersData { search_engine?: string; } +export interface GetUsersDataPaged extends GetUsersData { + include_totals: boolean; +} + export interface Rule { /** * The name of the rule. @@ -261,7 +264,7 @@ export interface CreateClientGrant { scope: string[]; } -export type Strategy = +export type Strategy = 'ad' | 'adfs' | 'amazon' | 'dropbox' | 'bitbucket' | 'aol' | 'auth0-adldap' | 'auth0-oidc' | 'auth0' | 'baidu' | 'bitly' | 'box' | 'custom' | 'daccount' | 'dwolla' | 'email' | 'evernote-sandbox' | 'evernote' | 'exact' | 'facebook' | 'fitbit' | 'flickr' | 'github' | @@ -345,14 +348,26 @@ export interface User { family_name?: string; } +export interface Page { + start: number; + limit: number; + length: number; + total: number; +} + +export interface UserPage extends Page { + users: User[]; +} + export interface Identity { connection: string; user_id: string; provider: string; isSocial: boolean; + access_token?: string; profileData?: { email?: string; - email_verified?: boolean; + email_verified?: boolean; name?: string; phone_number?: string; phone_verified?: boolean; @@ -661,7 +676,7 @@ export class ManagementClient { deleteClient(params: ClientParams): Promise; deleteClient(params: ClientParams, cb: (err: Error) => void): void; - + // Client Grants getClientGrants(): Promise; getClientGrants(cb: (err: Error, data: ClientGrant[]) => void): void; @@ -705,6 +720,8 @@ export class ManagementClient { // Users + getUsers(params: GetUsersDataPaged): Promise; + getUsers(params: GetUsersDataPaged, cb: (err: Error, userPage: UserPage) => void): void; getUsers(params?: GetUsersData): Promise; getUsers(cb: (err: Error, users: User[]) => void): void; getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; @@ -882,4 +899,4 @@ export class UsersManager { impersonate(userId: string, settings: ImpersonateSettingOptions): Promise; impersonate(userId: string, settings: ImpersonateSettingOptions, cb: (err: Error, data: any) => void): void; -} \ No newline at end of file +} diff --git a/types/auto-bind/auto-bind-tests.ts b/types/auto-bind/auto-bind-tests.ts new file mode 100644 index 0000000000..2c3754e09d --- /dev/null +++ b/types/auto-bind/auto-bind-tests.ts @@ -0,0 +1,65 @@ +import autoBind = require("auto-bind"); + +const emptyConfig: autoBind.AutoBindOptions = {}; +const onlyIncludeInConfig: autoBind.AutoBindOptions = { + include: [] +}; +const onlyExcludeInConfig: autoBind.AutoBindOptions = { + exclude: [] +}; +const emptyArraysInConfig: autoBind.AutoBindOptions = { + include: [], + exclude: [] +}; +const regexConfig: autoBind.AutoBindOptions = { + include: [/test[123]/], + exclude: [/test[123]/, /^regex[123]$/] +}; +const stringConfig: autoBind.AutoBindOptions = { + include: ["test"], + exclude: ["123", "abc"] +}; +const mixConfig: autoBind.AutoBindOptions = { + include: ["test", /test[123]/], + exclude: ["123", /test[123]/] +}; + +class TestConfigs { + constructor() { + // no config + autoBind(this); + autoBind.react(this); + + // empty configs + autoBind(this, emptyConfig); + autoBind.react(this, emptyConfig); + + // include only configs + autoBind(this, onlyIncludeInConfig); + autoBind.react(this, onlyIncludeInConfig); + + // exclude only configs + autoBind(this, onlyExcludeInConfig); + autoBind.react(this, onlyExcludeInConfig); + + // empty array configs + autoBind(this, emptyArraysInConfig); + autoBind.react(this, emptyArraysInConfig); + + // regex configs + autoBind(this, regexConfig); + autoBind.react(this, regexConfig); + + // string configs + autoBind(this, stringConfig); + autoBind.react(this, stringConfig); + + // mix configs + autoBind(this, mixConfig); + autoBind.react(this, mixConfig); + } + + shutUpNoUnnecessaryClass() { + // noop + } +} diff --git a/types/auto-bind/index.d.ts b/types/auto-bind/index.d.ts new file mode 100644 index 0000000000..9b91fb3da6 --- /dev/null +++ b/types/auto-bind/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for auto-bind 1.2 +// Project: https://github.com/sindresorhus/auto-bind#readme +// Definitions by: Sindre Seppola +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace autoBind { + interface AutoBindOptions { + include?: Array; + exclude?: Array; + } + + type AutoBindFunction = ( + self: selfT, + options?: AutoBindOptions + ) => selfT; +} + +interface AutoBindModule + extends autoBind.AutoBindFunction { + react: autoBind.AutoBindFunction; +} + +declare const autoBind: AutoBindModule; +export = autoBind; diff --git a/types/auto-bind/tsconfig.json b/types/auto-bind/tsconfig.json new file mode 100644 index 0000000000..d9589cadad --- /dev/null +++ b/types/auto-bind/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-bind-tests.ts" + ] +} diff --git a/types/auto-bind/tslint.json b/types/auto-bind/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/auto-bind/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index d3e630ddf1..94575006ab 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -479,10 +479,11 @@ str = cloudwatchLogsDecodedData.messageType; str = cloudwatchLogsDecodedData.logEvents[0].id; num = cloudwatchLogsDecodedData.logEvents[0].timestamp; str = cloudwatchLogsDecodedData.logEvents[0].message; +str = cloudwatchLogsDecodedData.logEvents[0].extractedFields!["example"]; /* ClientContext */ clientContextClient = clientCtx.client; -anyObj = clientCtx.Custom; +anyObj = clientCtx.custom; clientContextEnv = clientCtx.env; /* ClientContextEnv */ @@ -585,7 +586,9 @@ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { { cf: { config: { + distributionDomainName: "d123.cloudfront.net", distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-request", requestId: "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" }, request: { @@ -654,7 +657,9 @@ const CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { { cf: { config: { + distributionDomainName: "d123.cloudfront.net", distributionId: "EDFDVBD6EXAMPLE", + eventType: "viewer-response", requestId: "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" }, request: { @@ -737,7 +742,7 @@ context.fail(error); context.fail(str); /* Handler */ -let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; /* In node8.10 runtime, handlers may return a promise for the result value, so existing async * handlers that return Promise before calling the callback will now have a `null` result. @@ -745,7 +750,7 @@ let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AW * since the upgrade effort should be pretty low in most cases, and it points them at a nicer solution. */ // $ExpectError -let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( +const legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.Callback, @@ -753,7 +758,7 @@ let legacyAsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( cb(null, { statusCode: 200, body: 'No longer valid' }); }; -let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( +const node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.Callback, @@ -761,7 +766,7 @@ let node8AsyncHandler: AWSLambda.APIGatewayProxyHandler = async ( return { statusCode: 200, body: 'Is now valid!' }; }; -let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { +const inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { // $ExpectType S3Event event; str = event.Records[0].eventName; @@ -778,35 +783,35 @@ let inferredHandler: AWSLambda.S3Handler = (event, context, cb) => { }; // Test using default Callback type still works. -let defaultCallbackHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const defaultCallbackHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; // Specific types let s3Handler: AWSLambda.S3Handler = (event: AWSLambda.S3Event, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; // Test old name -let s3CreateHandler: AWSLambda.S3Handler = (event: AWSLambda.S3CreateEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const s3CreateHandler: AWSLambda.S3Handler = (event: AWSLambda.S3CreateEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; s3Handler = s3CreateHandler; -let dynamoDBStreamHandler: AWSLambda.DynamoDBStreamHandler = (event: AWSLambda.DynamoDBStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const dynamoDBStreamHandler: AWSLambda.DynamoDBStreamHandler = (event: AWSLambda.DynamoDBStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let snsHandler: AWSLambda.SNSHandler = (event: AWSLambda.SNSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const snsHandler: AWSLambda.SNSHandler = (event: AWSLambda.SNSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cognitoUserPoolHandler: AWSLambda.CognitoUserPoolTriggerHandler = (event: AWSLambda.CognitoUserPoolEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const cognitoUserPoolHandler: AWSLambda.CognitoUserPoolTriggerHandler = (event: AWSLambda.CognitoUserPoolEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudFormationCustomResourceHandler: AWSLambda.CloudFormationCustomResourceHandler = +const cloudFormationCustomResourceHandler: AWSLambda.CloudFormationCustomResourceHandler = (event: AWSLambda.CloudFormationCustomResourceEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudWatchLogsHandler: AWSLambda.CloudWatchLogsHandler = (event: AWSLambda.CloudWatchLogsEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const cloudWatchLogsHandler: AWSLambda.CloudWatchLogsHandler = (event: AWSLambda.CloudWatchLogsEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let scheduledHandler: AWSLambda.ScheduledHandler = (event: AWSLambda.ScheduledEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const scheduledHandler: AWSLambda.ScheduledHandler = (event: AWSLambda.ScheduledEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; let apiGtwProxyHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.APIGatewayProxyEvent, context: AWSLambda.Context, cb: AWSLambda.APIGatewayProxyCallback) => { }; // Test old names -let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; +const proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; apiGtwProxyHandler = proxyHandler; -let codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; +const codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {}; -let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { +const cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { cb(); cb(null); cb(new Error('')); @@ -816,14 +821,14 @@ let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLa cb(null, { }); }; -let cloudFrontResponseHandler: AWSLambda.CloudFrontResponseHandler = (event: AWSLambda.CloudFrontResponseEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontResponseCallback) => { }; +const cloudFrontResponseHandler: AWSLambda.CloudFrontResponseHandler = (event: AWSLambda.CloudFrontResponseEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontResponseCallback) => { }; -let customAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; +const customAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; interface CustomEvent { eventString: string; eventBool: boolean; } interface CustomResult { resultString: string; resultBool?: boolean; } type CustomCallback = AWSLambda.Callback; -let customHandler: AWSLambda.Handler = (event, context, cb) => { +const customHandler: AWSLambda.Handler = (event, context, cb) => { // $ExpectType CustomEvent event; str = event.eventString; @@ -837,4 +842,84 @@ let customHandler: AWSLambda.Handler = (event, contex cb(null, { resultString: bool }); }; -let kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +const kinesisStreamHandler: AWSLambda.KinesisStreamHandler = (event: AWSLambda.KinesisStreamEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; + +const SQSMessageHandler: AWSLambda.SQSHandler = (event: AWSLambda.SQSEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; + +// See https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-sqs +const SQSEvent: AWSLambda.SQSEvent = { + Records: [ + { + messageId: "c80e8021-a70a-42c7-a470-796e1186f753", + receiptHandle: "AQEBJQ+/u6NsnT5t8Q/VbVxgdUl4TMKZ5FqhksRdIQvLBhwNvADoBxYSOVeCBXdnS9P+", + body: "{\"foo\":\"bar\"}", + attributes: { + ApproximateReceiveCount: "3", + SentTimestamp: "1529104986221", + SenderId: "594035263019", + ApproximateFirstReceiveTimestamp: "1529104986230" + }, + messageAttributes: {}, + md5OfBody: "9bb58f26192e4ba00f01e2e7b136bbd8", + eventSource: "aws:sqs", + eventSourceARN: "arn:aws:sqs:us-west-2:594035263019:NOTFIFOQUEUE", + awsRegion: "us-west-2" + } + ] +}; + +const SQSMessageLegacyAsyncHandler: AWSLambda.SQSHandler = async ( + event: AWSLambda.SQSEvent, + context: AWSLambda.Context, + cb: AWSLambda.Callback, +) => { + // $ExpectType SQSEvent + event; + str = event.Records[0].messageId; + anyObj = event.Records[0].body; + // $ExpectType Context + context; + str = context.functionName; + // $ExpectType Callback + cb; + cb(); + cb(null); + cb(new Error()); +}; + +const SQSMessageNode8AsyncHandler: AWSLambda.SQSHandler = async ( + event: AWSLambda.SQSEvent, + context: AWSLambda.Context +) => { + // $ExpectType SQSEvent + event; + str = event.Records[0].messageId; + anyObj = event.Records[0].body; + // $ExpectType Context + context; + str = context.functionName; + return; +}; + +const firehoseEventHandler: AWSLambda.FirehoseTransformationHandler = ( + event: AWSLambda.FirehoseTransformationEvent, + context: AWSLambda.Context, + callback: AWSLambda.FirehoseTransformationCallback +) => { + // $ExpectType FirehoseTransformationEvent + event; + str = event.records[0].recordId; + + // $ExpectType Context + context; + str = context.functionName; + callback(null, { + records: [ + { + recordId: event.records[0].recordId, + result: 'Ok' as AWSLambda.FirehoseRecordTransformationStatus, + data: 'eyJmb28iOiJiYXIifQ==', + } + ] + }); +}; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index dd3fd3bd4e..35d0b1d7a6 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -19,6 +19,8 @@ // Chris Redekop // Aneil Mallavarapu // Jeremy Nagel +// Louis Larry +// Daniel Papukchiev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -211,27 +213,27 @@ export type S3CreateEvent = S3Event; // old name export interface CognitoUserPoolTriggerEvent { version: number; triggerSource: - | "PreSignUp_SignUp" - | "PostConfirmation_ConfirmSignUp" - | "PreAuthentication_Authentication" - | "PostAuthentication_Authentication" - | "CustomMessage_SignUp" - | "CustomMessage_AdminCreateUser" - | "CustomMessage_ResendCode" - | "CustomMessage_ForgotPassword" - | "CustomMessage_UpdateUserAttribute" - | "CustomMessage_VerifyUserAttribute" - | "CustomMessage_Authentication" - | "DefineAuthChallenge_Authentication" - | "CreateAuthChallenge_Authentication" - | "VerifyAuthChallengeResponse_Authentication" - | "PreSignUp_AdminCreateUser" - | "PostConfirmation_ConfirmForgotPassword" - | "TokenGeneration_HostedAuth" - | "TokenGeneration_Authentication" - | "TokenGeneration_NewPasswordChallenge" - | "TokenGeneration_AuthenticateDevice" - | "TokenGeneration_RefreshTokens"; + | "PreSignUp_SignUp" + | "PostConfirmation_ConfirmSignUp" + | "PreAuthentication_Authentication" + | "PostAuthentication_Authentication" + | "CustomMessage_SignUp" + | "CustomMessage_AdminCreateUser" + | "CustomMessage_ResendCode" + | "CustomMessage_ForgotPassword" + | "CustomMessage_UpdateUserAttribute" + | "CustomMessage_VerifyUserAttribute" + | "CustomMessage_Authentication" + | "DefineAuthChallenge_Authentication" + | "CreateAuthChallenge_Authentication" + | "VerifyAuthChallengeResponse_Authentication" + | "PreSignUp_AdminCreateUser" + | "PostConfirmation_ConfirmForgotPassword" + | "TokenGeneration_HostedAuth" + | "TokenGeneration_Authentication" + | "TokenGeneration_NewPasswordChallenge" + | "TokenGeneration_AuthenticateDevice" + | "TokenGeneration_RefreshTokens"; region: string; userPoolId: string; userName?: string; @@ -240,8 +242,8 @@ export interface CognitoUserPoolTriggerEvent { clientId: string; }; request: { - userAttributes: {[key: string]: string}; - validationData?: {[key: string]: string}; + userAttributes: { [key: string]: string }; + validationData?: { [key: string]: string }; codeParameter?: string; usernameParameter?: string; newDeviceUsed?: boolean; @@ -251,8 +253,8 @@ export interface CognitoUserPoolTriggerEvent { challengeMetaData?: string; }>; challengeName?: string; - privateChallengeParameters?: {[key: string]: string}; - challengeAnswer?: {[key: string]: string}; + privateChallengeParameters?: { [key: string]: string }; + challengeAnswer?: { [key: string]: string }; }; response: { autoConfirmUser?: boolean; @@ -262,8 +264,8 @@ export interface CognitoUserPoolTriggerEvent { challengeName?: string; issueTokens?: boolean; failAuthentication?: boolean; - publicChallengeParameters?: {[key: string]: string}; - privateChallengeParameters?: {[key: string]: string}; + publicChallengeParameters?: { [key: string]: string }; + privateChallengeParameters?: { [key: string]: string }; challengeMetaData?: string; answerCorrect?: boolean; }; @@ -369,6 +371,7 @@ export interface CloudWatchLogsLogEvent { id: string; timestamp: number; message: string; + extractedFields?: {[key: string]: string}; } // Context @@ -404,7 +407,7 @@ export interface CognitoIdentity { export interface ClientContext { client: ClientContextClient; - Custom?: any; + custom?: any; env: ClientContextEnv; } @@ -549,7 +552,7 @@ export interface CodePipelineEvent { inputArtifacts: Artifact[]; outputArtifacts: Artifact[]; artifactCredentials: Credentials; - encryptionKey?: EncryptionKey & {type: 'KMS'}; + encryptionKey?: EncryptionKey & { type: 'KMS' }; continuationToken?: string; }; }; @@ -582,7 +585,9 @@ export interface CloudFrontRequest { export interface CloudFrontEvent { config: { + distributionDomainName: string; distributionId: string; + eventType: 'origin-request' | 'origin-response' | 'viewer-request' | 'viewer-response'; requestId: string; }; } @@ -642,6 +647,80 @@ export interface KinesisStreamEvent { Records: KinesisStreamRecord[]; } +// Kinesis Data Firehose Event +// https://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-kinesis-firehose +// https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html +// https://aws.amazon.com/blogs/compute/amazon-kinesis-firehose-data-transformation-with-aws-lambda/ +// Examples in the lambda blueprints +export interface FirehoseTransformationEvent { + invocationId: string; + deliveryStreamArn: string; + region: string; + records: FirehoseTransformationEventRecord[]; +} + +export interface FirehoseTransformationEventRecord { + recordId: string; + approximateArrivalTimestamp: number; + /** Base64 encoded */ + data: string; + kinesisRecordMetadata?: FirehoseRecordMetadata; +} + +export interface FirehoseRecordMetadata { + shardId: string; + partitionKey: string; + approximateArrivalTimestamp: string; + sequenceNumber: string; + subsequenceNumber: string; +} + +export type FirehoseRecordTransformationStatus = 'Ok' | 'Dropped' | 'ProcessingFailed'; + +export interface FirehoseTransformationResultRecord { + recordId: string; + result: FirehoseRecordTransformationStatus; + /** Encode in Base64 */ + data: string; +} + +export interface FirehoseTransformationResult { + records: FirehoseTransformationResultRecord[]; +} + +// SQS +// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-sqs +export interface SQSRecord { + messageId: string; + receiptHandle: string; + body: string; + attributes: SQSRecordAttributes; + messageAttributes: SQSMessageAttributes; + md5OfBody: string; + eventSource: string; + eventSourceARN: string; + awsRegion: string; +} + +export interface SQSEvent { + Records: SQSRecord[]; +} + +export interface SQSRecordAttributes { + ApproximateReceiveCount: string; + SentTimestamp: string; + SenderId: string; + ApproximateFirstReceiveTimestamp: string; +} +export interface SQSMessageAttribute { + Name: string; + Type: string; + Value: string; +} +export interface SQSMessageAttributes { + [name: string]: SQSMessageAttribute; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -686,6 +765,8 @@ export type SNSHandler = Handler; export type CognitoUserPoolTriggerHandler = Handler; // TODO: Different event/handler types for each event trigger so we can type the result? +export type SQSHandler = Handler; + // TODO: CognitoSync export type CloudFormationCustomResourceHandler = Handler; @@ -719,7 +800,8 @@ export type CloudFrontResponseCallback = Callback; export type KinesisStreamHandler = Handler; -// TODO: Kinesis Firehose +export type FirehoseTransformationCallback = Callback; +export type FirehoseTransformationHandler = Handler; export type CustomAuthorizerHandler = Handler; export type CustomAuthorizerCallback = Callback; diff --git a/types/babel-types/index.d.ts b/types/babel-types/index.d.ts index 47068c3481..c464c4bc3f 100644 --- a/types/babel-types/index.d.ts +++ b/types/babel-types/index.d.ts @@ -772,7 +772,7 @@ export interface VoidTypeAnnotation extends Node { export interface JSXAttribute extends Node { type: "JSXAttribute"; name: JSXIdentifier | JSXNamespacedName; - value: JSXElement | StringLiteral | JSXExpressionContainer; + value: JSXElement | StringLiteral | JSXExpressionContainer | null; } export interface JSXClosingElement extends Node { @@ -1424,7 +1424,7 @@ export function objectTypeProperty(key?: Expression, value?: FlowTypeAnnotation) export function qualifiedTypeIdentifier(id?: Identifier, qualification?: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; export function unionTypeAnnotation(types?: FlowTypeAnnotation[]): UnionTypeAnnotation; export function voidTypeAnnotation(): VoidTypeAnnotation; -export function jSXAttribute(name?: JSXIdentifier | JSXNamespacedName, value?: JSXElement | StringLiteral | JSXExpressionContainer): JSXAttribute; +export function jSXAttribute(name?: JSXIdentifier | JSXNamespacedName, value?: JSXElement | StringLiteral | JSXExpressionContainer | null): JSXAttribute; export function jSXClosingElement(name?: JSXIdentifier | JSXMemberExpression): JSXClosingElement; export function jSXElement(openingElement?: JSXOpeningElement, closingElement?: JSXClosingElement, children?: Array, selfClosing?: boolean): JSXElement; export function jSXEmptyExpression(): JSXEmptyExpression; diff --git a/types/babel__core/babel__core-tests.ts b/types/babel__core/babel__core-tests.ts new file mode 100644 index 0000000000..a873c3392f --- /dev/null +++ b/types/babel__core/babel__core-tests.ts @@ -0,0 +1,31 @@ +import * as babel from "@babel/core"; + +const options: babel.TransformOptions = { + ast: true, + sourceMaps: true +}; + +babel.transform("code();", options, (err, result) => { + const { code, map, ast } = result!; +}); + +const transformSyncResult = babel.transformSync("code();", options); +if (transformSyncResult) { + const { code, map, ast } = transformSyncResult; +} + +babel.transformFile("filename.js", options, (err, result) => { + const { code, map, ast } = result!; +}); + +babel.transformFileSync("filename.js", options)!.code; + +const sourceCode = "if (true) return;"; +const parsedAst = babel.parse(sourceCode, options); + +babel.transformFromAst(parsedAst!, sourceCode, options, (err, result) => { + const { code, map, ast } = result!; +}); + +const transformFromAstSyncResult = babel.transformFromAstSync(parsedAst!, sourceCode, options); +const { code, map, ast } = transformFromAstSyncResult!; diff --git a/types/babel__core/index.d.ts b/types/babel__core/index.d.ts new file mode 100644 index 0000000000..277228341b --- /dev/null +++ b/types/babel__core/index.d.ts @@ -0,0 +1,531 @@ +// Type definitions for @babel/core 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-core +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { GeneratorOptions } from "@babel/generator"; +import traverse, { Visitor, NodePath } from "@babel/traverse"; +import template from "@babel/template"; +import * as t from "@babel/types"; +import { ParseOptions } from "@babel/parser"; + +export { + ParseOptions, + GeneratorOptions, + t as types, + template, + traverse, + Visitor +}; + +export type Node = t.Node; +export type ParseResult = t.File | t.Program; +export const version: string; + +export interface TransformOptions { + /** + * Include the AST in the returned object + * + * Default: `false` + */ + ast?: boolean | null; + + /** + * Attach a comment after all non-user injected code + * + * Default: `null` + */ + auxiliaryCommentAfter?: string | null; + + /** + * Attach a comment before all non-user injected code + * + * Default: `null` + */ + auxiliaryCommentBefore?: string | null; + + /** + * Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of. + * + * Default: `"."` + */ + root?: string | null; + + /** + * The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files. + * + * Default: `undefined` + */ + configFile?: string | false | null; + + /** + * Specify whether or not to use .babelrc and + * .babelignore files. + * + * Default: `true` + */ + babelrc?: boolean | null; + + /** + * Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search + * inside of. Defaults to only searching the "root" package. + * + * Default: `(root)` + */ + babelrcRoots?: true | string | string[] | null; + + /** + * Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"` + * + * Default: env vars + */ + envName?: string | null; + + /** + * Enable code generation + * + * Default: `true` + */ + code?: boolean | null; + + /** + * Output comments in generated output + * + * Default: `true` + */ + comments?: boolean | null; + + /** + * Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB + * + * Default: `"auto"` + */ + compact?: boolean | "auto" | null; + + /** + * The working directory that Babel's programmatic options are loaded relative to. + * + * Default: `"."` + */ + cwd?: string | null; + + /** + * This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }` + * which will use those options when the `envName` is `production` + * + * Default: `{}` + */ + env?: { [index: string]: TransformOptions | null | undefined; } | null; + + /** + * A path to a `.babelrc` file to extend + * + * Default: `null` + */ + extends?: string | null; + + /** + * Filename for use in errors etc + * + * Default: `"unknown"` + */ + filename?: string | null; + + /** + * Filename relative to `sourceRoot` + * + * Default: `(filename)` + */ + filenameRelative?: string | null; + + /** + * An object containing the options to be passed down to the babel code generator, @babel/generator + * + * Default: `{}` + */ + generatorOpts?: GeneratorOptions | null; + + /** + * Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used + * + * Default: `null` + */ + getModuleId?: ((moduleName: string) => string | null | undefined) | null; + + /** + * ANSI highlight syntax error code frames + * + * Default: `true` + */ + highlightCode?: boolean | null; + + /** + * Opposite to the `only` option. `ignore` is disregarded if `only` is specified + * + * Default: `null` + */ + ignore?: string[] | null; + + /** + * A source map object that the output source map will be based on + * + * Default: `null` + */ + inputSourceMap?: object | null; + + /** + * Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe) + * + * Default: `false` + */ + minified?: boolean | null; + + /** + * Specify a custom name for module ids + * + * Default: `null` + */ + moduleId?: string | null; + + /** + * If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules) + * + * Default: `false` + */ + moduleIds?: boolean | null; + + /** + * Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions + * + * Default: `(sourceRoot)` + */ + moduleRoot?: string | null; + + /** + * A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile + * a non-matching file it's returned verbatim + * + * Default: `null` + */ + only?: string | RegExp | Array | null; + + /** + * An object containing the options to be passed down to the babel parser, @babel/parser + * + * Default: `{}` + */ + parserOpts?: ParseOptions | null; + + /** + * List of plugins to load and use + * + * Default: `[]` + */ + plugins?: PluginItem[] | null; + + /** + * List of presets (a set of plugins) to load and use + * + * Default: `[]` + */ + presets?: PluginItem[] | null; + + /** + * Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns) + * + * Default: `false` + */ + retainLines?: boolean | null; + + /** + * An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used + * + * Default: `null` + */ + shouldPrintComment?: ((commentContents: string) => boolean) | null; + + /** + * Set `sources[0]` on returned source map + * + * Default: `(filenameRelative)` + */ + sourceFileName?: string | null; + + /** + * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"` + * then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!** + * + * Default: `false` + */ + sourceMaps?: boolean | "inline" | "both" | null; + + /** + * The root from which all sources are relative + * + * Default: `(moduleRoot)` + */ + sourceRoot?: string | null; + + /** + * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6 + * `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`. + * + * Default: `("module")` + */ + sourceType?: "script" | "module" | "unambiguous" | null; + + /** + * An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as + * `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`. + */ + wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null; +} + +export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transform(code: string, callback: FileResultCallback): void; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API. + */ +export function transform(code: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Transforms the passed in code. Returning an object with the generated code, source map, and AST. + */ +export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST. + */ +export function transformAsync(code: string, opts?: TransformOptions): Promise; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFile(filename: string, callback: FileResultCallback): void; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. + */ +export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Asynchronously transforms the entire contents of a file. + */ +export function transformFileAsync(filename: string, opts?: TransformOptions): Promise; + +/** + * Given an AST, transform it. + */ +export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void; + +/** + * Given an AST, transform it. + */ +export function transformFromAst(ast: Node, code: string | undefined, opts: TransformOptions | undefined, callback: FileResultCallback): void; + +/** + * Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API. + */ +export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null; + +/** + * Given an AST, transform it. + */ +export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): Promise; + +// A babel plugin is a simple function which must return an object matching +// the following interface. Babel will throw if it finds unknown properties. +// The list of allowed plugin keys is here: +// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71 +export interface PluginObj { + name?: string; + manipulateOptions?(opts: any, parserOpts: any): void; + pre?(this: S, state: any): void; + visitor: Visitor; + post?(this: S, state: any): void; + inherits?: any; +} + +export interface BabelFileResult { + ast?: Node | null; + code?: string | null; + ignored?: boolean; + map?: { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; + } | null; + metadata?: BabelFileMetadata; +} + +export interface BabelFileMetadata { + usedHelpers: string[]; + marked: Array<{ + type: string; + message: string; + loc: object; + }>; + modules: BabelFileModulesMetadata; +} + +export interface BabelFileModulesMetadata { + imports: object[]; + exports: { + exported: object[]; + specifiers: object[]; + }; +} + +export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, callback: FileParseCallback): void; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parse(code: string, options?: TransformOptions): ParseResult | null; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parseSync(code: string, options?: TransformOptions): ParseResult | null; + +/** + * Given some code, parse it using Babel's standard behavior. + * Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled. + */ +export function parseAsync(code: string, options?: TransformOptions): Promise; + +/** + * Resolve Babel's options fully, resulting in an options object where: + * + * * opts.plugins is a full list of Plugin instances. + * * opts.presets is empty and all presets are flattened into opts. + * * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel + * will not make a second attempt to load config files. + * + * Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to + * use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to + * invalidate properly, but it is the best we have at the moment. + */ +export function loadOptions(options?: TransformOptions): object | null; + +/** + * To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and + * presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it + * as then see fit and pass it back to Babel again. + * + * * `babelrc: string | void` - The path of the `.babelrc` file, if there was one. + * * `babelignore: string | void` - The path of the `.babelignore` file, if there was one. + * * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back + * to Babel again. + * * `plugins: Array` - See below. + * * `presets: Array` - See below. + * * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to + * Babel will not make a second attempt to load config files. + * + * `ConfigItem` instances expose properties to introspect the values, but each item should be treated as + * immutable. If changes are desired, the item should be removed from the list and replaced with either a normal + * Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for + * information about `ConfigItem` fields. + */ +export function loadPartialConfig(options?: TransformOptions): Readonly | null; + +export interface PartialConfig { + options: TransformOptions; + babelrc?: string; + babelignore?: string; + config?: string; +} + +export interface ConfigItem { + /** + * The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]` + */ + name?: string; + + /** + * The resolved value of the plugin. + */ + value: object | ((...args: any[]) => any); + + /** + * The options object passed to the plugin. + */ + options?: object | false; + + /** + * The path that the options are relative to. + */ + dirname: string; + + /** + * Information about the plugin's file, if Babel knows it. + * * + */ + file?: { + /** + * The file that the user requested, e.g. `"@babel/env"` + */ + request: string; + + /** + * The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"` + */ + resolved: string; + } | null; +} + +export type PluginOptions = object | undefined | false; + +export type PluginTarget = string | object | ((...args: any[]) => any); + +export type PluginItem = ConfigItem | PluginObj | PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined]; + +export interface CreateConfigItemOptions { + dirname?: string; + type?: "preset" | "plugin"; +} + +/** + * Allows build tooling to create and cache config items up front. If this function is called multiple times for a + * given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected + * plugins and presets to inject, pre-constructing the config items would be recommended. + */ +export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem; + +export as namespace babel; diff --git a/types/babel__core/package.json b/types/babel__core/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__core/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__core/tsconfig.json b/types/babel__core/tsconfig.json new file mode 100644 index 0000000000..2f96e019cb --- /dev/null +++ b/types/babel__core/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/core": [ + "babel__core" + ], + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ], + "@babel/template": [ + "babel__template" + ], + "@babel/traverse": [ + "babel__traverse" + ] + } + }, + "files": [ + "index.d.ts", + "babel__core-tests.ts" + ] +} diff --git a/types/babel__core/tslint.json b/types/babel__core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__generator/babel__generator-tests.ts b/types/babel__generator/babel__generator-tests.ts new file mode 100644 index 0000000000..90a668ad55 --- /dev/null +++ b/types/babel__generator/babel__generator-tests.ts @@ -0,0 +1,23 @@ +// Example from https://github.com/babel/babel/tree/master/packages/babel-generator +import generate from "@babel/generator"; +import { parse } from "@babel/parser"; + +const code = "class Example {}"; +const ast = parse(code); + +ast.type; +ast.loc!.start; + +const output = generate(ast, { /* options */ }, code); + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator +const result = generate(ast, { + retainLines: false, + compact: "auto", + concise: false, + quotes: "double", + jsonCompatibleStrings: true, + // ... +}, code); +result.code; +result.map; diff --git a/types/babel__generator/index.d.ts b/types/babel__generator/index.d.ts new file mode 100644 index 0000000000..03fcf2765a --- /dev/null +++ b/types/babel__generator/index.d.ts @@ -0,0 +1,117 @@ +// Type definitions for @babel/generator 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-generator +// Definitions by: Troy Gerwien +// Johnny Estilles +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as t from "@babel/types"; + +export interface GeneratorOptions { + /** + * Optional string to add as a block comment at the start of the output file. + */ + auxiliaryCommentBefore?: string; + + /** + * Optional string to add as a block comment at the end of the output file. + */ + auxiliaryCommentAfter?: string; + + /** + * Function that takes a comment (as a string) and returns true if the comment should be included in the output. + * By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment + * contains `@preserve` or `@license`. + */ + shouldPrintComment?(comment: string): boolean; + + /** + * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). + * Defaults to `false`. + */ + retainLines?: boolean; + + /** + * Should comments be included in output? Defaults to `true`. + */ + comments?: boolean; + + /** + * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`. + */ + compact?: boolean | "auto"; + + /** + * Should the output be minified. Defaults to `false`. + */ + minified?: boolean; + + /** + * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`. + */ + concise?: boolean; + + /** + * The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`. + */ + quotes?: "single" | "double"; + + /** + * Used in warning messages + */ + filename?: string; + + /** + * Enable generating source maps. Defaults to `false`. + */ + sourceMaps?: boolean; + + /** + * The filename of the generated code that the source map will be associated with. + */ + sourceMapTarget?: string; + + /** + * A root for all relative URLs in the source map. + */ + sourceRoot?: string; + + /** + * The filename for the source code (i.e. the code in the `code` argument). + * This will only be used if `code` is a string. + */ + sourceFileName?: string; + + /** + * Set to true to run jsesc with "json": true to print "\u00A9" vs. "©"; + */ + jsonCompatibleStrings?: boolean; +} + +export class CodeGenerator { + constructor(ast: t.Node, opts?: GeneratorOptions, code?: string); + generate(): GeneratorResult; +} + +/** + * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output. + * @param ast - the abstract syntax tree from which to generate output code. + * @param opts - used for specifying options for code generation. + * @param code - the original source code, used for source maps. + * @returns - an object containing the output code and source map. + */ +export default function generate(ast: t.Node, opts?: GeneratorOptions, code?: string | { [filename: string]: string; }): GeneratorResult; + +export interface GeneratorResult { + code: string; + map: { + version: number; + sources: string[]; + names: string[]; + sourceRoot?: string; + sourcesContent?: string[]; + mappings: string; + file: string; + } | null; +} diff --git a/types/babel__generator/package.json b/types/babel__generator/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__generator/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__generator/tsconfig.json b/types/babel__generator/tsconfig.json new file mode 100644 index 0000000000..be65e3da1f --- /dev/null +++ b/types/babel__generator/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ] + } + }, + "files": [ + "index.d.ts", + "babel__generator-tests.ts" + ] +} diff --git a/types/babel__generator/tslint.json b/types/babel__generator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__generator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__parser/babel__parser-tests.ts b/types/babel__parser/babel__parser-tests.ts new file mode 100644 index 0000000000..1c9873e5e8 --- /dev/null +++ b/types/babel__parser/babel__parser-tests.ts @@ -0,0 +1,18 @@ +import { parse, parseExpression } from "@babel/parser"; + +declare function assert(expr: boolean): void; + +const code = `function square(n) { + return n * n; +}`; + +const node = parse(code); +assert(node.type === "File"); +assert(node.start === 0); +assert(node.end === 38); +assert(!!node.loc && node.loc.start > node.loc.end); + +parse(code, { + sourceType: "module", // default: "script" + plugins: ["jsx"] // default: [] +}); diff --git a/types/babel__parser/index.d.ts b/types/babel__parser/index.d.ts new file mode 100644 index 0000000000..bf383ffa0c --- /dev/null +++ b/types/babel__parser/index.d.ts @@ -0,0 +1,107 @@ +// Type definitions for @babel/parser 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-parser +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { File, Expression } from "@babel/types"; + +export function parse(code: string, opts?: ParseOptions): File; + +export function parseExpression(input: string, options?: ParseOptions): Expression; + +export interface ParseOptions { + /** + * By default, import and export declarations can only appear at a program's top level. + * Setting this option to true allows them anywhere where a statement is allowed. + */ + allowImportExportEverywhere?: boolean; + + /** + * By default, await use is not allowed outside of an async function. Set this to true to accept such code. + */ + allowAwaitOutsideFunction?: boolean; + + /** + * By default, a return statement at the top level raises an error. Set this to true to accept such code. + */ + allowReturnOutsideFunction?: boolean; + + allowSuperOutsideMethod?: boolean; + + /** + * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". + * Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export + * statements. Files with ES6 imports and exports are considered "module" and are otherwise "script". + */ + sourceType?: "script" | "module" | "unambiguous"; + + /** + * Correlate output AST nodes with their source filename. Useful when + * generating code and source maps from the ASTs of multiple input files. + */ + sourceFilename?: string; + + /** + * By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful + * for integration with other source tools. + */ + startLine?: number; + + /** + * Array containing the plugins that you want to enable. + */ + plugins?: PluginList; + + strictMode?: boolean; + + /** + * Adds a `ranges` property to each node: `[node.start, node.end]` + */ + ranges?: boolean; + + /** + * Adds all parsed tokens to a `tokens` property on the `File` node + */ + tokens?: boolean; +} + +export type PluginList = Array; + +export type PluginName = + "asyncGenerators" | + "bigInt" | + "classPrivateMethods" | + "classPrivateProperties" | + "classProperties" | + "decorators" | + "doExpressions" | + "dynamicImport" | + "estree" | + "exportDefaultFrom" | + "exportNamespaceFrom" | + "flow" | + "flowComments" | + "functionBind" | + "functionSent" | + "importMeta" | + "jsx" | + "nullishCoalescingOperator" | + "numericSeparator" | + "objectRestSpread" | + "optionalCatchBinding" | + "optionalChaining" | + "pipelineOperator" | + "throwExpressions" | + "typescript"; + +export interface PluginOptions { + decorators?: { + decoratorsBeforeExport?: boolean; + }; + flow?: { + all?: boolean; + }; +} diff --git a/types/babel__parser/package.json b/types/babel__parser/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__parser/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__parser/tsconfig.json b/types/babel__parser/tsconfig.json new file mode 100644 index 0000000000..53fd02ec18 --- /dev/null +++ b/types/babel__parser/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/parser": [ + "babel__parser" + ] + } + }, + "files": [ + "index.d.ts", + "babel__parser-tests.ts" + ] +} diff --git a/types/babel__parser/tslint.json b/types/babel__parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__template/babel__template-tests.ts b/types/babel__template/babel__template-tests.ts new file mode 100644 index 0000000000..167cf4db2f --- /dev/null +++ b/types/babel__template/babel__template-tests.ts @@ -0,0 +1,34 @@ +import template from "@babel/template"; +import generate from "@babel/generator"; +import * as t from "@babel/types"; + +const buildRequire = template.statement(` + var IMPORT_NAME = require(SOURCE); +`); + +const ast1 = buildRequire({ + IMPORT_NAME: t.identifier("myModule"), + SOURCE: t.stringLiteral("my-module") +}); + +console.log(generate(ast1).code); + +const ast2 = template.ast(` + var myModule = require("my-module"); +`); + +const fn = template.statement` + var IMPORT_NAME = require('${"my-module"}'); +`; + +const ast3 = fn({ + IMPORT_NAME: t.identifier("myModule") +}); + +console.log(generate(ast3).code); + +declare const mod: string; + +const ast4 = template.ast` + var ${mod} = require("${name}"); +`; diff --git a/types/babel__template/index.d.ts b/types/babel__template/index.d.ts new file mode 100644 index 0000000000..5f3bc18bc3 --- /dev/null +++ b/types/babel__template/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for @babel/template 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-template +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ParseOptions } from "@babel/parser"; +import { Expression, File, Program, Statement } from "@babel/types"; + +export interface TemplateBuilderOptions extends ParseOptions { + /** + * A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern. + */ + placeholderWhitelist?: Set; + + /** + * A pattern to search for when looking for Identifier and StringLiteral nodes that should be considered placeholders. `false` will + * disable placeholder searching entirely, leaving only the `placeholderWhitelist` value to find placeholders. + */ + placeholderPattern?: RegExp | false; + + /** + * Set this to `true` to preserve any comments from the `code` parameter. + */ + preserveComments?: boolean; +} + +export interface TemplateBuilder { + /** + * Build a new builder, merging the given options with the previous ones. + */ + (opts: TemplateBuilderOptions): TemplateBuilder; + + /** + * Building from a string produces an AST builder function by default. + */ + (code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T; + + /** + * Building from a template literal produces an AST builder function by default. + */ + (tpl: TemplateStringsArray, ...args: any[]): (arg?: PublicReplacements) => T; + + // Allow users to explicitly create templates that produce ASTs, skipping the need for an intermediate function. + ast: { + (tpl: string, opts?: TemplateBuilderOptions): T; + (tpl: TemplateStringsArray, ...args: any[]): T; + }; +} + +export type PublicReplacements = { [index: string]: any; } | any[]; + +export const smart: TemplateBuilder; +export const statement: TemplateBuilder; +export const statements: TemplateBuilder; +export const expression: TemplateBuilder; +export const program: TemplateBuilder; + +type DefaultTemplateBuilder = typeof smart & { + smart: typeof smart; + statement: typeof statement; + statements: typeof statements; + expression: typeof expression; + program: typeof program; + ast: typeof smart.ast; +}; + +declare const templateBuilder: DefaultTemplateBuilder; + +export default templateBuilder; diff --git a/types/babel__template/package.json b/types/babel__template/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__template/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__template/tsconfig.json b/types/babel__template/tsconfig.json new file mode 100644 index 0000000000..386236c02f --- /dev/null +++ b/types/babel__template/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/generator": [ + "babel__generator" + ], + "@babel/parser": [ + "babel__parser" + ], + "@babel/template": [ + "babel__template" + ] + } + }, + "files": [ + "index.d.ts", + "babel__template-tests.ts" + ] +} diff --git a/types/babel__template/tslint.json b/types/babel__template/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__template/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts new file mode 100644 index 0000000000..2fc7b07a8a --- /dev/null +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -0,0 +1,115 @@ +import { parse } from "@babel/parser"; +import traverse, { Visitor } from "@babel/traverse"; +import * as t from "@babel/types"; + +// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md +const MyVisitor: Visitor = { + Identifier: { + enter() { + console.log("Entered!"); + }, + exit() { + console.log("Exited!"); + } + } +}; + +const MyVisitor2: Visitor = { + Identifier(path) { + console.log("Visiting: " + path.node.name); + } +}; + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse +const code = `function square(n) { + return n * n; +}`; + +const ast = parse(code); + +traverse(ast, { + enter(path) { + const node = path.node; + if (t.isIdentifier(node) && node.name === "n") { + node.name = "x"; + } + } +}); + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#writing-your-first-babel-plugin + +const v1: Visitor = { + BinaryExpression(path) { + if (t.isIdentifier(path.node.left)) { + // ... + } + path.replaceWith( + t.binaryExpression("**", path.node.left, t.numericLiteral(2)) + ); + path.parentPath.replaceWith( + t.expressionStatement(t.stringLiteral("Anyway the wind blows, doesn't really matter to me, to me.")) + ); + path.parentPath.remove(); + }, + + Identifier(path) { + if (path.isReferencedIdentifier()) { + // ... + } + if (t.isQualifiedTypeIdentifier(path.node, path.parent)) { + // ... + } + }, + + ReturnStatement(path) { + path.replaceWithMultiple([ + t.expressionStatement(t.stringLiteral("Is this the real life?")), + t.expressionStatement(t.stringLiteral("Is this just fantasy?")), + t.expressionStatement(t.stringLiteral("(Enjoy singing the rest of the song in your head)")), + ]); + }, + + FunctionDeclaration(path, state) { + path.replaceWithSourceString(`function add(a, b) { + return a + b; + }`); + + path.insertBefore(t.expressionStatement(t.stringLiteral("Because I'm easy come, easy go."))); + path.insertAfter(t.expressionStatement(t.stringLiteral("A little high, little low."))); + path.remove(); + + if (path.scope.hasBinding("n")) { + // ... + } + if (path.scope.hasOwnBinding("n")) { + // ... + } + + const id1 = path.scope.generateUidIdentifier("uid"); + id1.type; + id1.name; + const id2 = path.scope.generateUidIdentifier("uid"); + id2.type; + id2.name; + + const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id!); + path.remove(); + path.scope.parent.push({ id, init: path.node }); + + path.scope.rename("n", "x"); + path.scope.rename("n"); + } +}; + +// Binding.kind +const BindingKindTest: Visitor = { + Identifier(path) { + const kind = path.scope.getBinding("str")!.kind; + kind === 'module'; + kind === 'const'; + kind === 'let'; + kind === 'var'; + // The following should fail when uncommented + // kind === 'anythingElse'; + }, +}; diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts new file mode 100644 index 0000000000..475ca9fb14 --- /dev/null +++ b/types/babel__traverse/index.d.ts @@ -0,0 +1,810 @@ +// Type definitions for @babel/traverse 7.0 +// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Ryan Petrich +// Melvin Groenhoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as t from "@babel/types"; + +export type Node = t.Node; + +export default function traverse(parent: Node | Node[], opts: TraverseOptions, scope: Scope, state: S, parentPath?: NodePath): void; +export default function traverse(parent: Node | Node[], opts: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void; + +export interface TraverseOptions extends Visitor { + scope?: Scope; + noScope?: boolean; +} + +export class Scope { + constructor(path: NodePath, parentScope?: Scope); + path: NodePath; + block: Node; + parentBlock: Node; + parent: Scope; + hub: Hub; + bindings: { [name: string]: Binding; }; + + /** Traverse node with current scope and path. */ + traverse(node: Node | Node[], opts: TraverseOptions, state: S): void; + traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void; + + /** Generate a unique identifier and add it to the current scope. */ + generateDeclaredUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique identifier. */ + generateUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique `_id1` binding. */ + generateUid(name?: string): string; + + /** Generate a unique identifier based on a node. */ + generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier; + + /** + * Determine whether evaluating the specific input `node` is a consequenceless reference. ie. + * evaluating it wont result in potentially arbitrary code from being ran. The following are + * whitelisted and determined not to cause side effects: + * + * - `this` expressions + * - `super` expressions + * - Bound identifiers + */ + isStatic(node: Node): boolean; + + /** Possibly generate a memoised identifier if it is not static and has consequences. */ + maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier; + + checkBlockScopedCollisions(local: Node, kind: string, name: string, id: object): void; + + rename(oldName: string, newName?: string, block?: Node): void; + + dump(): void; + + toArray(node: Node, i?: number): Node; + + registerDeclaration(path: NodePath): void; + + buildUndefinedNode(): Node; + + registerConstantViolation(path: NodePath): void; + + registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void; + + addGlobal(node: Node): void; + + hasUid(name: string): boolean; + + hasGlobal(name: string): boolean; + + hasReference(name: string): boolean; + + isPure(node: Node, constantsOnly?: boolean): boolean; + + setData(key: string, val: any): any; + + getData(key: string): any; + + removeData(key: string): void; + + push(opts: any): void; + + getProgramParent(): Scope; + + getFunctionParent(): Scope; + + getBlockParent(): Scope; + + /** Walks the scope tree and gathers **all** bindings. */ + getAllBindings(...kinds: string[]): object; + + bindingIdentifierEquals(name: string, node: Node): boolean; + + getBinding(name: string): Binding | undefined; + + getOwnBinding(name: string): Binding | undefined; + + getBindingIdentifier(name: string): t.Identifier; + + getOwnBindingIdentifier(name: string): t.Identifier; + + hasOwnBinding(name: string): boolean; + + hasBinding(name: string, noGlobals?: boolean): boolean; + + parentHasBinding(name: string, noGlobals?: boolean): boolean; + + /** Move a binding of `name` to another `scope`. */ + moveBindingTo(name: string, scope: Scope): void; + + removeOwnBinding(name: string): void; + + removeBinding(name: string): void; +} + +export class Binding { + constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: "var" | "let" | "const"; }); + identifier: t.Identifier; + scope: Scope; + path: NodePath; + kind: "var" | "let" | "const" | "module"; + referenced: boolean; + references: number; + referencePaths: NodePath[]; + constant: boolean; + constantViolations: NodePath[]; +} + +export type Visitor = VisitNodeObject & { + [P in Node["type"]]?: VisitNode>; +}; + +export type VisitNode = VisitNodeFunction | VisitNodeObject; + +export type VisitNodeFunction = (this: T, path: NodePath

, state: any) => void; + +export interface VisitNodeObject { + enter?(path: NodePath, state: any): void; + exit?(path: NodePath, state: any): void; +} + +export class NodePath { + constructor(hub: Hub, parent: Node); + parent: Node; + hub: Hub; + contexts: TraversalContext[]; + data: object; + shouldSkip: boolean; + shouldStop: boolean; + removed: boolean; + state: any; + opts: object; + skipKeys: object; + parentPath: NodePath; + context: TraversalContext; + container: object | object[]; + listKey: string; + inList: boolean; + parentKey: string; + key: string | number; + node: T; + scope: Scope; + type: T extends undefined | null ? string | null : string; + typeAnnotation: object; + + getScope(scope: Scope): Scope; + + setData(key: string, val: any): any; + + getData(key: string, def?: any): any; + + buildCodeFrameError(msg: string, Error?: new (msg: string) => TError): TError; + + traverse(visitor: Visitor, state: T): void; + traverse(visitor: Visitor): void; + + set(key: string, node: Node): void; + + getPathLocation(): string; + + // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83 + debug(buildMessage: () => string): void; + + // ------------------------- ancestry ------------------------- + /** + * Call the provided `callback` with the `NodePath`s of all the parents. + * When the `callback` returns a truthy value, we return that node path. + */ + findParent(callback: (path: NodePath) => boolean): NodePath; + + find(callback: (path: NodePath) => boolean): NodePath; + + /** Get the parent function of the current path. */ + getFunctionParent(): NodePath; + + /** Walk up the tree until we hit a parent node path in a list. */ + getStatementParent(): NodePath; + + /** + * Get the deepest common ancestor and then from it, get the earliest relationship path + * to that ancestor. + * + * Earliest is defined as being "before" all the other nodes in terms of list container + * position and visiting key. + */ + getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath[]; + + /** Get the earliest path in the tree where the provided `paths` intersect. */ + getDeepestCommonAncestorFrom( + paths: NodePath[], + filter?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath + ): NodePath; + + /** + * Build an array of node paths containing the entire ancestry of the current node path. + * + * NOTE: The current node path is included in this. + */ + getAncestry(): NodePath[]; + + inType(...candidateTypes: string[]): boolean; + + // ------------------------- inference ------------------------- + /** Infer the type of the current `NodePath`. */ + getTypeAnnotation(): t.FlowType; + + isBaseType(baseName: string, soft?: boolean): boolean; + + couldBeBaseType(name: string): boolean; + + baseTypeStrictlyMatches(right: NodePath): boolean; + + isGenericType(genericName: string): boolean; + + // ------------------------- replacement ------------------------- + /** + * Replace a node with an array of multiple. This method performs the following steps: + * + * - Inherit the comments of first provided node with that of the current node. + * - Insert the provided nodes after the current node. + * - Remove the current node. + */ + replaceWithMultiple(nodes: Node[]): void; + + /** + * Parse a string as an expression and replace the current node with the result. + * + * NOTE: This is typically not a good idea to use. Building source strings when + * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's + * easier to use, your transforms will be extremely brittle. + */ + replaceWithSourceString(replacement: any): void; + + /** Replace the current node with another. */ + replaceWith(replacement: Node | NodePath): void; + + /** + * This method takes an array of statements nodes and then explodes it + * into expressions. This method retains completion records which is + * extremely important to retain original semantics. + */ + replaceExpressionWithStatements(nodes: Node[]): Node; + + replaceInline(nodes: Node | Node[]): void; + + // ------------------------- evaluation ------------------------- + /** + * Walk the input `node` and statically evaluate if it's truthy. + * + * Returning `true` when we're sure that the expression will evaluate to a + * truthy value, `false` if we're sure that it will evaluate to a falsy + * value and `undefined` if we aren't sure. Because of this please do not + * rely on coercion when using this method and check with === if it's false. + */ + evaluateTruthy(): boolean; + + /** + * Walk the input `node` and statically evaluate it. + * + * Returns an object in the form `{ confident, value }`. `confident` indicates + * whether or not we had to drop out of evaluating the expression because of + * hitting an unknown node that we couldn't confidently find the value of. + * + * Example: + * + * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } + * t.evaluate(parse("!true")) // { confident: true, value: false } + * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined } + */ + evaluate(): { confident: boolean; value: any }; + + // ------------------------- introspection ------------------------- + /** + * Match the current node if it matches the provided `pattern`. + * + * For example, given the match `React.createClass` it would match the + * parsed nodes of `React.createClass` and `React["createClass"]`. + */ + matchesPattern(pattern: string, allowPartial?: boolean): boolean; + + /** + * Check whether we have the input `key`. If the `key` references an array then we check + * if the array has any items, otherwise we just check if it's falsy. + */ + has(key: string): boolean; + + isStatic(): boolean; + + /** Alias of `has`. */ + is(key: string): boolean; + + /** Opposite of `has`. */ + isnt(key: string): boolean; + + /** Check whether the path node `key` strict equals `value`. */ + equals(key: string, value: any): boolean; + + /** + * Check the type against our stored internal type of the node. This is handy when a node has + * been removed yet we still internally know the type and need it to calculate node replacement. + */ + isNodeType(type: string): boolean; + + /** + * This checks whether or not we're in one of the following positions: + * + * for (KEY in right); + * for (KEY;;); + * + * This is because these spots allow VariableDeclarations AND normal expressions so we need + * to tell the path replacement that it's ok to replace this with an expression. + */ + canHaveVariableDeclarationOrExpression(): boolean; + + /** + * This checks whether we are swapping an arrow function's body between an + * expression and a block statement (or vice versa). + * + * This is because arrow functions may implicitly return an expression, which + * is the same as containing a block statement. + */ + canSwapBetweenExpressionAndStatement(replacement: Node): boolean; + + /** Check whether the current path references a completion record */ + isCompletionRecord(allowInsideFunction?: boolean): boolean; + + /** + * Check whether or not the current `key` allows either a single statement or block statement + * so we can explode it if necessary. + */ + isStatementOrBlock(): boolean; + + /** Check if the currently assigned path references the `importName` of `moduleSource`. */ + referencesImport(moduleSource: string, importName: string): boolean; + + /** Get the source code associated with this node. */ + getSource(): string; + + /** Check if the current path will maybe execute before another path */ + willIMaybeExecuteBefore(path: NodePath): boolean; + + // ------------------------- context ------------------------- + call(key: string): boolean; + + isBlacklisted(): boolean; + + visit(): boolean; + + skip(): void; + + skipKey(key: string): void; + + stop(): void; + + setScope(): void; + + setContext(context: TraversalContext): NodePath; + + popContext(): void; + + pushContext(context: TraversalContext): void; + + // ------------------------- removal ------------------------- + remove(): void; + + // ------------------------- modification ------------------------- + /** Insert the provided nodes before the current one. */ + insertBefore(nodes: Node | Node[]): any; + + /** + * Insert the provided nodes after the current one. When inserting nodes after an + * expression, ensure that the completion record is correct by pushing the current node. + */ + insertAfter(nodes: Node | Node[]): any; + + /** Update all sibling node paths after `fromIndex` by `incrementBy`. */ + updateSiblingKeys(fromIndex: number, incrementBy: number): void; + + /** Hoist the current node to the highest scope possible and return a UID referencing it. */ + hoist(scope: Scope): void; + + // ------------------------- family ------------------------- + getOpposite(): NodePath; + + getCompletionRecords(): NodePath[]; + + getSibling(key: string | number): NodePath; + getAllPrevSiblings(): NodePath[]; + getAllNextSiblings(): NodePath[]; + + get(key: K, context?: boolean | TraversalContext): + T[K] extends Array ? Array> : + T[K] extends Node | null | undefined ? NodePath : + never; + get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[]; + + getBindingIdentifiers(duplicates?: boolean): Node[]; + + getOuterBindingIdentifiers(duplicates?: boolean): Node[]; + + // ------------------------- comments ------------------------- + /** Share comments amongst siblings. */ + shareCommentsWithSiblings(): void; + + addComment(type: string, content: string, line?: boolean): void; + + /** Give node `comments` of the specified `type`. */ + addComments(type: string, comments: any[]): void; + + // ------------------------- isXXX ------------------------- + isArrayExpression(opts?: object): this is NodePath; + isAssignmentExpression(opts?: object): this is NodePath; + isBinaryExpression(opts?: object): this is NodePath; + isDirective(opts?: object): this is NodePath; + isDirectiveLiteral(opts?: object): this is NodePath; + isBlockStatement(opts?: object): this is NodePath; + isBreakStatement(opts?: object): this is NodePath; + isCallExpression(opts?: object): this is NodePath; + isCatchClause(opts?: object): this is NodePath; + isConditionalExpression(opts?: object): this is NodePath; + isContinueStatement(opts?: object): this is NodePath; + isDebuggerStatement(opts?: object): this is NodePath; + isDoWhileStatement(opts?: object): this is NodePath; + isEmptyStatement(opts?: object): this is NodePath; + isExpressionStatement(opts?: object): this is NodePath; + isFile(opts?: object): this is NodePath; + isForInStatement(opts?: object): this is NodePath; + isForStatement(opts?: object): this is NodePath; + isFunctionDeclaration(opts?: object): this is NodePath; + isFunctionExpression(opts?: object): this is NodePath; + isIdentifier(opts?: object): this is NodePath; + isIfStatement(opts?: object): this is NodePath; + isLabeledStatement(opts?: object): this is NodePath; + isStringLiteral(opts?: object): this is NodePath; + isNumericLiteral(opts?: object): this is NodePath; + isNullLiteral(opts?: object): this is NodePath; + isBooleanLiteral(opts?: object): this is NodePath; + isRegExpLiteral(opts?: object): this is NodePath; + isLogicalExpression(opts?: object): this is NodePath; + isMemberExpression(opts?: object): this is NodePath; + isNewExpression(opts?: object): this is NodePath; + isProgram(opts?: object): this is NodePath; + isObjectExpression(opts?: object): this is NodePath; + isObjectMethod(opts?: object): this is NodePath; + isObjectProperty(opts?: object): this is NodePath; + isRestElement(opts?: object): this is NodePath; + isReturnStatement(opts?: object): this is NodePath; + isSequenceExpression(opts?: object): this is NodePath; + isSwitchCase(opts?: object): this is NodePath; + isSwitchStatement(opts?: object): this is NodePath; + isThisExpression(opts?: object): this is NodePath; + isThrowStatement(opts?: object): this is NodePath; + isTryStatement(opts?: object): this is NodePath; + isUnaryExpression(opts?: object): this is NodePath; + isUpdateExpression(opts?: object): this is NodePath; + isVariableDeclaration(opts?: object): this is NodePath; + isVariableDeclarator(opts?: object): this is NodePath; + isWhileStatement(opts?: object): this is NodePath; + isWithStatement(opts?: object): this is NodePath; + isAssignmentPattern(opts?: object): this is NodePath; + isArrayPattern(opts?: object): this is NodePath; + isArrowFunctionExpression(opts?: object): this is NodePath; + isClassBody(opts?: object): this is NodePath; + isClassDeclaration(opts?: object): this is NodePath; + isClassExpression(opts?: object): this is NodePath; + isExportAllDeclaration(opts?: object): this is NodePath; + isExportDefaultDeclaration(opts?: object): this is NodePath; + isExportNamedDeclaration(opts?: object): this is NodePath; + isExportSpecifier(opts?: object): this is NodePath; + isForOfStatement(opts?: object): this is NodePath; + isImportDeclaration(opts?: object): this is NodePath; + isImportDefaultSpecifier(opts?: object): this is NodePath; + isImportNamespaceSpecifier(opts?: object): this is NodePath; + isImportSpecifier(opts?: object): this is NodePath; + isMetaProperty(opts?: object): this is NodePath; + isClassMethod(opts?: object): this is NodePath; + isObjectPattern(opts?: object): this is NodePath; + isSpreadElement(opts?: object): this is NodePath; + isSuper(opts?: object): this is NodePath; + isTaggedTemplateExpression(opts?: object): this is NodePath; + isTemplateElement(opts?: object): this is NodePath; + isTemplateLiteral(opts?: object): this is NodePath; + isYieldExpression(opts?: object): this is NodePath; + isAnyTypeAnnotation(opts?: object): this is NodePath; + isArrayTypeAnnotation(opts?: object): this is NodePath; + isBooleanTypeAnnotation(opts?: object): this is NodePath; + isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath; + isNullLiteralTypeAnnotation(opts?: object): this is NodePath; + isClassImplements(opts?: object): this is NodePath; + isClassProperty(opts?: object): this is NodePath; + isDeclareClass(opts?: object): this is NodePath; + isDeclareFunction(opts?: object): this is NodePath; + isDeclareInterface(opts?: object): this is NodePath; + isDeclareModule(opts?: object): this is NodePath; + isDeclareTypeAlias(opts?: object): this is NodePath; + isDeclareVariable(opts?: object): this is NodePath; + isFunctionTypeAnnotation(opts?: object): this is NodePath; + isFunctionTypeParam(opts?: object): this is NodePath; + isGenericTypeAnnotation(opts?: object): this is NodePath; + isInterfaceExtends(opts?: object): this is NodePath; + isInterfaceDeclaration(opts?: object): this is NodePath; + isIntersectionTypeAnnotation(opts?: object): this is NodePath; + isMixedTypeAnnotation(opts?: object): this is NodePath; + isNullableTypeAnnotation(opts?: object): this is NodePath; + isNumberTypeAnnotation(opts?: object): this is NodePath; + isStringLiteralTypeAnnotation(opts?: object): this is NodePath; + isStringTypeAnnotation(opts?: object): this is NodePath; + isThisTypeAnnotation(opts?: object): this is NodePath; + isTupleTypeAnnotation(opts?: object): this is NodePath; + isTypeofTypeAnnotation(opts?: object): this is NodePath; + isTypeAlias(opts?: object): this is NodePath; + isTypeAnnotation(opts?: object): this is NodePath; + isTypeCastExpression(opts?: object): this is NodePath; + isTypeParameterDeclaration(opts?: object): this is NodePath; + isTypeParameterInstantiation(opts?: object): this is NodePath; + isObjectTypeAnnotation(opts?: object): this is NodePath; + isObjectTypeCallProperty(opts?: object): this is NodePath; + isObjectTypeIndexer(opts?: object): this is NodePath; + isObjectTypeProperty(opts?: object): this is NodePath; + isQualifiedTypeIdentifier(opts?: object): this is NodePath; + isUnionTypeAnnotation(opts?: object): this is NodePath; + isVoidTypeAnnotation(opts?: object): this is NodePath; + isJSXAttribute(opts?: object): this is NodePath; + isJSXClosingElement(opts?: object): this is NodePath; + isJSXElement(opts?: object): this is NodePath; + isJSXEmptyExpression(opts?: object): this is NodePath; + isJSXExpressionContainer(opts?: object): this is NodePath; + isJSXIdentifier(opts?: object): this is NodePath; + isJSXMemberExpression(opts?: object): this is NodePath; + isJSXNamespacedName(opts?: object): this is NodePath; + isJSXOpeningElement(opts?: object): this is NodePath; + isJSXSpreadAttribute(opts?: object): this is NodePath; + isJSXText(opts?: object): this is NodePath; + isNoop(opts?: object): this is NodePath; + isParenthesizedExpression(opts?: object): this is NodePath; + isAwaitExpression(opts?: object): this is NodePath; + isBindExpression(opts?: object): this is NodePath; + isDecorator(opts?: object): this is NodePath; + isDoExpression(opts?: object): this is NodePath; + isExportDefaultSpecifier(opts?: object): this is NodePath; + isExportNamespaceSpecifier(opts?: object): this is NodePath; + isRestProperty(opts?: object): this is NodePath; + isSpreadProperty(opts?: object): this is NodePath; + isExpression(opts?: object): this is NodePath; + isBinary(opts?: object): this is NodePath; + isScopable(opts?: object): this is NodePath; + isBlockParent(opts?: object): this is NodePath; + isBlock(opts?: object): this is NodePath; + isStatement(opts?: object): this is NodePath; + isTerminatorless(opts?: object): this is NodePath; + isCompletionStatement(opts?: object): this is NodePath; + isConditional(opts?: object): this is NodePath; + isLoop(opts?: object): this is NodePath; + isWhile(opts?: object): this is NodePath; + isExpressionWrapper(opts?: object): this is NodePath; + isFor(opts?: object): this is NodePath; + isForXStatement(opts?: object): this is NodePath; + isFunction(opts?: object): this is NodePath; + isFunctionParent(opts?: object): this is NodePath; + isPureish(opts?: object): this is NodePath; + isDeclaration(opts?: object): this is NodePath; + isLVal(opts?: object): this is NodePath; + isLiteral(opts?: object): this is NodePath; + isImmutable(opts?: object): this is NodePath; + isUserWhitespacable(opts?: object): this is NodePath; + isMethod(opts?: object): this is NodePath; + isObjectMember(opts?: object): this is NodePath; + isProperty(opts?: object): this is NodePath; + isUnaryLike(opts?: object): this is NodePath; + isPattern(opts?: object): this is NodePath; + isClass(opts?: object): this is NodePath; + isModuleDeclaration(opts?: object): this is NodePath; + isExportDeclaration(opts?: object): this is NodePath; + isModuleSpecifier(opts?: object): this is NodePath; + isFlow(opts?: object): this is NodePath; + isFlowBaseAnnotation(opts?: object): this is NodePath; + isFlowDeclaration(opts?: object): this is NodePath; + isJSX(opts?: object): this is NodePath; + isNumberLiteral(opts?: object): this is NodePath; + isRegexLiteral(opts?: object): this is NodePath; + isReferencedIdentifier(opts?: object): this is NodePath; + isReferencedMemberExpression(opts?: object): this is NodePath; + isBindingIdentifier(opts?: object): this is NodePath; + isScope(opts?: object): this is NodePath; + isReferenced(opts?: object): boolean; + isBlockScoped(opts?: object): this is NodePath; + isVar(opts?: object): this is NodePath; + isUser(opts?: object): boolean; + isGenerated(opts?: object): boolean; + isPure(opts?: object): boolean; + + // ------------------------- assertXXX ------------------------- + assertArrayExpression(opts?: object): void; + assertAssignmentExpression(opts?: object): void; + assertBinaryExpression(opts?: object): void; + assertDirective(opts?: object): void; + assertDirectiveLiteral(opts?: object): void; + assertBlockStatement(opts?: object): void; + assertBreakStatement(opts?: object): void; + assertCallExpression(opts?: object): void; + assertCatchClause(opts?: object): void; + assertConditionalExpression(opts?: object): void; + assertContinueStatement(opts?: object): void; + assertDebuggerStatement(opts?: object): void; + assertDoWhileStatement(opts?: object): void; + assertEmptyStatement(opts?: object): void; + assertExpressionStatement(opts?: object): void; + assertFile(opts?: object): void; + assertForInStatement(opts?: object): void; + assertForStatement(opts?: object): void; + assertFunctionDeclaration(opts?: object): void; + assertFunctionExpression(opts?: object): void; + assertIdentifier(opts?: object): void; + assertIfStatement(opts?: object): void; + assertLabeledStatement(opts?: object): void; + assertStringLiteral(opts?: object): void; + assertNumericLiteral(opts?: object): void; + assertNullLiteral(opts?: object): void; + assertBooleanLiteral(opts?: object): void; + assertRegExpLiteral(opts?: object): void; + assertLogicalExpression(opts?: object): void; + assertMemberExpression(opts?: object): void; + assertNewExpression(opts?: object): void; + assertProgram(opts?: object): void; + assertObjectExpression(opts?: object): void; + assertObjectMethod(opts?: object): void; + assertObjectProperty(opts?: object): void; + assertRestElement(opts?: object): void; + assertReturnStatement(opts?: object): void; + assertSequenceExpression(opts?: object): void; + assertSwitchCase(opts?: object): void; + assertSwitchStatement(opts?: object): void; + assertThisExpression(opts?: object): void; + assertThrowStatement(opts?: object): void; + assertTryStatement(opts?: object): void; + assertUnaryExpression(opts?: object): void; + assertUpdateExpression(opts?: object): void; + assertVariableDeclaration(opts?: object): void; + assertVariableDeclarator(opts?: object): void; + assertWhileStatement(opts?: object): void; + assertWithStatement(opts?: object): void; + assertAssignmentPattern(opts?: object): void; + assertArrayPattern(opts?: object): void; + assertArrowFunctionExpression(opts?: object): void; + assertClassBody(opts?: object): void; + assertClassDeclaration(opts?: object): void; + assertClassExpression(opts?: object): void; + assertExportAllDeclaration(opts?: object): void; + assertExportDefaultDeclaration(opts?: object): void; + assertExportNamedDeclaration(opts?: object): void; + assertExportSpecifier(opts?: object): void; + assertForOfStatement(opts?: object): void; + assertImportDeclaration(opts?: object): void; + assertImportDefaultSpecifier(opts?: object): void; + assertImportNamespaceSpecifier(opts?: object): void; + assertImportSpecifier(opts?: object): void; + assertMetaProperty(opts?: object): void; + assertClassMethod(opts?: object): void; + assertObjectPattern(opts?: object): void; + assertSpreadElement(opts?: object): void; + assertSuper(opts?: object): void; + assertTaggedTemplateExpression(opts?: object): void; + assertTemplateElement(opts?: object): void; + assertTemplateLiteral(opts?: object): void; + assertYieldExpression(opts?: object): void; + assertAnyTypeAnnotation(opts?: object): void; + assertArrayTypeAnnotation(opts?: object): void; + assertBooleanTypeAnnotation(opts?: object): void; + assertBooleanLiteralTypeAnnotation(opts?: object): void; + assertNullLiteralTypeAnnotation(opts?: object): void; + assertClassImplements(opts?: object): void; + assertClassProperty(opts?: object): void; + assertDeclareClass(opts?: object): void; + assertDeclareFunction(opts?: object): void; + assertDeclareInterface(opts?: object): void; + assertDeclareModule(opts?: object): void; + assertDeclareTypeAlias(opts?: object): void; + assertDeclareVariable(opts?: object): void; + assertExistentialTypeParam(opts?: object): void; + assertFunctionTypeAnnotation(opts?: object): void; + assertFunctionTypeParam(opts?: object): void; + assertGenericTypeAnnotation(opts?: object): void; + assertInterfaceExtends(opts?: object): void; + assertInterfaceDeclaration(opts?: object): void; + assertIntersectionTypeAnnotation(opts?: object): void; + assertMixedTypeAnnotation(opts?: object): void; + assertNullableTypeAnnotation(opts?: object): void; + assertNumericLiteralTypeAnnotation(opts?: object): void; + assertNumberTypeAnnotation(opts?: object): void; + assertStringLiteralTypeAnnotation(opts?: object): void; + assertStringTypeAnnotation(opts?: object): void; + assertThisTypeAnnotation(opts?: object): void; + assertTupleTypeAnnotation(opts?: object): void; + assertTypeofTypeAnnotation(opts?: object): void; + assertTypeAlias(opts?: object): void; + assertTypeAnnotation(opts?: object): void; + assertTypeCastExpression(opts?: object): void; + assertTypeParameterDeclaration(opts?: object): void; + assertTypeParameterInstantiation(opts?: object): void; + assertObjectTypeAnnotation(opts?: object): void; + assertObjectTypeCallProperty(opts?: object): void; + assertObjectTypeIndexer(opts?: object): void; + assertObjectTypeProperty(opts?: object): void; + assertQualifiedTypeIdentifier(opts?: object): void; + assertUnionTypeAnnotation(opts?: object): void; + assertVoidTypeAnnotation(opts?: object): void; + assertJSXAttribute(opts?: object): void; + assertJSXClosingElement(opts?: object): void; + assertJSXElement(opts?: object): void; + assertJSXEmptyExpression(opts?: object): void; + assertJSXExpressionContainer(opts?: object): void; + assertJSXIdentifier(opts?: object): void; + assertJSXMemberExpression(opts?: object): void; + assertJSXNamespacedName(opts?: object): void; + assertJSXOpeningElement(opts?: object): void; + assertJSXSpreadAttribute(opts?: object): void; + assertJSXText(opts?: object): void; + assertNoop(opts?: object): void; + assertParenthesizedExpression(opts?: object): void; + assertAwaitExpression(opts?: object): void; + assertBindExpression(opts?: object): void; + assertDecorator(opts?: object): void; + assertDoExpression(opts?: object): void; + assertExportDefaultSpecifier(opts?: object): void; + assertExportNamespaceSpecifier(opts?: object): void; + assertRestProperty(opts?: object): void; + assertSpreadProperty(opts?: object): void; + assertExpression(opts?: object): void; + assertBinary(opts?: object): void; + assertScopable(opts?: object): void; + assertBlockParent(opts?: object): void; + assertBlock(opts?: object): void; + assertStatement(opts?: object): void; + assertTerminatorless(opts?: object): void; + assertCompletionStatement(opts?: object): void; + assertConditional(opts?: object): void; + assertLoop(opts?: object): void; + assertWhile(opts?: object): void; + assertExpressionWrapper(opts?: object): void; + assertFor(opts?: object): void; + assertForXStatement(opts?: object): void; + assertFunction(opts?: object): void; + assertFunctionParent(opts?: object): void; + assertPureish(opts?: object): void; + assertDeclaration(opts?: object): void; + assertLVal(opts?: object): void; + assertLiteral(opts?: object): void; + assertImmutable(opts?: object): void; + assertUserWhitespacable(opts?: object): void; + assertMethod(opts?: object): void; + assertObjectMember(opts?: object): void; + assertProperty(opts?: object): void; + assertUnaryLike(opts?: object): void; + assertPattern(opts?: object): void; + assertClass(opts?: object): void; + assertModuleDeclaration(opts?: object): void; + assertExportDeclaration(opts?: object): void; + assertModuleSpecifier(opts?: object): void; + assertFlow(opts?: object): void; + assertFlowBaseAnnotation(opts?: object): void; + assertFlowDeclaration(opts?: object): void; + assertJSX(opts?: object): void; + assertNumberLiteral(opts?: object): void; + assertRegexLiteral(opts?: object): void; +} + +export class Hub { + constructor(file: any, options: any); + file: any; + options: any; +} + +export interface TraversalContext { + parentPath: NodePath; + scope: Scope; + state: any; + opts: any; +} diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json new file mode 100644 index 0000000000..c2ca8a8f9b --- /dev/null +++ b/types/babel__traverse/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@babel/types": "^7.0.0-beta.54" + } +} diff --git a/types/babel__traverse/tsconfig.json b/types/babel__traverse/tsconfig.json new file mode 100644 index 0000000000..898675d222 --- /dev/null +++ b/types/babel__traverse/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@babel/parser": [ + "babel__parser" + ], + "@babel/traverse": [ + "babel__traverse" + ] + } + }, + "files": [ + "index.d.ts", + "babel__traverse-tests.ts" + ] +} diff --git a/types/babel__traverse/tslint.json b/types/babel__traverse/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel__traverse/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/backbone.marionette/backbone.marionette-tests.ts b/types/backbone.marionette/backbone.marionette-tests.ts index c6400b2672..2b86849622 100644 --- a/types/backbone.marionette/backbone.marionette-tests.ts +++ b/types/backbone.marionette/backbone.marionette-tests.ts @@ -135,6 +135,15 @@ class MyView extends Marionette.View { } } +class MyOtherView extends MyView { + private readonly foo: string; + + constructor(model: MyModel) { + super(model); + this.foo = 'bar'; + } +} + class MainRegion extends Marionette.Region { constructor() { super(); @@ -185,10 +194,20 @@ class MyHtmlElRegion extends Marionette.Region { } } -class MyCollectionView extends Marionette.CollectionView { +class MyCollectionView extends Marionette.CollectionView { constructor() { super(); + + this.childView = (model: MyModel) => { + if (model.get('isFoo')) { + return MyView; + } + + return MyOtherView; + }; + this.childView = MyView; + this.childViewEvents = { render() { console.log('a childView has been rendered'); @@ -282,7 +301,7 @@ function CollectionViewTests() { cv.collection.add(new MyModel()); app.mainRegion.show(cv); cv.emptyView = MyView; - const view: Marionette.CollectionView = cv.destroy(); + const view: Marionette.CollectionView = cv.destroy(); } class MyController { diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 0b717c9bb1..bacd045ba1 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Zeeshan Hamid , // Natan Vivo , // Sven Tschui , -// Volker Nauruhn +// Volker Nauruhn , +// Ard Timmerman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1157,7 +1158,7 @@ export interface CollectionViewOptions< /** * Specify a child view to use. */ - childView?: (() => typeof Backbone.View) | typeof Backbone.View; + childView?: ((model: TModel) => typeof Backbone.View) | typeof Backbone.View; /** * Define options to pass to the childView constructor. @@ -1219,7 +1220,7 @@ export class CollectionView { new(...args: any[]): TView }) | { new(...args: any[]): TView }; + childView: ((model: TModel) => { new(...args: any[]): TView }) | { new(...args: any[]): TView }; /** * Define options to pass to the childView constructor. diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index 7b6fad9b56..65a1463978 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -398,7 +398,10 @@ namespace v1Changes { namespace Collection { function test_fetch() { var collection = new EmployeeCollection; - collection.fetch({ reset: true }); + collection.fetch({ + reset: true, + remove: false + }); } function test_create() { diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 3d4c90d369..81bce43606 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ -// Definitions by: Boris Yankov , Natan Vivo +// Definitions by: Boris Yankov +// Natan Vivo +// kenjiru // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -76,7 +78,7 @@ declare namespace Backbone { interface ModelDestroyOptions extends Waitable, PersistenceOptions { } - interface CollectionFetchOptions extends PersistenceOptions, Parseable { + interface CollectionFetchOptions extends PersistenceOptions, Parseable, CollectionSetOptions { reset?: boolean; } diff --git a/types/barbellweights/barbellweights-tests.ts b/types/barbellweights/barbellweights-tests.ts new file mode 100644 index 0000000000..7652728824 --- /dev/null +++ b/types/barbellweights/barbellweights-tests.ts @@ -0,0 +1,33 @@ +import { BarbellWeight } from "barbellweights"; + +let calculator: BarbellWeight; +let results: any; + +calculator = new BarbellWeight(200, "bench press"); +results = calculator.getResults(); + +calculator = new BarbellWeight(500, "deadlift"); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "squat"); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { program: "QUARTER" }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { bar: 45 }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { plates: [45, 10, 5] }); +results = calculator.getResults(); + +calculator = new BarbellWeight(400, "deadlift", { warmup_round_to: 5 }); +results = calculator.getResults(); + +calculator = new BarbellWeight(300, "squat", { + program: "STARTING_STRENGTH", + bar: 45, + plates: [45, 25, 10, 5], + warmup_round_to: 5 +}); +results = calculator.getResults(); diff --git a/types/barbellweights/index.d.ts b/types/barbellweights/index.d.ts new file mode 100644 index 0000000000..069f016f8e --- /dev/null +++ b/types/barbellweights/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for barbellweights 0.4 +// Project: https://github.com/toddhibbs/barbellweight#readme +// Definitions by: evelijn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface options { + program?: string; + bar?: number; + plates?: number[]; + warmup_round_to?: number; +} + +export class BarbellWeight { + constructor(workingWeight: number, lift: string, options?: options); + getResults(): any; +} + +export namespace BarbellWeight { + namespace BarbellWeight { + function getResults(): void; + } +} diff --git a/types/barbellweights/tsconfig.json b/types/barbellweights/tsconfig.json new file mode 100644 index 0000000000..1acdbe017b --- /dev/null +++ b/types/barbellweights/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "barbellweights-tests.ts" + ] +} diff --git a/types/barbellweights/tslint.json b/types/barbellweights/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/barbellweights/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bardjs/index.d.ts b/types/bardjs/index.d.ts index 5f2a5a1863..f701d4c368 100644 --- a/types/bardjs/index.d.ts +++ b/types/bardjs/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/wardbell/bardjs // Definitions by: Andrew Archibald // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// /// diff --git a/types/bdfjs/bdfjs-tests.ts b/types/bdfjs/bdfjs-tests.ts new file mode 100644 index 0000000000..1f20259018 --- /dev/null +++ b/types/bdfjs/bdfjs-tests.ts @@ -0,0 +1,18 @@ +import { parse, draw, trim, Font, Bitmap } from "bdfjs"; + +parse(); // $ExpectError +parse(123); // $ExpectError +parse('abc'); // $ExpectType Font +parse('abc', { allprops: true, onlymeta: true }); // $ExpectType Font +const font: Font = parse(Buffer.from([1, 2, 3])); + +draw(); // $ExpectError +draw(123); // $ExpectError +draw(font); // $ExpectError +draw(font, 123); // $ExpectError +draw(font, 'abc', { kerningBias: 123 }); // $ExpectType Bitmap | undefined +const bitmap: Bitmap = draw(font, 'abc')!; + +trim(); // $ExpectError +trim(123); // $ExpectError +trim(bitmap); // $ExpectType Bitmap diff --git a/types/bdfjs/index.d.ts b/types/bdfjs/index.d.ts new file mode 100644 index 0000000000..c9ac5eaedd --- /dev/null +++ b/types/bdfjs/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for bdfjs 0.0 +// Project: https://github.com/zswang/bdfjs +// Definitions by: Olegs Jeremejevs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// https://www.x.org/docs/BDF/bdf.pdf +// https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf + +export interface ParseOptions { + allprops?: boolean; + onlymeta?: boolean; +} + +export interface BoundingBox { + width: number; + height: number; + x: number; + y: number; +} + +export interface Glyph { + bitmap: number[][]; + boundingBox: BoundingBox; + bytes: number[]; + char: string; + code: number; + deviceWidthX: number; + deviceWidthY: number; + name: string; + scalableWidthX: number; + scalableWidthY: number; +} + +export interface Properties { + defaultChar: number; + fontAscent: number; + fontDescent: number; + + addStyleName?: string; + averageWidth?: number; + capHeight?: number; + charsetEncoding?: string; + charsetRegistry?: string; + copyright?: string; + faceName?: string; + familyName?: string; + font?: string; + fontnameRegistry?: string; + fontVersion?: string; + foundry?: string; + notice?: string; + pixelSize?: number; + pointSize?: number; + resolutionX?: number; + resolutionY?: number; + setwidthName?: string; + slant?: string; + spacing?: string; + weightName?: string; + xHeight?: number; + + [key: string]: string | number | undefined; +} + +export interface Size { + points: number; + resolutionX: number; + resolutionY: number; +} + +export interface Meta { + boundingBox: BoundingBox; + name: string; + // The spec says that `properties` is optional, but then goes on to point out + // that without `defaultChar`, `fontAscent` and `fontDescent` it's not really + // a valid font, so I chose to not mark them as a maybe. + properties: Properties; + size: Size; + totalChars: number; + version: string; +} + +export interface Font { + meta: Meta; + glyphs: { [key: number]: Glyph }; // This is NOT a list +} + +export function parse(text: string | Buffer, options?: ParseOptions): Font; + +export interface DrawOptions { + kerningBias?: number; +} + +export interface Bitmap { + width: number; + height: number; + [row: number]: number[]; // Yep, this how the library does it, unfortunately +} + +export function draw( + font: Font, + text: string, + options?: DrawOptions +): Bitmap | undefined; + +export function trim(bitmap: Bitmap): Bitmap; diff --git a/types/bdfjs/tsconfig.json b/types/bdfjs/tsconfig.json new file mode 100644 index 0000000000..f1fe551e09 --- /dev/null +++ b/types/bdfjs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "bdfjs-tests.ts" + ] +} diff --git a/types/bdfjs/tslint.json b/types/bdfjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bdfjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bencode/bencode-tests.ts b/types/bencode/bencode-tests.ts new file mode 100644 index 0000000000..f6ad3c8292 --- /dev/null +++ b/types/bencode/bencode-tests.ts @@ -0,0 +1,6 @@ +import * as bencode from "bencode"; + +bencode.byteLength("abcde"); // $ExpectType number +bencode.encodingLength("abcde"); // $ExpectType number +bencode.encode([1, 2, 3, 4], new Buffer([]), 1); // $ExpectType Buffer +bencode.decode(new Buffer("abcde"), 1, 3); // $ExpectType any diff --git a/types/bencode/index.d.ts b/types/bencode/index.d.ts new file mode 100644 index 0000000000..444513192c --- /dev/null +++ b/types/bencode/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for bencode 2.0 +// Project: https://github.com/themasch/node-bencode#readme +// Definitions by: Tobenna +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function byteLength(value: any): number; +export function encodingLength(value: any): number; +export function encode(data: any, buffer?: Buffer, offset?: number): Buffer; +export function decode( + data: Buffer, + start?: number, + end?: number, + encoding?: string +): any; diff --git a/types/bencode/tsconfig.json b/types/bencode/tsconfig.json new file mode 100644 index 0000000000..47220efa5a --- /dev/null +++ b/types/bencode/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bencode-tests.ts" + ] +} diff --git a/types/bencode/tslint.json b/types/bencode/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bencode/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/better-queue/better-queue-tests.ts b/types/better-queue/better-queue-tests.ts new file mode 100644 index 0000000000..4a1aa4771e --- /dev/null +++ b/types/better-queue/better-queue-tests.ts @@ -0,0 +1,131 @@ +import Queue = require('better-queue'); + +interface TestTask { + taskId: string; + taskPayload: any; +} + +interface TestResult { + some: string; +} + +new Queue((task) => { + const test = task.anything; + console.log(task); +}); + +new Queue((task: TestTask[]) => { + const test = task[0].taskId; + console.log(task); +}); + +new Queue((task: TestTask, cb) => { + const id = task.taskId; + cb(null, 'result'); + cb(); +}, {}); + +new Queue({ + process(task: TestTask, cb) { + const id = task.taskId; + cb(null, { some: 'prop' }); + }, + filter(task, cb) { + const id = task.taskId; + cb(null, task); + }, + merge(oldTask, newTask, cb) { + const oldId = oldTask.taskId; + const newId = newTask.taskId; + cb(null, newTask); + }, + priority(task, cb) { + const id = task.taskId; + cb(null, 10); + }, + precondition(cb) { + cb(null, true); + }, + afterProcessDelay: 1000, + autoResume: true, + batchDelay: 123, + batchDelayTimeout: 123, + batchSize: 123, + cancelIfRunning: true, + concurrent: 123, + failTaskOnProcessException: true, + filo: true, + id: 'taskId', + maxRetries: 1, + maxTimeout: 1, + retryDelay: 1, + storeMaxRetries: 1, + storeRetryTimeout: 1, + preconditionRetryTimeout: 1, + store: 'test' +}); + +new Queue({ + process(task: TestTask[], cb) { + const firstId = task[0].taskId; + cb(null, { some: 'prop' }); + } +}); + +new Queue(() => { }, { + id(task, cb) { + const id = task.taskId; + cb(null, 'taskId'); + } +}); + +new Queue(() => { }, { + store: { + type: 'test' + } +}); + +const q = new Queue(() => {}); + +const testTask = {taskId: '', taskPayload: ''}; + +q.push(testTask); +q.push(testTask, (error, result) => {}); + +q.cancel('id', () => {}); + +class TestStore implements Queue.Store { + connect(cb: (error: any, length: number) => void) { + cb(null, 1); + } + + getTask(taskId: any, cb: (error: any, task: TestTask) => void) { + cb(null, { taskId: '', taskPayload: '' }); + } + + deleteTask(taskId: any, cb: () => void) { + cb(); + } + + putTask(taskId: any, task: TestTask, priority: number, cb: (error: any) => void) { + cb(null); + } + + takeFirstN(n: number, cb: (error: any, lockId: string) => void) { + cb(null, ''); + } + + takeLastN(n: number, cb: (error: any, lockId: string) => void) { + cb(null, ''); + } + + getLock(lockId: string, cb: (error: any, tasks: { [taskId: string]: TestTask }) => void) { + cb(null, { + id: { taskId: 'id', taskPayload: 'payload' } + }); + } + + releaseLock(lockId: string, cb: (error: any) => void) { + cb(null); + } +} diff --git a/types/better-queue/index.d.ts b/types/better-queue/index.d.ts new file mode 100644 index 0000000000..69861c5132 --- /dev/null +++ b/types/better-queue/index.d.ts @@ -0,0 +1,136 @@ +// Type definitions for better-queue 3.8 +// Project: https://github.com/diamondio/better-queue +// Definitions by: Ostap Nagovitsyn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/* =================== USAGE =================== + import * as Queue from "better-queue"; + var queue = new Queue(...); + =============================================== */ + +/// + +declare class BetterQueue extends NodeJS.EventEmitter { + constructor(options: BetterQueue.QueueOptions); + constructor(process: BetterQueue.ProcessFunction, options?: Partial>); + + push(task: T, cb?: (err: any, result: K) => void): BetterQueue.Ticket; + + cancel(taskId: any, cb?: () => void): void; + + pause(): void; + + resume(): void; + + destroy(cb: () => void): void; + + use(store: BetterQueue.Store): void; + + getStats(): BetterQueue.QueueStats; + + resetStats(): void; + + on(event: 'task_finish', listener: (taskId: any, result: K) => void): this; + on(event: 'task_failed', listener: (taskId: any, errorMessage: string) => void): this; + on(event: 'task_progress', listener: (taskId: any, completed: number, total: number) => void): this; + on(event: BetterQueue.QueueEvent, listener: (...args: any[]) => void): this; +} + +declare namespace BetterQueue { + interface QueueOptions { + process: ProcessFunction; + filter?(task: T, cb: (error: any, task: T) => void): void; + merge?(oldTask: T, newTask: T, cb: (error: any, mergedTask: T) => void): void; + priority?(task: T, cb: (error: any, priority: number) => void): void; + precondition?(cb: (error: any, passOrFail: boolean) => void): void; + id?: keyof T | ((task: T, cb: (error: any, id: keyof T) => void) => void); + cancelIfRunning?: boolean; + autoResume?: boolean; + failTaskOnProcessException?: boolean; + filo?: boolean; + batchSize?: number; + batchDelay?: number; + batchDelayTimeout?: number; + concurrent?: number; + maxTimeout?: number; + afterProcessDelay?: number; + maxRetries?: number; + retryDelay?: number; + storeMaxRetries?: number; + storeRetryTimeout?: number; + preconditionRetryTimeout?: number; + store?: string | StoreOptions | Store; + } + + // TODO reflect task types somehow (task: T | T[]) + type ProcessFunction = (task: any, cb: ProcessFunctionCb) => void; + + type ProcessFunctionCb = (error?: any, result?: K) => void; + + type QueueEvent = + 'task_queued' + | 'task_accepted' + | 'task_started' + | 'task_finish' + | 'task_failed' + | 'task_progress' + | 'batch_finish' + | 'batch_failed' + | 'batch_progress' + | 'error'; + + type TicketEvent = + 'accept' + | 'queued' + | 'started' + | 'progress' + | 'finish' + | 'failed' + | 'error'; + + interface Store { + connect(cb: (error: any, length: number) => void): void; + + getTask(taskId: any, cb: (error: any, task: T) => void): void; + + deleteTask(taskId: any, cb: () => void): void; + + putTask(taskId: any, task: T, priority: number, cb: (error: any) => void): void; + + takeFirstN(n: number, cb: (error: any, lockId: string) => void): void; + + takeLastN(n: number, cb: (error: any, lockId: string) => void): void; + + getLock(lockId: string, cb: (error: any, tasks: { [taskId: string]: T }) => void): void; + + releaseLock(lockId: string, cb: (error: any) => void): void; + } + + interface StoreOptions { + type: string; + // store-specific options + [key: string]: any; + } + + class Ticket extends NodeJS.EventEmitter { + on(event: TicketEvent, listener: (...args: any[]) => void): this; + } + + interface TickerProgress { + eta: string; + pct: number; + complete: number; + total: number; + message: string; + } + + interface QueueStats { + total: number; + average: number; + successRate: number; + peak: number; + } +} + +export = BetterQueue; diff --git a/types/better-queue/tsconfig.json b/types/better-queue/tsconfig.json new file mode 100644 index 0000000000..4677f6a711 --- /dev/null +++ b/types/better-queue/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "better-queue-tests.ts" + ] +} diff --git a/types/better-queue/tslint.json b/types/better-queue/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-queue/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/better-scroll/better-scroll-tests.ts b/types/better-scroll/better-scroll-tests.ts new file mode 100644 index 0000000000..282e6185ab --- /dev/null +++ b/types/better-scroll/better-scroll-tests.ts @@ -0,0 +1,68 @@ +import BScroll from 'better-scroll'; + +const BScroll1 = new BScroll('#wrapper'); +const BScroll2 = new BScroll('#wrapper', { scrollX: false, scrollY: false }); +const BScroll3 = new BScroll('#wrapper', { + snap: true, + wheel: false, + scrollbar: false, + pullDownRefresh: false, +}); +const BScroll4 = new BScroll('#wrapper', { + wheel: { + selectedIndex: 0, + }, +}); +const BScroll6 = new BScroll('#wrapper', { + snap: { + loop: false, + el: document.querySelector('div-test') as Element, + threshold: 0.1, + stepX: 100, + stepY: 100, + listenFlick: true, + }, +}); +const BScroll7 = new BScroll('#wrapper', { + scrollbar: { + fade: true, + }, +}); + +const BScroll8 = new BScroll('#wrapper', { + pullDownRefresh: { + threshold: 50, + stop: 20, + }, +}); + +BScroll1.refresh(); +BScroll1.scrollTo(0, 100); +BScroll1.scrollTo(0, 100, 200); + +BScroll1.scrollToElement('selectedElement'); +BScroll1.scrollToElement('selectedElement', 250); + +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement); +BScroll1.scrollToElement(document.getElementById('selectedElement') as HTMLElement, 250); + +BScroll2.on('scrollStart', () => { console.log('scroll started'); }); + +const BScroll9 = new BScroll(document.getElementById('wrapper') as HTMLElement); +const BScroll10 = new BScroll(document.getElementById('wrapper') as HTMLElement, { freeScroll: true }); +const BScroll11 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/, + }, +}); +const BScroll12 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + preventDefaultException: { + className: /(^|\s)test(\s|$)/, + }, +}); + +const BScroll13 = new BScroll(document.getElementById('wrapper') as HTMLElement, { + swipeBounceTime: 1000, +}); + +const BScroll14 = new BScroll('#wrapper', { disableMouse: true, disableTouch: false }); diff --git a/types/better-scroll/index.d.ts b/types/better-scroll/index.d.ts new file mode 100644 index 0000000000..326dd2c3a0 --- /dev/null +++ b/types/better-scroll/index.d.ts @@ -0,0 +1,238 @@ +// Type definitions for better-scroll 1.12 +// Project: https://github.com/ustbhuangyi/better-scroll +// Definitions by: cloudstone +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 +export interface WheelOption { + selectedIndex: number; + rotate: number; + adjustTime: number; + wheelWrapperClass: string; + wheelItemClass: string; +} + +export interface PageOption { + x: number; + y: number; + pageX: number; + pageY: number; +} + +export interface SlideOption { + loop: boolean; + el: Element; + threshold: number; + stepX: number; + stepY: number; + speed: number; + listenFlick: boolean; +} + +export interface ScrollBarOption { + fade: boolean; +} + +export interface PullDownOption { + threshold: number; + stop: number; +} + +export interface PullUpOption { + threshold: number; +} + +export interface BounceObjectOption { + top?: boolean; + bottom?: boolean; + left?: boolean; + right?: boolean; +} + +export interface EaseOption { + swipe?: { + style: string; + fn: (t: number) => number; + }; + swipeBounce?: { + style: string; + fn: (t: number) => number; + }; + bounce?: { + style: string; + fn: (t: number) => number; + }; +} + +export interface BsOption { + startX: number; + startY: number; + scrollX: boolean; + scrollY: boolean; + freeScroll: boolean; + directionLockThreshold: number; + eventPassthrough: string | boolean; + click: boolean; + tap: boolean; + bounce: boolean | BounceObjectOption; + bounceTime: number; + momentum: boolean; + momentumLimitTime: number; + momentumLimitDistance: number; + swipeTime: number; + swipeBounceTime: number; + deceleration: number; + flickLimitTime: number; + flickLimitDistance: number; + resizePolling: number; + probeType: number; + preventDefault: boolean; + preventDefaultException: object; + HWCompositing: boolean; + useTransition: boolean; + useTransform: boolean; + bindToWrapper: boolean; + disableMouse: boolean; + disableTouch: boolean; + observeDOM: boolean; + autoBlur: boolean; + stopPropagation: boolean; + /** + * for picker + * wheel: { + * selectedIndex: 0, + * rotate: 25, + * adjustTime: 400 + * } + */ + wheel: Partial | boolean; + /** + * for slide + * snap: { + * loop: boolean, + * el: domEl, + * threshold: 0.1, + * stepX: 100, + * stepY: 100, + * listenFlick: true + * } + */ + snap: Partial | boolean; + /** + * for scrollbar + * scrollbar: { + * fade: true + * } + */ + scrollbar: Partial | boolean; + /** + * for pull down and refresh + * pullDownRefresh: { + * threshold: 50, + * stop: 20 + * } + */ + pullDownRefresh: Partial | boolean; + /** + * for pull up and load + * pullUpLoad: { + * threshold: 50 + * } + */ + pullUpLoad: Partial | boolean; +} + +export interface Position { + x: number; + y: number; +} + +export default class BScroll { + constructor(element: Element | string, options?: Partial); + + x: number; + y: number; + maxScrollX: number; + maxScrollY: number; + movingDirectionX: number; + movingDirectionY: number; + directionX: number; + directionY: number; + enabled: boolean; + isInTransition: boolean; + isAnimating: boolean; + options: BsOption; + + refresh(): void; + + enable(): void; + + disable(): void; + + scrollBy(x: number, y: number, time?: number, easing?: object): void; + + scrollTo(x: number, y: number, time?: number, easing?: object): void; + + scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: object): void; + + stop(): void; + + destroy(): void; + + goToPage(x: number, y: number, time?: number, easing?: object): void; + + next(time?: number, easing?: object): void; + + prev(time?: number, easing?: object): void; + + getCurrentPage(): PageOption; + + wheelTo(index: number): void; + + getSelectedIndex(): number; + + finishPullDown(): void; + + finishPullUp(): void; + + on( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scrollCancel' | + 'beforeScrollStart' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: () => any + ): void; + + on( + type: + 'scroll' | + 'scrollEnd' | + 'touchEnd', + fn: (pos: Position) => any + ): void; + + off( + type: + 'beforeScrollStart' | + 'scrollStart' | + 'scroll' | + 'scrollCancel' | + 'beforeScrollStart' | + 'scrollEnd' | + 'touchEnd' | + 'flick' | + 'refresh' | + 'destroy' | + 'pullingDown' | + 'pullingUp', + fn: (...args: any[]) => void + ): void; + + trigger(type: string): void; +} diff --git a/types/better-scroll/tsconfig.json b/types/better-scroll/tsconfig.json new file mode 100644 index 0000000000..26f43ee3bd --- /dev/null +++ b/types/better-scroll/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "better-scroll-tests.ts" + ] +} diff --git a/types/better-scroll/tslint.json b/types/better-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bigi/bigi-tests.ts b/types/bigi/bigi-tests.ts index 0e4822aeb6..23bffb0477 100644 --- a/types/bigi/bigi-tests.ts +++ b/types/bigi/bigi-tests.ts @@ -14,3 +14,6 @@ const b6 = b4.multiply(b5); console.log(b6); // => BigInteger { '0': 420, '1': 0, t: 1, s: 0 } + +console.log(b1.compareTo(b2)); +// => 70 diff --git a/types/bigi/index.d.ts b/types/bigi/index.d.ts index 7b44ff75e4..de849587ac 100644 --- a/types/bigi/index.d.ts +++ b/types/bigi/index.d.ts @@ -23,7 +23,7 @@ declare class bigi { clamp(): void; clearBit(n: number): bigi; clone(): bigi; - compareTo(a: bigi): bigi; + compareTo(a: bigi): number; copyTo(r: any): void; dAddOffset(n: any, w: any): void; dMultiply(n: number): void; diff --git a/types/bitcore-lib/bitcore-lib-tests.ts b/types/bitcore-lib/bitcore-lib-tests.ts index fb39c85fc1..99b64e6b78 100644 --- a/types/bitcore-lib/bitcore-lib-tests.ts +++ b/types/bitcore-lib/bitcore-lib-tests.ts @@ -2,7 +2,8 @@ import * as bitcore from 'bitcore-lib'; const transaction = new bitcore.Transaction({}); -const output: bitcore.Output = transaction.outputs[0]; +const output: bitcore.Transaction.Output = transaction.outputs[0]; +const input: bitcore.Transaction.Input = transaction.inputs[0]; const privateKey: bitcore.PrivateKey = new bitcore.PrivateKey('privateKey'); const publicKey: bitcore.PublicKey = privateKey.publicKey; @@ -24,4 +25,11 @@ const tx = new bitcore.Transaction() .from(utxo) .change('bitcoinAddress') .addData(Buffer.from('')) - .sign('bitcoinAddressPrivateKey'); + .sign('bitcoinAddressPrivateKey') + .enableRBF(); + +tx.verify(); + +new bitcore.Unit(2, 'BTC').toSatoshis(); + +bitcore.Unit.fromMilis(1000).toBTC(); diff --git a/types/bitcore-lib/index.d.ts b/types/bitcore-lib/index.d.ts index 0846b85c0d..d94beaca37 100644 --- a/types/bitcore-lib/index.d.ts +++ b/types/bitcore-lib/index.d.ts @@ -9,17 +9,30 @@ export namespace crypto { class BN { } + namespace ECDSA { function sign(message: Buffer, key: PrivateKey): Signature; function verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little'): boolean; } + namespace Hash { - function sha256(buffer: Buffer): Uint8Array; + function sha1(buffer: Buffer): Buffer; + function sha256(buffer: Buffer): Buffer; + function sha256sha256(buffer: Buffer): Buffer; + function sha256ripemd160(buffer: Buffer): Buffer; + function sha512(buffer: Buffer): Buffer; + function ripemd160(buffer: Buffer): Buffer; + + function sha256hmac(data: Buffer, key: Buffer): Buffer; + function sha512hmac(data: Buffer, key: Buffer): Buffer; } + namespace Random { function getRandomBuffer(size: number): Buffer; } + namespace Point {} + class Signature { static fromDER(sig: Buffer): Signature; static fromString(data: string): Signature; @@ -28,24 +41,6 @@ export namespace crypto { } } -export class Transaction { - inputs: Input[]; - outputs: Output[]; - readonly id: string; - readonly hash: string; - nid: string; - - constructor(serialized?: any); - - from(utxos: Transaction.UnspentOutput[]): Transaction; - to(address: Address | string, amount: number): Transaction; - change(address: Address | string): Transaction; - sign(privateKey: PrivateKey | string): Transaction; - applySignature(sig: crypto.Signature): Transaction; - addData(data: Buffer): this; - serialize(): string; -} - export namespace Transaction { class UnspentOutput { static fromObject(o: object): UnspentOutput; @@ -62,6 +57,62 @@ export namespace Transaction { toObject(): this; toString(): string; } + + class Output { + readonly script: Script; + readonly satoshis: number; + + constructor(data: object); + + setScript(script: Script | string | Buffer): this; + inspect(): string; + toObject(): object; + } + + class Input { + readonly prevTxId: Buffer; + readonly outputIndex: number; + readonly sequenceNumber: number; + readonly script: Script; + readonly output?: Output; + } +} + +export class Transaction { + inputs: Transaction.Input[]; + outputs: Transaction.Output[]; + readonly id: string; + readonly hash: string; + nid: string; + + constructor(serialized?: any); + + from(utxos: Transaction.UnspentOutput[]): this; + to(address: Address[] | Address | string, amount: number): this; + change(address: Address | string): this; + fee(amount: number): this; + feePerKb(amount: number): this; + sign(privateKey: PrivateKey | string): this; + applySignature(sig: crypto.Signature): this; + addInput(input: Transaction.Input): this; + addOutput(output: Transaction.Output): this; + addData(value: Buffer): this; + lockUntilDate(time: Date | number): this; + lockUntilBlockHeight(height: number): this; + + hasWitnesses(): boolean; + getFee(): number; + getChangeOutput(): Transaction.Output | null; + getLockTime(): Date | number; + + verify(): string | boolean; + isCoinbase(): boolean; + + enableRBF(): this; + isRBF(): boolean; + + inspect(): string; + serialize(): string; } export class Block { @@ -78,8 +129,16 @@ export class Block { export class PrivateKey { readonly publicKey: PublicKey; + readonly network: Networks.Network; - constructor(key: string); + toAddress(): Address; + toPublicKey(): PublicKey; + toString(): string; + toObject(): object; + toJSON(): object; + toWIF(): string; + + constructor(key?: string, network?: Networks.Network); } export class PublicKey { @@ -91,18 +150,107 @@ export class PublicKey { toDER(): Buffer; } -export interface Output { - readonly script: any; +export class HDPrivateKey { + readonly hdPublicKey: HDPublicKey; + + constructor(data?: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveChild(arg: string | number, hardened?: boolean): HDPrivateKey; + deriveNonCompliantChild(arg: string | number, hardened?: boolean): HDPrivateKey; + + toString(): string; + toObject(): object; + toJSON(): object; +} + +export class HDPublicKey { + readonly xpubkey: Buffer; + readonly network: Networks.Network; + readonly depth: number; + readonly publicKey: PublicKey; + readonly fingerPrint: Buffer; + + constructor(arg: string | Buffer | object); + + derive(arg: string | number, hardened?: boolean): HDPublicKey; + deriveChild(arg: string | number, hardened?: boolean): HDPublicKey; + + toString(): string; } export namespace Script { const types: { DATA_OUT: string; }; + function buildMultisigOut(publicKeys: PublicKey[], threshold: number, opts: object): Script; + function buildWitnessMultisigOutFromScript(script: Script): Script; + function buildMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; + function buildP2SHMultisigIn(pubkeys: PublicKey[], threshold: number, signatures: Buffer[], opts: object): Script; function buildPublicKeyHashOut(address: Address): Script; + function buildPublicKeyOut(pubkey: PublicKey): Script; + function buildDataOut(data: string | Buffer, encoding?: string): Script; + function buildScriptHashOut(script: Script): Script; + function buildPublicKeyIn(signature: crypto.Signature | Buffer, sigtype: number): Script; + function buildPublicKeyHashIn(publicKey: PublicKey, signature: crypto.Signature | Buffer, sigtype: number): Script; + + function fromAddress(address: string | Address): Script; + + function empty(): Script; } -export class Script { } +export class Script { + constructor(data: string | object); + + set(obj: object): this; + + toBuffer(): Buffer; + toASM(): string; + toString(): string; + toHex(): string; + + isPublicKeyHashOut(): boolean; + isPublicKeyHashIn(): boolean; + + getPublicKey(): Buffer; + getPublicKeyHash(): Buffer; + + isPublicKeyOut(): boolean; + isPublicKeyIn(): boolean; + + isScriptHashOut(): boolean; + isWitnessScriptHashOut(): boolean; + isWitnessPublicKeyHashOut(): boolean; + isWitnessProgram(): boolean; + isScriptHashIn(): boolean; + isMultisigOut(): boolean; + isMultisigIn(): boolean; + isDataOut(): boolean; + + getData(): Buffer; + isPushOnly(): boolean; + + classify(): string; + classifyInput(): string; + classifyOutput(): string; + + isStandard(): boolean; + + prepend(obj: any): this; + add(obj: any): this; + + hasCodeseparators(): boolean; + removeCodeseparators(): this; + + equals(script: Script): boolean; + + getAddressInfo(): Address | boolean; + findAndDelete(script: Script): this; + checkMinimalPush(i: number): boolean; + getSignatureOperationsCount(accurate: boolean): number; + + toAddress(): Address; +} export interface Util { readonly buffer: { @@ -125,6 +273,24 @@ export namespace Networks { function get(args: string | number | Network, keys: string | string[]): Network; } -export class Address {} +export class Address { + readonly hashBuffer: Buffer; + readonly network: Networks.Network; + readonly type: string; -export class Input {} + constructor(data: Buffer | Uint8Array | string | object, network?: Networks.Network, type?: string); +} + +export class Unit { + static fromBTC(amount: number): Unit; + static fromMilis(amount: number): Unit; + static fromBits(amount: number): Unit; + static fromSatoshis(amount: number): Unit; + + constructor(amount: number, unitPreference: string); + + toBTC(): number; + toMilis(): number; + toBits(): number; + toSatoshis(): number; +} diff --git a/types/blazy/blazy-tests.ts b/types/blazy/blazy-tests.ts index 835b0e6472..e3aedaabd4 100644 --- a/types/blazy/blazy-tests.ts +++ b/types/blazy/blazy-tests.ts @@ -38,7 +38,7 @@ var tester: BlazyInstance = new Blazy({ /* Functions tests */ tester.revalidate(); -var elements = document.getElementsByTagName('img'); +var elements = document.getElementsByTagName('img'); tester.load(elements, true); tester.destroy(); diff --git a/types/blazy/index.d.ts b/types/blazy/index.d.ts index 8a7183366d..661f651c0b 100644 --- a/types/blazy/index.d.ts +++ b/types/blazy/index.d.ts @@ -53,7 +53,7 @@ interface BlazyInstance { * Forces the given element(s) to load if not collapsed. If you also want to load a collapsed/hidden elements you can add true as the second parameter. * You can pass a single element or a list of elements. Tested with getElementById, getElementsByClassName, querySelectorAll, querySelector and jQuery selector. */ - load(elements: Element|Element[]|HTMLElement|HTMLElement[]|NodeList, force: boolean): void; + load(elements: Element|Element[]|HTMLElement|HTMLElement[]|HTMLCollection|NodeList, force: boolean): void; /** * Unbind events and resets image array. diff --git a/types/blockies/index.d.ts b/types/blockies/index.d.ts index f2de8b2c53..2a8cc526ad 100644 --- a/types/blockies/index.d.ts +++ b/types/blockies/index.d.ts @@ -3,12 +3,16 @@ // Definitions by: Leonid Logvinov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -interface BlockiesIcon { - toDataURL(): string; -} -interface BlockiesConfig { - seed: string; -} -declare function blockies(config: BlockiesConfig): BlockiesIcon; - +declare function blockies(config?: blockies.BlockiesConfig): HTMLCanvasElement; export = blockies; + +declare namespace blockies { + interface BlockiesConfig { + size?: number; + scale?: number; + seed?: string; + color?: string; + bgcolor?: string; + spotcolor?: string; + } +} diff --git a/types/blockies/tsconfig.json b/types/blockies/tsconfig.json index f190f0b0c9..db5851dcbb 100644 --- a/types/blockies/tsconfig.json +++ b/types/blockies/tsconfig.json @@ -1,7 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "lib": ["es6"], + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictFunctionTypes": true, diff --git a/types/bloomfilter/bloomfilter-tests.ts b/types/bloomfilter/bloomfilter-tests.ts index 96ee0443b6..05f6c5210a 100644 --- a/types/bloomfilter/bloomfilter-tests.ts +++ b/types/bloomfilter/bloomfilter-tests.ts @@ -4,8 +4,14 @@ function test_bloomfilter() { const k = 2; const bloomFilter = new BloomFilter(m, k); - const array: Int32Array[] = bloomFilter.buckets; + const array: Int32Array = bloomFilter.buckets; const length: number = bloomFilter.buckets.length; bloomFilter.add('someString'); const test: boolean = bloomFilter.test('someString'); + + const buckets: Int32Array = bloomFilter.buckets; + const bloom2 = new BloomFilter(buckets, k); + + const a: Int32Array = new Int32Array(16); + a[3]; } diff --git a/types/bloomfilter/index.d.ts b/types/bloomfilter/index.d.ts index 00ed408c6d..980a96be55 100644 --- a/types/bloomfilter/index.d.ts +++ b/types/bloomfilter/index.d.ts @@ -1,14 +1,29 @@ -// Type definitions for BloomFilter 0.1 +// Type definitions for BloomFilter 0.0 // Project: https://github.com/jasondavies/bloomfilter.js // Definitions by: slawiko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class BloomFilter { - buckets: Int32Array[]; + buckets: Int32Array; - constructor(m: number, k: number); + /** + * Create a new empty bloom filter of size m with hashes k or + * provide buckets as a number[] or Int32Array to deserialize a bloom filter + * @param mOrBucketsArray number of bits (will be rounded up to nearest 32), or buckets + * to deserialize into a filled bloomfilter + * @param k number of hashes + */ + constructor(m: number | number[] | Int32Array, k: number); + /** + * Add a value to a bloom filter + * @param value + */ add(value: any): void; + /** + * Test whether a value exists in a bloom filter. (False positives are + * possible, false negatives are not.) + */ test(value: any): boolean; } diff --git a/types/blue-tape/blue-tape-tests.ts b/types/blue-tape/blue-tape-tests.ts index c34bc6e32c..526142158b 100644 --- a/types/blue-tape/blue-tape-tests.ts +++ b/types/blue-tape/blue-tape-tests.ts @@ -1,5 +1,3 @@ -/// - import tape = require('blue-tape'); import P = require('bluebird'); diff --git a/types/blue-tape/index.d.ts b/types/blue-tape/index.d.ts index c2d2d50ab5..b086124695 100644 --- a/types/blue-tape/index.d.ts +++ b/types/blue-tape/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/spion/blue-tape // Definitions by: Haoqun Jiang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/bluebird-global/bluebird-global-tests.ts b/types/bluebird-global/bluebird-global-tests.ts index 0464b188cd..b6bbb915e2 100644 --- a/types/bluebird-global/bluebird-global-tests.ts +++ b/types/bluebird-global/bluebird-global-tests.ts @@ -40,3 +40,7 @@ function testPromiseRejection() { return value.toUpperCase(); }); } + +function testGithubTicket28081Regression() { + Promise.resolve([3]).map((n: number) => true); +} diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 6b22cb7114..7f38f981f1 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: d-ph // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /* * 1. Why use `bluebird-global` instead of `bluebird`? @@ -67,52 +67,52 @@ declare global { * Patch all instance method */ interface Promise { - all: typeof Bluebird.prototype.all; - any: typeof Bluebird.prototype.any; - asCallback: typeof Bluebird.prototype.asCallback; - bind: typeof Bluebird.prototype.bind; - call: typeof Bluebird.prototype.call; - cancel: typeof Bluebird.prototype.cancel; - // catch: typeof Bluebird.prototype.catch; - caught: typeof Bluebird.prototype.caught; - delay: typeof Bluebird.prototype.delay; - disposer: typeof Bluebird.prototype.disposer; - done: typeof Bluebird.prototype.done; - each: typeof Bluebird.prototype.each; - error: typeof Bluebird.prototype.error; - filter: typeof Bluebird.prototype.filter; - // finally: typeof Bluebird.prototype.finally; - get: typeof Bluebird.prototype.get; - isCancelled: typeof Bluebird.prototype.isCancelled; - isFulfilled: typeof Bluebird.prototype.isFulfilled; - isPending: typeof Bluebird.prototype.isPending; - isRejected: typeof Bluebird.prototype.isRejected; - isResolved: typeof Bluebird.prototype.isResolved; - lastly: typeof Bluebird.prototype.lastly; - map: typeof Bluebird.prototype.map; - mapSeries: typeof Bluebird.prototype.mapSeries; - nodeify: typeof Bluebird.prototype.nodeify; - props: typeof Bluebird.prototype.props; - race: typeof Bluebird.prototype.race; - reason: typeof Bluebird.prototype.reason; - reduce: typeof Bluebird.prototype.reduce; - reflect: typeof Bluebird.prototype.reflect; - return: typeof Bluebird.prototype.return; - some: typeof Bluebird.prototype.some; - spread: typeof Bluebird.prototype.spread; - suppressUnhandledRejections: typeof Bluebird.prototype.suppressUnhandledRejections; - tap: typeof Bluebird.prototype.tap; - tapCatch: typeof Bluebird.prototype.tapCatch; - // then: typeof Bluebird.prototype.then; - thenReturn: typeof Bluebird.prototype.thenReturn; - thenThrow: typeof Bluebird.prototype.thenThrow; - catchReturn: typeof Bluebird.prototype.catchReturn; - catchThrow: typeof Bluebird.prototype.catchThrow; - throw: typeof Bluebird.prototype.throw; - timeout: typeof Bluebird.prototype.timeout; - toJSON: typeof Bluebird.prototype.toJSON; - toString: typeof Bluebird.prototype.toString; - value: typeof Bluebird.prototype.value; + all: Bluebird["all"]; + any: Bluebird["any"]; + asCallback: Bluebird["asCallback"]; + bind: Bluebird["bind"]; + call: Bluebird["call"]; + cancel: Bluebird["cancel"]; + // catch: Bluebird["catch"]; + caught: Bluebird["caught"]; + delay: Bluebird["delay"]; + disposer: Bluebird["disposer"]; + done: Bluebird["done"]; + each: Bluebird["each"]; + error: Bluebird["error"]; + filter: Bluebird["filter"]; + // finally: Bluebird["finally"]; + get: Bluebird["get"]; + isCancelled: Bluebird["isCancelled"]; + isFulfilled: Bluebird["isFulfilled"]; + isPending: Bluebird["isPending"]; + isRejected: Bluebird["isRejected"]; + isResolved: Bluebird["isResolved"]; + lastly: Bluebird["lastly"]; + map: Bluebird["map"]; + mapSeries: Bluebird["mapSeries"]; + nodeify: Bluebird["nodeify"]; + props: Bluebird["props"]; + race: Bluebird["race"]; + reason: Bluebird["reason"]; + reduce: Bluebird["reduce"]; + reflect: Bluebird["reflect"]; + return: Bluebird["return"]; + some: Bluebird["some"]; + spread: Bluebird["spread"]; + suppressUnhandledRejections: Bluebird["suppressUnhandledRejections"]; + tap: Bluebird["tap"]; + tapCatch: Bluebird["tapCatch"]; + // then: Bluebird["then"]; + thenReturn: Bluebird["thenReturn"]; + thenThrow: Bluebird["thenThrow"]; + catchReturn: Bluebird["catchReturn"]; + catchThrow: Bluebird["catchThrow"]; + throw: Bluebird["throw"]; + timeout: Bluebird["timeout"]; + toJSON: Bluebird["toJSON"]; + toString: Bluebird["toString"]; + value: Bluebird["value"]; /* * Copy&paste ::then and ::catch from lib.es2015.promise.d.ts, because Bluebird's typings are not diff --git a/types/bluebird-global/test/jquery-tests.ts b/types/bluebird-global/test/jquery-tests.ts new file mode 100644 index 0000000000..c4c98fadfc --- /dev/null +++ b/types/bluebird-global/test/jquery-tests.ts @@ -0,0 +1,4 @@ +/// + +// Pulls in bluebird-global to test compatibility. +// Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26328. diff --git a/types/bluebird-global/tsconfig.json b/types/bluebird-global/tsconfig.json index d037429e0d..aa19fd3cda 100644 --- a/types/bluebird-global/tsconfig.json +++ b/types/bluebird-global/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "bluebird-global-tests.ts" + "bluebird-global-tests.ts", + "test/jquery-tests.ts" ] } \ No newline at end of file diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index b7ba96495d..7192ff90a3 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Promise = require('bluebird'); diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index c9c09221e8..05ac5cc19c 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -7,13 +7,13 @@ import Promise = require("bluebird"); -let obj: object; -let bool: boolean; -let num: number; -let str: string; -let err: Error; -let x: any; -let f: (...args: any[]) => any; +let obj: object = {}; +let bool = false; +let num = 0; +let str = ''; +let err: Error = new Error(); +let x: any = 0; +let f: (...args: any[]) => any = () => {}; let asyncfunc: (...args: any[]) => Promise; let arr: any[]; let exp: RegExp; @@ -25,7 +25,6 @@ let numArr: number[]; let value: any; let reason: any; -let insanity: any; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -36,7 +35,10 @@ interface Bar { bar(): string; } interface Baz { - baz(): string; + baz(): string; +} +interface Qux { + qux: string; } // - - - - - - - - - - - - - - - - - @@ -61,11 +63,12 @@ interface StrBarArrMap { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -let foo: Foo; -let bar: Bar; -let baz: Baz; +let foo: Foo = { foo() { return 'foo'; } }; +let bar: Bar = { bar() { return 'bar'; } }; +let baz: Baz = { baz() { return 'baz'; } }; +let qux: Qux = { qux: 'quix' }; -let fooArr: Foo[]; +let fooArr: Foo[] = [foo]; let barArr: Bar[]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -74,13 +77,14 @@ let numProm: Promise; let strProm: Promise; let anyProm: Promise; let boolProm: Promise; -let objProm: Promise; +let objProm: Promise = Promise.resolve(obj); let voidProm: Promise; -let fooProm: Promise; -let barProm: Promise; +let fooProm: Promise = Promise.resolve(foo); +let barProm: Promise = Promise.resolve(bar); let fooOrBarProm: Promise; -let bazProm: Promise; +let bazProm: Promise = Promise.resolve(baz); +let quxProm: Promise = Promise.resolve(qux); // - - - - - - - - - - - - - - - - - @@ -91,8 +95,8 @@ let boolThen: PromiseLike; let objThen: PromiseLike; let voidThen: PromiseLike; -let fooThen: PromiseLike; -let barThen: PromiseLike; +let fooThen: PromiseLike = fooProm; +let barThen: PromiseLike = barProm; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -100,7 +104,7 @@ let numArrProm: Promise; let strArrProm: Promise; let anyArrProm: Promise; -let fooArrProm: Promise; +let fooArrProm: Promise = Promise.resolve(fooArr); let barArrProm: Promise; // - - - - - - - - - - - - - - - - - @@ -109,7 +113,7 @@ let numArrThen: PromiseLike; let strArrThen: PromiseLike; let anyArrThen: PromiseLike; -let fooArrThen: PromiseLike; +let fooArrThen: PromiseLike = fooArrProm; let barArrThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -127,23 +131,19 @@ let numThenArr: Array>; let strThenArr: Array>; let anyThenArr: Array>; -let fooThenArr: Array>; +let fooThenArr: Array> = [fooThen]; let barThenArr: Array>; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // booya! -let fooThenArrThen: PromiseLike>>; -let barThenArrThen: PromiseLike>>; +let fooThenArrThen: PromiseLike>> = Promise.resolve(fooThenArr); let fooResolver: Promise.Resolver; -let barResolver: Promise.Resolver; - let fooInspection: Promise.Inspection; let fooInspectionPromise: Promise>; let fooInspectionArrProm: Promise>>; -let barInspectionArrProm: Promise>>; let BlueBird: typeof Promise; @@ -192,19 +192,16 @@ fooProm = new Promise((resolve) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooResolver.resolve(foo); +fooInspectionPromise = fooProm.reflect(); -fooResolver.reject(err); - -fooResolver.callback = (err: any, value: Foo) => {}; - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bool = fooInspection.isFulfilled(); -bool = fooInspection.isRejected(); -bool = fooInspection.isPending(); -foo = fooInspection.value(); -x = fooInspection.reason(); +fooInspectionPromise.then(value => { + fooInspection = value; + bool = fooInspection.isFulfilled(); + bool = fooInspection.isRejected(); + bool = fooInspection.isPending(); + foo = fooInspection.value(); + x = fooInspection.reason(); +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -235,8 +232,7 @@ barProm = fooProm.then((value: Foo) => { }); barProm = barProm.then((value: Bar) => { if (value) return value; - let b: Bar; - return Promise.resolve(b); + return Promise.resolve(bar); }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -554,10 +550,13 @@ bool = fooProm.isResolved(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -anyProm = fooProm.call("foo"); -anyProm = fooProm.call("foo", 1, 2, 3); +strProm = fooProm.call("foo"); +strProm = fooProm.call("foo", 1, 2, 3); -voidProm = fooProm.get("foo").then((method) => { str = method(); }); +// $ExpectType Bluebird +quxProm.call("qux"); + +strProm = fooProm.get("foo").then(method => method()); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -590,25 +589,37 @@ obj = fooProm.toJSON(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - -barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { +barProm = fooArrProm.spread((one: Foo, two: Foo, twotwo: Foo) => { return barThen; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference +fooArrProm = fooArrProm.all(); -barArrProm = fooProm.all(); -fooInspectionPromise = fooProm.reflect(); -barProm = fooProm.any(); -barArrProm = fooProm.some(num); -barProm = fooProm.race(); +// $ExpectType Bluebird +fooProm.all(); + +fooProm = fooArrProm.any(); + +// $ExpectType Bluebird +fooProm.any(); + +fooArrProm = fooArrProm.some(num); + +// $ExpectType Bluebird +fooProm.some(num); + +fooProm = fooArrProm.race(); + +// $ExpectType Bluebird +fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -626,44 +637,42 @@ Promise.props(new Map>()).then(val => { propsMapValu // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Promise.all([fooProm, barProm]).then(result => { - result[0].foo(); - result[1].bar(); + foo = result[0]; + bar = result[1]; }); Promise.all([fooProm, fooProm]).then(result => { - result[0].foo(); - result[1].foo(); + foo = result[0]; + foo = result[1]; }); Promise.all([fooProm, barProm, bazProm]).then(result => { - result[0].foo(); - result[1].bar(); - result[2].baz(); + foo = result[0]; + bar = result[1]; + baz = result[2]; }); Promise.all([fooProm, barProm, fooProm]).then(result => { - result[0].foo(); - result[1].bar(); - result[2].foo(); + foo = result[0]; + bar = result[1]; + foo = result[2]; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO fix collection inference - -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }); -barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; }, { concurrency: 1 }); -barArrProm = fooArrProm.map((item: Foo) => { +barArrProm = fooArrProm.map((item: Foo) => { return bar; }, { concurrency: 1 @@ -671,37 +680,37 @@ barArrProm = fooArrProm.map((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { +barArrProm = fooArrProm.mapSeries((item: Foo, index: number, arrayLength: number) => { return bar; }); -barArrProm = fooArrProm.mapSeries((item: Foo) => { +barArrProm = fooArrProm.mapSeries((item: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { return memo; }); -barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { +barProm = fooArrProm.reduce((memo: Bar, item: Foo) => { return memo; }, bar); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }); -fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { return bool; }, { concurrency: 1 }); -fooArrProm = fooArrProm.filter((item: Foo) => { +fooArrProm = fooArrProm.filter((item: Foo) => { return bool; }, { concurrency: 1 @@ -709,10 +718,10 @@ fooArrProm = fooArrProm.filter((item: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooArrProm = fooArrProm.each((item: Foo): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number): Bar => index ? bar : null); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); -fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); +fooArrProm = fooArrProm.each((item: Foo): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number) => index ? bar : null); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Bar => bar); +fooArrProm = fooArrProm.each((item: Foo, index: number, arrayLength: number): Promise => barProm); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -784,6 +793,11 @@ fooProm = Promise.attempt(() => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - asyncfunc = Promise.method(() => {}); +{ + const noArg: () => Promise = Promise.method(() => {}); + const oneArg: (x1: number) => Promise = Promise.method((x1: number) => {}); + const twoArg: (x1: number, x2: string) => Promise = Promise.method((x1: number, x2: string) => {}); +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -798,6 +812,12 @@ voidProm = Promise.reject(reason); fooResolver = Promise.defer(); +fooResolver.resolve(foo); + +fooResolver.reject(err); + +fooResolver.callback = (err: any, value: Foo) => {}; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fooProm = Promise.cast(foo); @@ -862,11 +882,18 @@ obj = Promise.promisifyAll(obj, { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const generator = function*(a: number, b: string) { return "string"; }; -const coroutine = Promise.coroutine(generator); -coroutine(5, "foo").then((x: string) => {}); +const generator1 = function*(a: number, b: string) { return "string"; }; +const coroutine1 = Promise.coroutine(generator1); +strProm = coroutine1(5, "foo"); -const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value) => "whatever" }); +const generator2 = function*(a: number, b: string) { + yield foo; + return bar; +}; +const coroutine2 = Promise.coroutine(generator2); +barProm = coroutine2(5, "foo"); + +const coroutineCustomYield = Promise.coroutine(generator1, { yieldHandler: (value) => "whatever" }); /* barProm = Promise.spawn(f); */ diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 8ad57050f6..93dc18dfee 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /*! * The code following this comment originates from: @@ -36,13 +36,20 @@ */ type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); +type IterableItem = R extends Iterable ? U : never; +type IterableOrNever = Extract>; +type Resolvable = R | PromiseLike; +type IterateFunction = (item: T, index: number, arrayLength: number) => Resolvable; declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** - * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. - * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. + * Create a new promise. The passed in function will receive functions + * `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. + * + * If promise cancellation is enabled, passed in function will receive + * one more function argument `onCancel` that allows to register an optional cancellation callback. */ - constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); + constructor(callback: (resolve: (thenableOrResult?: Resolvable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); /** * Promises/A+ `.then()`. Returns a new promise chained from this promise. @@ -50,10 +57,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * The new promise will be rejected or resolved depending on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. - then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. + then(onFulfill?: (value: R) => Resolvable, onReject?: (error: any) => Resolvable): Bluebird; // For simpler signature help. then( - onfulfilled?: ((value: R) => TResult1 | PromiseLike) | null, - onrejected?: ((reason: any) => TResult2 | PromiseLike) | null + onfulfilled?: ((value: R) => Resolvable) | null, + onrejected?: ((reason: any) => Resolvable) | null ): Bluebird; /** @@ -63,8 +70,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject: (error: any) => R | PromiseLike): Bluebird; - catch(onReject: ((error: any) => U | PromiseLike) | undefined | null): Bluebird; + catch(onReject: (error: any) => Resolvable): Bluebird; + catch(onReject: ((error: any) => Resolvable) | undefined | null): Bluebird; /** * This extends `.catch` to work more like catch-clauses in languages like Java or C#. @@ -85,7 +92,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, @@ -93,7 +100,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; catch( @@ -101,7 +108,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; catch( @@ -109,40 +116,40 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => R | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => U | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => R | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => U | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, - onReject: (error: E1) => R | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; catch( filter1: CatchFilter, - onReject: (error: E1) => U | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; /** @@ -155,9 +162,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { caught: Bluebird["catch"]; /** - * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. + * Like `.catch` but instead of catching all types of exceptions, + * it only catches those that don't originate from thrown errors but rather from explicit rejections. */ - error(onReject: (reason: any) => U | PromiseLike): Bluebird; + error(onReject: (reason: any) => Resolvable): Bluebird; /** * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. @@ -166,12 +174,13 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ - finally(handler: () => U | PromiseLike): Bluebird; + finally(handler: () => Resolvable): Bluebird; - lastly(handler: () => U | PromiseLike): Bluebird; + lastly: Bluebird["finally"]; /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. + * Create a promise that follows this promise, but is bound to the given `thisArg` value. + * A bound promise will call its handlers with the bound value set to `this`. * * Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. */ @@ -180,47 +189,47 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled?: (value: R) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike): void; + done(onFulfilled?: (value: R) => Resolvable, onRejected?: (error: any) => Resolvable): void; /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: R) => PromiseLike | U): Bluebird; + tap(onFulFill: (value: R) => Resolvable): Bluebird; /** * Like `.catch()` but rethrows the error */ - tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; + tapCatch(onReject: (error?: any) => Resolvable): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => U | PromiseLike, + onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, filter2: CatchFilter, - onReject: (error: E1 | E2) => U | PromiseLike, + onReject: (error: E1 | E2) => Resolvable, ): Bluebird; - tapCatch( + tapCatch( filter1: CatchFilter, - onReject: (error: E1) => U | PromiseLike, + onReject: (error: E1) => Resolvable, ): Bluebird; /** @@ -241,7 +250,9 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Register a node-style callback on this promise. * * When this promise is is either fulfilled or rejected, - * the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. + * the node callback will be called back with the node.js convention + * where error reason is the first argument and success value is the second argument. + * * The error argument will be `null` in case of success. * If the `callback` argument is not a function, this method does not do anything. */ @@ -305,7 +316,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: keyof R, ...args: any[]): Bluebird; + call(propertyName: U, ...args: any[]): Bluebird any ? ReturnType : never>; /** * This is a convenience method for doing: @@ -453,66 +464,58 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. */ - spread(fulfilledHandler: (...values: W[]) => U | PromiseLike): Bluebird; - spread(fulfilledHandler: (...args: any[]) => U | PromiseLike): Bluebird; + spread(fulfilledHandler: (...values: Array>) => Resolvable): Bluebird; /** * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - all(): Bluebird; + all(): Bluebird>; /** * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - props(this: PromiseLike | V>>): Bluebird>; + props(this: PromiseLike>>): Bluebird>; props(this: PromiseLike>): Bluebird; /** * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - any(): Bluebird; + any(): Bluebird>; /** * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - some(count: number): Bluebird; + some(count: number): Bluebird>; /** * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - race(): Bluebird; + race(): Bluebird>; /** * Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + map(mapper: IterateFunction, U>, options?: Bluebird.ConcurrencyOption): Bluebird ? U[] : never>; /** * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + reduce(reducer: (memo: U, item: IterableItem, index: number, arrayLength: number) => Resolvable, initialValue?: U): Bluebird ? U : never>; /** * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + filter(filterer: IterateFunction, boolean>, options?: Bluebird.ConcurrencyOption): Bluebird>; /** * Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - each(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + each(iterator: IterateFunction, any>): Bluebird>; /** * Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ - mapSeries(iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + mapSeries(iterator: IterateFunction, U>): Bluebird ? U[] : never>; /** * Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled @@ -534,26 +537,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias for `attempt();` for compatibility with earlier ECMAScript version. */ - static try(fn: () => R | PromiseLike): Bluebird; - static attempt(fn: () => R | PromiseLike): Bluebird; + static try(fn: () => Resolvable): Bluebird; + static attempt(fn: () => Resolvable): Bluebird; /** * Returns a new function that wraps the given function `fn`. * The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. * This method is convenient when a function can sometimes return synchronously or throw synchronously. */ - static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; - static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; - static method(fn: (...args: any[]) => R | PromiseLike): (...args: any[]) => Bluebird; + static method(fn: () => Resolvable): () => Bluebird; + static method(fn: (arg1: A1) => Resolvable): (arg1: A1) => Bluebird; + static method(fn: (arg1: A1, arg2: A2) => Resolvable): (arg1: A1, arg2: A2) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3) => Resolvable): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Resolvable): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Resolvable): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; + static method(fn: (...args: any[]) => Resolvable): (...args: any[]) => Bluebird; /** * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. */ static resolve(): Bluebird; - static resolve(value: R | PromiseLike): Bluebird; + static resolve(value: Resolvable): Bluebird; /** * Create a promise that is rejected with the given `reason`. @@ -561,9 +565,11 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static reject(reason: any): Bluebird; /** + * @deprecated * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). + * @see http://bluebirdjs.com/docs/deprecated-apis.html#promise-resolution */ - static defer(): Bluebird.Resolver; + static defer(): Bluebird.Resolver; // tslint:disable-line no-unnecessary-generics /** * Cast the given `value` to a trusted promise. @@ -571,7 +577,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. * If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. */ - static cast(value: R | PromiseLike): Bluebird; + static cast(value: Resolvable): Bluebird; /** * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. @@ -596,7 +602,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If value is a promise, the delay will start counting down when it is fulfilled and the returned * promise will be fulfilled with the fulfillment value of the value promise. */ - static delay(ms: number, value: R | PromiseLike): Bluebird; + static delay(ms: number, value: Resolvable): Bluebird; static delay(ms: number): Bluebird; /** @@ -650,9 +656,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Returns a promise that is resolved by a node style callback function. */ - static fromNode(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; static fromNode(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; - static fromCallback(resolver: (callback: (err: any, result?: any) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; /** @@ -724,13 +728,13 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { */ // TODO enable more overloads // array with promises of different types - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4, PromiseLike | T5]): Bluebird<[T1, T2, T3, T4, T5]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3, PromiseLike | T4]): Bluebird<[T1, T2, T3, T4]>; - static all(values: [PromiseLike | T1, PromiseLike | T2, PromiseLike | T3]): Bluebird<[T1, T2, T3]>; - static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; - static all(values: [PromiseLike | T1]): Bluebird<[T1]>; + static all(values: [Resolvable, Resolvable, Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3, T4, T5]>; + static all(values: [Resolvable, Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3, T4]>; + static all(values: [Resolvable, Resolvable, Resolvable]): Bluebird<[T1, T2, T3]>; + static all(values: [Resolvable, Resolvable]): Bluebird<[T1, T2]>; + static all(values: [Resolvable]): Bluebird<[T1]>; // array with values - static all(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static all(values: Resolvable>>): Bluebird; /** * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. @@ -744,7 +748,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original object is not modified.* */ // map - static props(map: PromiseLike | V>> | Map | V>): Bluebird>; + static props(map: Resolvable>>): Bluebird>; // trusted promise for object static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures // object @@ -753,24 +757,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. */ - static any(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static any(values: Resolvable>>): Bluebird; /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is + * fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. * * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. */ - static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; + static race(values: Resolvable>>): Bluebird; /** * Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises). - * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of + * the winners in order of resolution. * - * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. + * If too many promises are rejected so that the promise can never become fulfilled, + * it will be immediately rejected with an array of rejection reasons in the order they were thrown in. * * *The original array is not modified.* */ - static some(values: PromiseLike | R>> | Iterable | R>, count: number): Bluebird; + static some(values: Resolvable>>, count: number): Bluebird; /** * Promise.join( @@ -783,42 +790,44 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply */ static join( - arg1: A1 | PromiseLike, - handler: (arg1: A1) => R | PromiseLike + arg1: Resolvable, + handler: (arg1: A1) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - handler: (arg1: A1, arg2: A2) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + handler: (arg1: A1, arg2: A2) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - arg4: A4 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + arg4: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Resolvable ): Bluebird; static join( - arg1: A1 | PromiseLike, - arg2: A2 | PromiseLike, - arg3: A3 | PromiseLike, - arg4: A4 | PromiseLike, - arg5: A5 | PromiseLike, - handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike + arg1: Resolvable, + arg2: Resolvable, + arg3: Resolvable, + arg4: Resolvable, + arg5: Resolvable, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Resolvable ): Bluebird; // variadic array /** @deprecated use .all instead */ - static join(...values: Array>): Bluebird; + static join(...values: Array>): Bluebird; /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Map an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. @@ -826,28 +835,34 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original array is not modified.* */ static map( - values: PromiseLike | R>> | Iterable | R>, - mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, + values: Resolvable>>, + mapper: IterateFunction, options?: Bluebird.ConcurrencyOption ): Bluebird; /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Reduce an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * *The original array is not modified. If no `initialValue` is given and the array doesn't contain at least 2 items, + * the callback will not be called and `undefined` is returned. + * * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ static reduce( - values: PromiseLike | R>> | Iterable | R>, - reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, + values: Resolvable>>, + reducer: (total: U, current: R, index: number, arrayLength: number) => Resolvable, initialValue?: U ): Bluebird; /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * Filter an array, or a promise of an array, + * which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` + * where `item` is the resolved value of a respective promise in the input array. * If any promise in the input array is rejected the returned promise is rejected as well. * * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. @@ -855,25 +870,28 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * *The original array is not modified. */ static filter( - values: PromiseLike | R>> | Iterable | R>, - filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, + values: Resolvable>>, + filterer: IterateFunction, option?: Bluebird.ConcurrencyOption ): Bluebird; /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. + * Iterate over an array, or a promise of an array, + * which contains promises (or a mix of promises and values) with the given iterator function with the signature `(item, index, value)` + * where item is the resolved value of a respective promise in the input array. * Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. * * Resolves to the original array unmodified, this method is meant to be used for side effects. * If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. */ - static each( - values: PromiseLike | R>> | Iterable | R>, - iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + static each( + values: Resolvable>>, + iterator: IterateFunction ): Bluebird; /** - * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. + * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), + * iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. * * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. * The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. @@ -882,8 +900,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. */ static mapSeries( - values: PromiseLike | R>> | Iterable | R>, - iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + values: Resolvable>>, + iterator: IterateFunction ): Bluebird; /** @@ -896,7 +914,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * The second argument passed to a disposer is the result promise of the using block, which you can * inspect synchronously. */ - disposer(disposeFn: (arg: R, promise: Bluebird) => void | PromiseLike): Bluebird.Disposer; + disposer(disposeFn: (arg: R, promise: Bluebird) => Resolvable): Bluebird.Disposer; /** * In conjunction with `.disposer`, using will make sure that no matter what, the specified disposer @@ -1032,7 +1050,7 @@ declare namespace Bluebird { /** @deprecated Use PromiseLike directly. */ type Thenable = PromiseLike; - type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; + type ResolvableProps = object & {[K in keyof T]: Resolvable}; interface Resolver { /** @@ -1107,7 +1125,8 @@ declare namespace Bluebird { /** * This is relevant to browser environments with no module loader. * - * Release control of the Promise namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. + * Release control of the Promise namespace to whatever it was before this library was loaded. + * Returns a reference to the library namespace so you can attach it to something else. */ function noConflict(): typeof Bluebird; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 5ab3ff2494..4ff87506f9 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -10,7 +10,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/bluebird/tslint.json b/types/bluebird/tslint.json index 6abaaba4e3..6bdbed5083 100644 --- a/types/bluebird/tslint.json +++ b/types/bluebird/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "max-line-length": [true, 280], "no-unnecessary-generics": false, "prefer-const": false } diff --git a/types/bn.js/bn.js-tests.ts b/types/bn.js/bn.js-tests.ts index 670234ecfe..c1030a2677 100644 --- a/types/bn.js/bn.js-tests.ts +++ b/types/bn.js/bn.js-tests.ts @@ -1,3 +1,4 @@ +// test that it works as a require import BN = require('bn.js'); let bn = new BN(42); diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts index 1a3d4f9b70..48f20ba429 100644 --- a/types/bn.js/index.d.ts +++ b/types/bn.js/index.d.ts @@ -1,59 +1,506 @@ // Type definitions for bn.js 4.11 // Project: https://github.com/indutny/bn.js // Definitions by: Leonid Logvinov +// Henry Nguyen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// type Endianness = 'le' | 'be'; +type IPrimeName = 'k256' | 'p224' | 'p192' | 'p25519'; + +declare class RedBN { + redAdd(b: RedBN): RedBN; + redIAdd(b: RedBN): RedBN; + redSub(b: RedBN): RedBN; + redISub(b: RedBN): RedBN; + redShl(num: number): RedBN; + redMul(b: RedBN): RedBN; + redIMul(b: RedBN): RedBN; + redSqr(): RedBN; + redISqr(): RedBN; + /** + * @description square root modulo reduction context's prime + */ + redSqrt(): RedBN; + /** + * @description modular inverse of the number + */ + redInvm(): RedBN; + redNeg(): RedBN; + /** + * @description modular exponentiation + */ + redPow(b: RedBN): RedBN; + fromRed(): BN; +} + +// FIXME: not sure how to specify the reduction context here +interface ReductionContext { + m: number; + prime: any; + [key: string]: any; +} declare class BN { - constructor(num: number | string | number[] | Buffer, base?: number, endian?: Endianness); - clone(): BN; - toString(base?: number, length?: number): string; - toNumber(): number; - toJSON(): string; - toArray(endian?: Endianness, length?: number): number[]; - toBuffer(endian?: Endianness, length?: number): Buffer; - bitLength(): number; - zeroBits(): number; - byteLength(): number; - isNeg(): boolean; - isEven(): boolean; - isOdd(): boolean; - isZero(): boolean; - cmp(b: any): number; - lt(b: any): boolean; - lte(b: any): boolean; - gt(b: any): boolean; - gte(b: any): boolean; - eq(b: any): boolean; - isBN(b: any): boolean; + constructor( + number: number | string | number[] | Buffer | BN, + base?: number, + endian?: Endianness + ); + /** + * @description create a reduction context + */ + static red(reductionContext: BN | IPrimeName): ReductionContext; + + /** + * @description create a reduction context with the Montgomery trick. + */ + static mont(num: BN): ReductionContext; + + /** + * @description returns true if the supplied object is a BN.js instance + */ + static isBN(b: any): b is BN; + + /** + * @description Convert number to red + */ + toRed(reductionContext: ReductionContext): RedBN; + + /** + * @description clone number + */ + clone(): BN; + + /** + * @description convert to base-string and pad with zeroes + */ + toString(base?: number | 'hex', length?: number): string; + + /** + * @description convert to Javascript Number (limited to 53 bits) + */ + toNumber(): number; + + /** + * @description convert to JSON compatible hex string (alias of toString(16)) + */ + toJSON(): string; + + /** + * @description convert to byte Array, and optionally zero pad to length, throwing if already exceeding + */ + toArray(endian?: Endianness, length?: number): number[]; + + /** + * @description convert to an instance of `type`, which must behave like an Array + */ + toArrayLike( + ArrayType: Buffer | any[], + endian?: Endianness, + length?: number + ): Buffer | any[]; + + /** + * @description convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + */ + toBuffer(endian?: Endianness, length?: number): Buffer; + + /** + * @description get number of bits occupied + */ + bitLength(): number; + + /** + * @description return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + */ + zeroBits(): number; + + /** + * @description return number of bytes occupied + */ + byteLength(): number; + + /** + * @description true if the number is negative + */ + isNeg(): boolean; + + /** + * @description check if value is even + */ + isEven(): boolean; + + /** + * @description check if value is odd + */ + isOdd(): boolean; + + /** + * @description check if value is zero + */ + isZero(): boolean; + + /** + * @description compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + */ + cmp(b: BN): -1 | 0 | 1; + + /** + * @description compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + */ + ucmp(b: BN): -1 | 0 | 1; + + /** + * @description compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + */ + cmpn(b: number): -1 | 0 | 1; + + /** + * @description a less than b + */ + lt(b: BN): boolean; + + /** + * @description a less than b + */ + ltn(b: number): boolean; + + /** + * @description a less than or equals b + */ + lte(b: BN): boolean; + + /** + * @description a less than or equals b + */ + lten(b: number): boolean; + + /** + * @description a greater than b + */ + gt(b: BN): boolean; + + /** + * @description a greater than b + */ + gtn(b: number): boolean; + + /** + * @description a greater than or equals b + */ + gte(b: BN): boolean; + + /** + * @description a greater than or equals b + */ + gten(b: number): boolean; + + /** + * @description a equals b + */ + eq(b: BN): boolean; + + /** + * @description a equals b + */ + eqn(b: number): boolean; + + /** + * @description convert to two's complement representation, where width is bit width + */ + toTwos(width: number): BN; + + /** + * @description convert from two's complement representation, where width is the bit width + */ + fromTwos(width: number): BN; + + /** + * @description negate sign + */ neg(): BN; + + /** + * @description negate sign + */ + ineg(): BN; + + /** + * @description absolute value + */ abs(): BN; + + /** + * @description absolute value + */ + iabs(): BN; + + /** + * @description addition + */ add(b: BN): BN; + + /** + * @description addition + */ + iadd(b: BN): BN; + + /** + * @description addition + */ + addn(b: number): BN; + + /** + * @description addition + */ + iaddn(b: number): BN; + + /** + * @description subtraction + */ sub(b: BN): BN; + + /** + * @description subtraction + */ + isub(b: BN): BN; + + /** + * @description subtraction + */ + subn(b: number): BN; + + /** + * @description subtraction + */ + isubn(b: number): BN; + + /** + * @description multiply + */ mul(b: BN): BN; + + /** + * @description multiply + */ + imul(b: BN): BN; + + /** + * @description multiply + */ + muln(b: number): BN; + + /** + * @description multiply + */ + imuln(b: number): BN; + + /** + * @description square + */ sqr(): BN; + + /** + * @description square + */ + isqr(): BN; + + /** + * @description raise `a` to the power of `b` + */ pow(b: BN): BN; + + /** + * @description divide + */ div(b: BN): BN; + + /** + * @description divide + */ + divn(b: number): BN; + + /** + * @description divide + */ + idivn(b: number): BN; + + /** + * @description reduct + */ mod(b: BN): BN; + + /** + * @description reduct + */ + umod(b: BN): BN; + + /** + * @see API consistency https://github.com/indutny/bn.js/pull/130 + * @description reduct + */ + modn(b: number): number; + + /** + * @description rounded division + */ divRound(b: BN): BN; + /** + * @description or + */ or(b: BN): BN; + + /** + * @description or + */ + ior(b: BN): BN; + + /** + * @description or + */ + uor(b: BN): BN; + + /** + * @description or + */ + iuor(b: BN): BN; + + /** + * @description and + */ and(b: BN): BN; + + /** + * @description and + */ + iand(b: BN): BN; + + /** + * @description and + */ + uand(b: BN): BN; + + /** + * @description and + */ + iuand(b: BN): BN; + + /** + * @description and (NOTE: `andln` is going to be replaced with `andn` in future) + */ + andln(b: number): BN; + + /** + * @description xor + */ xor(b: BN): BN; + + /** + * @description xor + */ + ixor(b: BN): BN; + + /** + * @description xor + */ + uxor(b: BN): BN; + + /** + * @description xor + */ + iuxor(b: BN): BN; + + /** + * @description set specified bit to 1 + */ setn(b: number): BN; + + /** + * @description shift left + */ shln(b: number): BN; + + /** + * @description shift left + */ + ishln(b: number): BN; + + /** + * @description shift left + */ + ushln(b: number): BN; + + /** + * @description shift left + */ + iushln(b: number): BN; + + /** + * @description shift right + */ shrn(b: number): BN; + + /** + * @description shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + */ + ishrn(b: number): BN; + + /** + * @description shift right + */ + ushrn(b: number): BN; + /** + * @description shift right + */ + + iushrn(b: number): BN; + /** + * @description test if specified bit is set + */ + testn(b: number): boolean; + /** + * @description clear bits with indexes higher or equal to `b` + */ + maskn(b: number): BN; + /** + * @description clear bits with indexes higher or equal to `b` + */ + + imaskn(b: number): BN; + /** + * @description add `1 << b` to the number + */ bincn(b: number): BN; + + /** + * @description not (for the width specified by `w`) + */ notn(w: number): BN; + /** + * @description not (for the width specified by `w`) + */ + inotn(w: number): BN; + + /** + * @description GCD + */ gcd(b: BN): BN; + + /** + * @description Extended GCD results `({ a: ..., b: ..., gcd: ... })` + */ egcd(b: BN): { a: BN; b: BN; gcd: BN }; + + /** + * @description inverse `a` modulo `b` + */ invm(b: BN): BN; } diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index c151e81624..7467b3178f 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -2,7 +2,7 @@ // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import Knex = require('knex'); import knex = require('knex'); diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index f0a353889c..9a80afc654 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -1,3 +1,5 @@ +declare let aHtmlElement: HTMLElement; + // -------------------------------------------------------------------------------------- // Alert // -------------------------------------------------------------------------------------- @@ -56,6 +58,10 @@ $("#carousel").carousel({ pause: false, }); +$("#carousel").carousel({ + interval: false, +}); + // -------------------------------------------------------------------------------------- // Collapse // -------------------------------------------------------------------------------------- @@ -74,7 +80,7 @@ $("#collapse").collapse({ }); $("#collapse").collapse({ - parent: document.body, + parent: aHtmlElement, }); $("#collapse").collapse({ @@ -118,11 +124,11 @@ $("#dropdown").dropdown({ }); $("#dropdown").dropdown({ - boundary: document.body, + boundary: aHtmlElement, }); $("#dropdown").dropdown({ - reference: document.body, + reference: aHtmlElement, }); // -------------------------------------------------------------------------------------- @@ -336,5 +342,5 @@ $("#tooltip").tooltip({ }); $("#tooltip").tooltip({ - boundary: document.body, + boundary: aHtmlElement, }); diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 2f43555a73..8a815bccd5 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -46,7 +46,7 @@ export interface CarouselOption { * * @default 5000 */ - interval?: number; + interval?: false | number; /** * Whether the carousel should react to keyboard events. @@ -354,7 +354,7 @@ export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.too // -------------------------------------------------------------------------------------- declare global { - interface JQuery extends Iterable { + interface JQuery { alert(action?: "close" | "dispose"): this; button(action: "toggle" | "dispose"): this; diff --git a/types/bpmn-moddle/bpmn-moddle-tests.ts b/types/bpmn-moddle/bpmn-moddle-tests.ts new file mode 100644 index 0000000000..00e92bddf5 --- /dev/null +++ b/types/bpmn-moddle/bpmn-moddle-tests.ts @@ -0,0 +1,24 @@ +import * as BPMNModdle from "bpmn-moddle"; + +const moddle: BPMNModdle.Moddle = {} as any; + +const element1 = moddle.create("bpmn:UserTask"); // Expect type User Task +element1.$type = "bpmn:UserTask"; // Expect to check against type correctly + +const bpmnModdle: BPMNModdle.BPMNModdle = {} as any; + +bpmnModdle.fromXML("", (err, definitions, parseContext) => { + err; // type of error + definitions; // type of definition + parseContext; // type of any +}); + +const definition: BPMNModdle.Definitions = {} as any; + +// Expect type of process or undefined +const maybeProcess = definition.rootElements.find( + i => i.$type === "bpmn:Process" +); + +// Expect process to have additional typings to base element1 +const process = maybeProcess as BPMNModdle.Process; diff --git a/types/bpmn-moddle/index.d.ts b/types/bpmn-moddle/index.d.ts new file mode 100644 index 0000000000..f4411e05fa --- /dev/null +++ b/types/bpmn-moddle/index.d.ts @@ -0,0 +1,1068 @@ +// Type definitions for bpmn-moddle 5.1 +// Project: https://github.com/bpmn-io/bpmn-moddle +// Definitions by: Hayden +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace BPMNModdle { + type AdHocOrdering = "Parallel" | "Sequential"; + type AssociationDirection = "None" | "One" | "Both"; + type ChoreographyLoopType = + | "None" + | "Standard" + | "MultiInstanceSequential" + | "MultiInstanceParallel"; + type EventBasedGatewayType = "Parallel" | "Exclusive"; + type GatewayDirection = + | "Unspecified" + | "Converging" + | "Diverging" + | "Mixed"; + type ItemKind = "Physical" | "Information"; + type MultiInstanceBehaviour = "None" | "One" | "All" | "Complex"; + type ProcessType = "None" | "Public" | "Private"; + type RelationshipDirection = "None" | "Forward" | "Backward" | "Both"; + + interface TypeDerived { + $type: ElementType; + } + interface BaseElement extends TypeDerived { + /** + * Is the primary Id of the element + */ + id: string; + + /** + * Documentation for the element + */ + documentation?: Documentation[]; + + /** + * Reference to the extension definitions for this element + */ + extensionDefinitions?: ExtensionDefinition[]; + + /** + * Extension Elements + */ + extensionElements?: ExtensionElements; + + /** + * Attributes that aren't defined by the BPMN Spec such + * as Camunda properties + */ + $attrs?: { + [key: string]: any; + }; + } + + // tslint:disable-next-line:no-empty-interface + interface RootElement extends BaseElement {} + interface Interface extends RootElement { + name: string; + operations: Operation[]; + implementationRef: string; + } + + interface Operation extends BaseElement { + name: string; + inMessageRef: Message; + outMessageRef: Message; + errorRef: ErrorElement; + implementationRef: string; + } + + // tslint:disable-next-line:no-empty-interface + interface EndPoint extends RootElement {} + // tslint:disable-next-line:no-empty-interface + interface Auditing extends BaseElement {} + interface CallableElement extends RootElement { + name: string; + ioSpecification: InputOutputSpecification; + supportedInterfaceRef: Interface; + ioBinding: InputOutputBinding; + } + interface ResourceRole extends BaseElement { + name: string; + resourceRef: Resource; + ResourceParameterBindings: ResourceParameterBinding[]; + resourceAssignmentExpression: ResourceAssignmentExpression; + } + interface GlobalTask extends CallableElement { + resources: ResourceRole; + } + // tslint:disable-next-line:no-empty-interface + interface Monitoring extends BaseElement {} + + // tslint:disable-next-line:no-empty-interface + interface Performer extends ResourceRole {} + interface Process extends FlowElementsContainer, CallableElement { + processType: string; + isClosed: boolean; + auditing: Auditing; + monitoring: Monitoring; + properties: Property[]; + laneSets: LaneSet[]; + flowElements: FlowElement[]; + artifacts: Artifact[]; + resources: ResourceRole[]; + correlationSubscriptions: CorrelationSubscription[]; + supports: Process[]; + definitionalCollaborationRef: Collaboration; + isExecutable: boolean; + } + interface LaneSet extends BaseElement { + lanes: Lane[]; + name: string; + } + interface Lane extends BaseElement { + name: string; + partitionElementRef: BaseElement; + partitionElement: BaseElement; + flowNodeRef: FlowNode[]; + childLaneSet: LaneSet; + } + // tslint:disable-next-line:no-empty-interface + interface GlobalManualTask extends GlobalTask {} + // tslint:disable-next-line:no-empty-interface + interface ManualTask extends Task {} + interface UserTask extends Task { + renderings: Rendering[]; + implementation: string; + } + // tslint:disable-next-line:no-empty-interface + interface Rendering extends BaseElement {} + // tslint:disable-next-line:no-empty-interface + interface HumanPerformer extends Performer {} + // tslint:disable-next-line:no-empty-interface + interface PotentialOwner extends Performer {} + interface GlobalUserTask extends GlobalTask { + implementation: string; + renderings: Rendering; + } + interface Gateway extends FlowNode { + /** + * @default Unspecified + */ + gatewayDirection: GatewayDirection; + } + interface EventBasedGateway extends Gateway { + instantiate: boolean; + /** + * @default Exclusive + */ + eventGatewayType: EventBasedGatewayType; + } + interface ComplexGateway extends Gateway { + activationCondition: Expression; + default: SequenceFlow; + } + interface ExclusiveGateway extends Gateway { + default: SequenceFlow; + } + interface InclusiveGateway extends Gateway { + default: SequenceFlow; + } + // tslint:disable-next-line:no-empty-interface + interface ParallelGateway extends Gateway {} + interface Relationship extends BaseElement { + type: string; + direction: RelationshipDirection; + source: BaseElement[]; + target: BaseElement[]; + } + interface Extension extends TypeDerived { + /** + * @default false + */ + mustUnderstand: boolean; + definition: ExtensionDefinition; + } + interface ExtensionDefinition extends TypeDerived { + name: string; + extensionAttributeDefinitions: ExtensionAttributeDefinition[]; + } + interface ExtensionAttributeDefinition extends TypeDerived { + name: string; + type: string; + /** + * @default false + */ + isReference: boolean; + } + interface ExtensionElements extends TypeDerived { + valueRef: BaseElement; + values: BaseElement[]; + extensionAttributeDefinition: ExtensionAttributeDefinition; + [key: string]: any; + } + interface Documentation extends BaseElement { + text: string; + /** + * @default "text/plain" + */ + textFormat: string; + } + interface Event extends FlowNode, InteractionNode { + properties: Property[]; + } + // tslint:disable-next-line:no-empty-interface + interface IntermediateCatchEvent extends CatchEvent {} + // tslint:disable-next-line:no-empty-interface + interface IntermediateThrowEvent extends ThrowEvent {} + // tslint:disable-next-line:no-empty-interface + interface EndEvent extends ThrowEvent {} + interface StartEvent extends CatchEvent { + /** + * @default true + */ + isInterrupting: boolean; + } + interface ThrowEvent extends Event { + dataInputs: DataInput[]; + dataInputAssociations: DataInputAssociation[]; + inputSet: InputSet; + eventDefinitions: EventDefinition[]; + eventDefinitionRef: EventDefinition[]; + } + interface CatchEvent extends Event { + /** + * @default false + */ + parallelMultiple: boolean; + dataOutputs: DataOutput[]; + dataOutputAssociations: DataOutputAssociation[]; + outputSet: OutputSet; + eventDefinitions: EventDefinition[]; + } + interface BoundaryEvent extends CatchEvent { + /** + * @default true + */ + cancelActivity: boolean; + attachedToRef: Activity; + } + + // tslint:disable-next-line:no-empty-interface + interface EventDefinition extends RootElement {} + // tslint:disable-next-line:no-empty-interface + interface CancelEventDefinition extends EventDefinition {} + interface ErrorEventDefinition extends EventDefinition { + errorRef: ErrorElement; + } + // tslint:disable-next-line:no-empty-interface + interface TerminateEventDefinition extends EventDefinition {} + interface EscalationEventDefinition extends EventDefinition { + escalationRef: Escalation; + } + interface Escalation extends RootElement { + structureRef: ItemDefinition; + name: string; + escalationCode: string; + } + interface CompensateEventDefinition extends EventDefinition { + waitForCompletion: boolean; + activityRef: Activity; + } + interface TimerEventDefinition extends EventDefinition { + timeDate: Expression; + timeCycle: Expression; + timeDuration: Expression; + } + interface LinkEventDefinition extends EventDefinition { + name: string; + target: LinkEventDefinition; + source: LinkEventDefinition; + } + interface MessageEventDefinition extends EventDefinition { + nessageRef: Message; + operationRef: Operation; + } + interface ConditionalEventDefinition extends EventDefinition { + condition: Expression; + } + interface SignalEventDefinition extends EventDefinition { + singalRef: Signal; + } + interface Signal extends RootElement { + structureRef: ItemDefinition; + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface ImplicitThrowEvent extends ThrowEvent {} + interface DataState extends BaseElement { + name: string; + } + interface ItemAwareElement extends BaseElement { + itemSubjectRef: ItemDefinition; + dataState: DataState; + } + interface DataAssociation extends BaseElement { + assignment: Assignment; + sourceRef: ItemAwareElement; + targetRef: ItemAwareElement; + transformation: FormalExpression; + } + interface DataInput extends ItemAwareElement { + name: string; + /** @default false */ + isCollection: boolean; + inputSetRef: InputSet; + inputSetWithOptional: InputSet; + inputSetWithWhileExecuting: InputSet; + } + interface DataOutput extends ItemAwareElement { + name: string; + /** + * @default false + */ + isCollection: boolean; + outputSetRef: InputSet[]; + outputSetWithOptional: InputSet[]; + outputSetWithWhileExecuting: InputSet[]; + } + interface InputSet extends BaseElement { + name: string; + dataInputRefs: DataInput[]; + optionalInputRefs: DataInput[]; + whileExecutingInputsRefs: DataInput[]; + outputSetRefs: OutputSet[]; + } + interface OutputSet extends BaseElement { + dataOutputRefs: DataOutput[]; + name: string; + inputSetRefs: InputSet[]; + optionalOutputRefs: DataOutput[]; + whileExecutingOutputREfs: DataOutput[]; + } + interface Property extends ItemAwareElement { + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface DataInputAssociation extends DataAssociation {} + // tslint:disable-next-line:no-empty-interface + interface DataOutputAssociation extends DataAssociation {} + interface InputOutputSpecification extends BaseElement { + dataInputs: DataInput[]; + dataOutputs: DataOutput[]; + inputSets: InputSet[]; + outputSets: OutputSet[]; + } + interface DataObject extends FlowElement, ItemAwareElement { + /** @default false */ + isCollection: boolean; + } + interface InputOutputBinding extends TypeDerived { + inputDataRef: InputSet; + outputDataRef: OutputSet; + operationRef: Operation; + } + interface Assignment extends BaseElement { + from: Expression; + to: Expression; + } + interface DataStore extends RootElement, ItemAwareElement { + name: string; + capacity: number; + isUnlimited: boolean; + } + interface DataStoreReference extends FlowElement, ItemAwareElement { + dataStoreRef: DataStore; + } + interface DataObjectReference extends ItemAwareElement, FlowElement { + dataObjectRef: DataObject; + } + interface ConversationLink extends BaseElement { + sourceRef: InteractionNode; + targetRef: InteractionNode; + name: string; + } + + interface ConversationAssociation extends ConversationNode { + innerConversationNodeRef: ConversationNode; + outerConversationNodeRef: ConversationNode; + } + interface CallConversation extends ConversationNode { + calledCollaborationRef: Collaboration; + participantAssociations: ParticipantAssociation[]; + } + // tslint:disable-next-line:no-empty-interface + interface Conversation extends ConversationNode {} + interface SubConversation extends ConversationNode { + conversationNodes: ConversationNode[]; + } + interface ConversationNode extends InteractionNode, BaseElement { + name: string; + participantRefs: Participant[]; + messageFlowRefs: MessageFlow[]; + correlationKeys: CorrelationKey[]; + } + // tslint:disable-next-line:no-empty-interface + interface GlobalConversation extends Collaboration {} + interface PartnerEntity extends RootElement { + name: string; + participantRef: Participant[]; + } + interface PartnerRole extends RootElement { + name: string; + participantRef: Participant[]; + } + + interface CorrelationProperty extends RootElement { + correlationPropertyRetrievalExpression: CorrelationPropertyRetrievalExpression; + name: string; + type: ItemDefinition; + } + interface ErrorElement extends RootElement { + structureRef: ItemDefinition; + name: string; + errorCode: string; + } + interface CorrelationKey extends BaseElement { + correlationPropertyRef: CorrelationProperty; + name: string; + } + interface Expression extends BaseElement { + body: string; + } + interface FormalExpression extends Expression { + language: string; + evaluatesToTypeRef: ItemDefinition; + } + interface Message extends RootElement { + name: string; + itemRef: ItemDefinition; + } + interface ItemDefinition extends RootElement { + itemKind: ItemKind; + structureRef: string; + /** @default false */ + isCollection: boolean; + import: Import; + } + interface FlowElement extends RootElement { + name?: string; + auditing: Auditing; + monitoring: Monitoring; + categoryValueRef: CategoryValue[]; + } + interface SequenceFlow extends FlowElement { + isImmediate: boolean; + conditionExpression: Expression; + sourceRef: FlowNode; + targetRef: FlowNode; + } + interface FlowElementsContainer extends BaseElement { + laneSets: LaneSet[]; + flowElements: FlowElement[]; + } + interface FlowNode extends FlowElement { + incoming: SequenceFlow[]; + outgoing: SequenceFlow[]; + lanes: Lane[]; + } + interface CorrelationPropertyRetrievalExpression extends BaseElement { + messagePath: FormalExpression; + messageRef: Message; + } + interface CorrelationPropertyBinding extends BaseElement { + dataPath: FormalExpression; + correlationPropertyRef: CorrelationProperty; + } + interface Resource extends RootElement { + name: string; + resourceParameters: ResourceParameter[]; + } + interface ResourceParameter extends BaseElement { + name: string; + isRequired: boolean; + type: ItemDefinition; + } + interface CorrelationSubscription extends BaseElement { + correlationKeyRef: CorrelationKey; + correlationPropertyBinding: CorrelationKey[]; + } + interface MessageFlow extends BaseElement { + name: string; + sourceRef: InteractionNode; + targetRef: InteractionNode; + messageRef: Message; + } + interface MessageFlowAssociation extends BaseElement { + innerMessageFlowRef: MessageFlow; + outerMessageFlowRef: MessageFlow; + } + interface InteractionNode extends TypeDerived { + incomingConversationLinks: ConversationLink[]; + outgoingConversationLinks: ConversationLink[]; + } + interface Participant extends InteractionNode, BaseElement { + name: string; + interfaceRef: Interface[]; + participantMultiplicity: ParticipantMultiplicity; + endPointRefs: EndPoint[]; + processRef: Process; + } + interface ParticipantAssociation extends BaseElement { + innerParticipantRef: Participant; + outerParticipantRef: Participant; + } + interface ParticipantMultiplicity extends BaseElement { + minimum: number; + maximum: number; + } + interface Collaboration extends RootElement { + name: string; + isClosed: boolean; + participants: Participant[]; + messageFlows: MessageFlow[]; + artifacts: Artifact[]; + conversations: ConversationNode[]; + conversationAssociations: ConversationAssociation[]; + participantAssociations: ParticipantAssociation[]; + messageFlowAssociations: MessageFlowAssociation[]; + correlationKeys: CorrelationKey[]; + choreographyRef: Choreography[]; + conversationLinks: ConversationLink[]; + } + interface ChoreographyActivity extends FlowNode { + participantRef: Participant[]; + initiatingParticipantRef: Participant; + correlationKeys: CorrelationKey[]; + loopType: ChoreographyLoopType; + } + interface CallChoreography extends ChoreographyActivity { + calledChoreographyRef: Choreography; + participantAssociations: ParticipantAssociation[]; + } + interface SubChoreography + extends ChoreographyActivity, + FlowElementsContainer { + artifacts: Artifact[]; + } + interface ChoreographyTask extends ChoreographyActivity { + messageFlowRef: MessageFlow[]; + } + // tslint:disable-next-line:no-empty-interface + interface Choreography extends FlowElementsContainer, Collaboration {} + interface GlobalChoreographyTask extends Choreography { + initiatingParticipantRef: Participant; + } + interface TextAnnotation extends Artifact { + text: string; + textFormat: string; + } + interface Group extends Artifact { + categoryValueRef: CategoryValue; + } + interface Association extends Artifact { + associationDirection: AssociationDirection; + sourceRef: BaseElement; + targetRef: BaseElement; + } + interface Category extends RootElement { + categoryValue: CategoryValue; + name: string; + } + // tslint:disable-next-line:no-empty-interface + interface Artifact extends BaseElement {} + interface CategoryValue extends BaseElement { + categorizedFlowElements: FlowElement[]; + value: string; + } + interface Activity extends FlowNode { + isForCompensation: boolean; + default: SequenceFlow; + ioSpecification: InputOutputSpecification; + boundaryEventRefs: BoundaryEvent[]; + properties: Property[]; + dataInputAssociations: DataInputAssociation[]; + dataOutputAssociations: DataOutputAssociation[]; + startQuantity: number; + resources: ResourceRole; + completionQuantity: number; + loopCharacteristics: LoopCharacteristics; + } + interface ServiceTask extends Task { + implementation: string; + operationRef: Operation; + } + interface SubProcess + extends Activity, + FlowElementsContainer, + InteractionNode { + triggeredByEvent: boolean; + artifacts: Artifact[]; + } + // tslint:disable-next-line:no-empty-interface + interface LoopCharacteristics extends BaseElement {} + interface MultiInstanceLoopCharacteristics extends LoopCharacteristics { + isSequential: boolean; + behavior: MultiInstanceBehaviour; + loopCardinality: Expression; + loopDataInputRef: ItemAwareElement; + loopDataOutputRef: ItemAwareElement; + inputDataItem: DataInput; + outputDataItem: DataOutput; + complexBehaviorDefinition: ComplexBehaviorDefinition; + completionCondition: Expression; + oneBehaviorEventRef: EventDefinition; + noneBehaviorEventRef: EventDefinition; + } + interface StandardLoopCharacteristics extends LoopCharacteristics { + testBefore: boolean; + loopCondition: Expression; + loopMaximum: Expression; + } + interface CallActivity extends Activity { + calledElement: string; + } + // tslint:disable-next-line:no-empty-interface + interface Task extends Activity, InteractionNode {} + interface SendTask extends Task { + implementation: string; + operationRef: Operation; + messageRef: Message; + } + interface ReceiveTask extends Task { + implementation: string; + instantiate: boolean; + operationRef: Operation; + messageRef: Message; + } + interface ScriptTask extends Task { + scriptFormat: string; + script: string; + } + interface BusinessRuleTask extends Task { + implementation: string; + } + interface AdHocSubProcess extends SubProcess { + completionCondition: Expression; + ordering: AdHocOrdering; + cancelRemainingInstances: boolean; + } + interface Transaction extends SubProcess { + protocal: string; + method: string; + } + interface GlobalScriptTask extends GlobalTask { + scriptLanguage: string; + script: string; + } + interface GlobalBusinessRuleTask extends GlobalTask { + implementation: string; + } + interface ComplexBehaviorDefinition extends BaseElement { + condition: FormalExpression; + event: ImplicitThrowEvent; + } + interface ResourceParameterBinding extends TypeDerived { + expression: Expression; + parameterRef: ResourceParameter; + } + interface ResourceAssignmentExpression extends BaseElement { + expression: Expression; + } + interface Import extends TypeDerived { + importType: string; + location: string; + namespace: string; + } + interface Definitions extends BaseElement { + name: string; + targetNamespace: string; + expressionLanguage: string; + typeLanguage: string; + imports: Import[]; + extensions: Extension[]; + rootElements: RootElement[]; + diagrams: BPMNDiagram; + er: string; + relationship: Relationship[]; + erVersion: string; + } + interface BPMNDiagram extends Diagram { + plane: BPMNPlane; + labelStyle: BPMNLabelStyle; + } + // tslint:disable-next-line:no-empty-interface + interface BPMNPlane extends Plane {} + // tslint:disable-next-line:no-empty-interface + interface BPMNShape extends LabeledShape {} + // tslint:disable-next-line:no-empty-interface + interface BPMNEdge extends LabeledEdge {} + // tslint:disable-next-line:no-empty-interface + interface BPMNLabel extends Label {} + // tslint:disable-next-line:no-empty-interface + interface BPMNLabelStyle extends Style {} + interface Font extends TypeDerived { + name: string; + size: number; + isBold: boolean; + isItalic: boolean; + isUnderline: boolean; + isStrikeThrough: boolean; + } + interface Point extends TypeDerived { + x: number; + y: number; + width: number; + height: number; + } + // tslint:disable-next-line:no-empty-interface + interface Bounds extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface DiagramElement extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Node extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Edge extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Diagram extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Shape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Plane extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface LabeledEdge extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface LabeledShape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Label extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface Style extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface ColoredShape extends TypeDerived {} + // tslint:disable-next-line:no-empty-interface + interface ColoredEdge extends TypeDerived {} + + interface ElementTypes { + "bpmn:Interface": Interface; + "bpmn:Operation": Operation; + "bpmn:EndPoint": EndPoint; + "bpmn:Auditing": Auditing; + "bpmn:GlobalTask": GlobalTask; + "bpmn:Monitoring": Monitoring; + "bpmn:Performer": Performer; + "bpmn:Process": Process; + "bpmn:LaneSet": LaneSet; + "bpmn:Lane": Lane; + "bpmn:GlobalManualTask": GlobalManualTask; + "bpmn:ManualTask": ManualTask; + "bpmn:UserTask": UserTask; + "bpmn:Rendering": Rendering; + "bpmn:HumanPerformer": HumanPerformer; + "bpmn:PotentialOwner": PotentialOwner; + "bpmn:GlobalUserTask": GlobalUserTask; + "bpmn:Gateway": Gateway; + "bpmn:EventBasedGateway": EventBasedGateway; + "bpmn:ComplexGateway": ComplexGateway; + "bpmn:ExclusiveGateway": ExclusiveGateway; + "bpmn:InclusiveGateway": InclusiveGateway; + "bpmn:ParallelGateway": ParallelGateway; + "bpmn:RootElement": RootElement; + "bpmn:Relationship": Relationship; + "bpmn:BaseElement": BaseElement; + "bpmn:Extension": Extension; + "bpmn:ExtensionDefinition": ExtensionDefinition; + "bpmn:ExtensionAttributeDefinition": ExtensionAttributeDefinition; + "bpmn:ExtensionElements": ExtensionElements; + "bpmn:Documentation": Documentation; + "bpmn:Event": Event; + "bpmn:IntermediateCatchEvent": IntermediateCatchEvent; + "bpmn:IntermediateThrowEvent": IntermediateThrowEvent; + "bpmn:EndEvent": EndEvent; + "bpmn:StartEvent": StartEvent; + "bpmn:ThrowEvent": ThrowEvent; + "bpmn:CatchEvent": CatchEvent; + "bpmn:BoundaryEvent": BoundaryEvent; + "bpmn:EventDefinition": EventDefinition; + "bpmn:CancelEventDefinition": CancelEventDefinition; + "bpmn:ErrorEventDefinition": ErrorEventDefinition; + "bpmn:TerminateEventDefinition": TerminateEventDefinition; + "bpmn:EscalationEventDefinition": EscalationEventDefinition; + "bpmn:Escalation": Escalation; + "bpmn:CompensateEventDefinition": CompensateEventDefinition; + "bpmn:TimerEventDefinition": TimerEventDefinition; + "bpmn:LinkEventDefinition": LinkEventDefinition; + "bpmn:MessageEventDefinition": MessageEventDefinition; + "bpmn:ConditionalEventDefinition": ConditionalEventDefinition; + "bpmn:SignalEventDefinition": SignalEventDefinition; + "bpmn:Signal": Signal; + "bpmn:ImplicitThrowEvent": ImplicitThrowEvent; + "bpmn:DataState": DataState; + "bpmn:ItemAwareElement": ItemAwareElement; + "bpmn:DataAssociation": DataAssociation; + "bpmn:DataInput": DataInput; + "bpmn:DataOutput": DataOutput; + "bpmn:InputSet": InputSet; + "bpmn:OutputSet": OutputSet; + "bpmn:Property": Property; + "bpmn:DataInputAssociation": DataInputAssociation; + "bpmn:DataOutputAssociation": DataOutputAssociation; + "bpmn:InputOutputSpecification": InputOutputSpecification; + "bpmn:DataObject": DataObject; + "bpmn:InputOutputBinding": InputOutputBinding; + "bpmn:Assignment": Assignment; + "bpmn:DataStore": DataStore; + "bpmn:DataStoreReference": DataStoreReference; + "bpmn:DataObjectReference": DataObjectReference; + "bpmn:ConversationLink": ConversationLink; + "bpmn:ConversationAssociation": ConversationAssociation; + "bpmn:CallConversation": CallConversation; + "bpmn:Conversation": Conversation; + "bpmn:SubConversation": SubConversation; + "bpmn:ConversationNode": ConversationNode; + "bpmn:GlobalConversation": GlobalConversation; + "bpmn:PartnerEntity": PartnerEntity; + "bpmn:PartnerRole": PartnerRole; + "bpmn:CorrelationProperty": CorrelationProperty; + "bpmn:Error": ErrorElement; + "bpmn:CorrelationKey": CorrelationKey; + "bpmn:Expression": Expression; + "bpmn:FormalExpression": FormalExpression; + "bpmn:Message": Message; + "bpmn:ItemDefinition": ItemDefinition; + "bpmn:FlowElement": FlowElement; + "bpmn:SequenceFlow": SequenceFlow; + "bpmn:FlowElementsContainer": FlowElementsContainer; + "bpmn:CallableElement": CallableElement; + "bpmn:FlowNode": FlowNode; + "bpmn:CorrelationPropertyRetrievalExpression": CorrelationPropertyRetrievalExpression; + "bpmn:CorrelationPropertyBinding": CorrelationPropertyBinding; + "bpmn:Resource": Resource; + "bpmn:ResourceParameter": ResourceParameter; + "bpmn:CorrelationSubscription": CorrelationSubscription; + "bpmn:MessageFlow": MessageFlow; + "bpmn:MessageFlowAssociation": MessageFlowAssociation; + "bpmn:InteractionNode": InteractionNode; + "bpmn:Participant": Participant; + "bpmn:ParticipantAssociation": ParticipantAssociation; + "bpmn:ParticipantMultiplicity": ParticipantMultiplicity; + "bpmn:Collaboration": Collaboration; + "bpmn:ChoreographyActivity": ChoreographyActivity; + "bpmn:CallChoreography": CallChoreography; + "bpmn:SubChoreography": SubChoreography; + "bpmn:ChoreographyTask": ChoreographyTask; + "bpmn:Choreography": Choreography; + "bpmn:GlobalChoreographyTask": GlobalChoreographyTask; + "bpmn:TextAnnotation": TextAnnotation; + "bpmn:Group": Group; + "bpmn:Association": Association; + "bpmn:Category": Category; + "bpmn:Artifact": Artifact; + "bpmn:CategoryValue": CategoryValue; + "bpmn:Activity": Activity; + "bpmn:ServiceTask": ServiceTask; + "bpmn:SubProcess": SubProcess; + "bpmn:LoopCharacteristics": LoopCharacteristics; + "bpmn:MultiInstanceLoopCharacteristics": MultiInstanceLoopCharacteristics; + "bpmn:StandardLoopCharacteristics": StandardLoopCharacteristics; + "bpmn:CallActivity": CallActivity; + "bpmn:Task": Task; + "bpmn:SendTask": SendTask; + "bpmn:ReceiveTask": ReceiveTask; + "bpmn:ScriptTask": ScriptTask; + "bpmn:BusinessRuleTask": BusinessRuleTask; + "bpmn:AdHocSubProcess": AdHocSubProcess; + "bpmn:Transaction": Transaction; + "bpmn:GlobalScriptTask": GlobalScriptTask; + "bpmn:GlobalBusinessRuleTask": GlobalBusinessRuleTask; + "bpmn:ComplexBehaviorDefinition": ComplexBehaviorDefinition; + "bpmn:ResourceRole": ResourceRole; + "bpmn:ResourceParameterBinding": ResourceParameterBinding; + "bpmn:ResourceAssignmentExpression": ResourceAssignmentExpression; + "bpmn:Import": Import; + "bpmn:Definitions": Definitions; + "bpmndi:BPMNDiagram": BPMNDiagram; + "bpmndi:BPMNPlane": BPMNPlane; + "bpmndi:BPMNShape": BPMNShape; + "bpmndi:BPMNEdge": BPMNEdge; + "bpmndi:BPMNLabel": BPMNLabel; + "bpmndi:BPMNLabelStyle": BPMNLabelStyle; + "dc:boolean": boolean; + "dc:number": number; + "dc:Real": any; + "dc:string": string; + "dc:Font": Font; + "dc:Point": Point; + "dc:Bounds": Bounds; + "di:DiagramElement": DiagramElement; + "di:Node": Node; + "di:Edge": Edge; + "di:Diagram": Diagram; + "di:Shape": Shape; + "di:Plane": Plane; + "di:LabeledEdge": LabeledEdge; + "di:LabeledShape": LabeledShape; + "di:Label": Label; + "di:Style": Style; + "di:Extension": Extension; + "bioc:ColoredShape": ColoredShape; + "bioc:ColoredEdge": ColoredEdge; + } + + type ElementType = keyof ElementTypes; + + interface Option { + [key: string]: any; + } + + interface BPMNModdleConstructor { + new (packages?: any, options?: Option): BPMNModdle; + } + + type ImportFn = ( + err: Error, + definitions: Definitions, + parseContext: any + ) => void; + + interface Moddle { + /** + * Create an instance of the specified type. + * + * @example + * + * var foo = moddle.create('my:Foo'); + * var bar = moddle.create('my:Bar', { id: 'BAR_1' }); + * + * @param descriptor the type descriptor or name know to the model + * @param attrs a number of attributes to initialize the model instance with + * @return model instance + */ + create( + descriptor: K, + attrs?: any + ): T[K]; + create(descriptor: any, attrs?: any): BaseElement; + + /** + * Returns the type representing a given descriptor + * + * @example + * + * var Foo = moddle.getType('my:Foo'); + * var foo = new Foo({ 'id' : 'FOO_1' }); + * + * @param descriptor the type descriptor or name know to the model + * @return the type representing the descriptor + */ + getType(descriptor: any): any; + + /** + * Creates an any-element type to be used within model instances. + * + * This can be used to create custom elements that lie outside the meta-model. + * The created element contains all the meta-data required to serialize it + * as part of meta-model elements. + * + * @example + * + * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { + * value: 'bar' + * }); + * + * var container = moddle.create('my:Container', 'http://my', { + * any: [ foo ] + * }); + * + * // go ahead and serialize the stuff + * + * + * @param name the name of the element + * @param nsUri the namespace uri of the element + * @param [properties] a map of properties to initialize the instance with + * @return the any type instance + */ + createAny(name: string, nsUri: string, properties: any): any; + + /** + * Returns a registered package by uri or prefix + * + * @return the package + */ + getPackage(uriOrPrefix: any): any; + + /** + * Returns a snapshot of all known packages + * + * @return the package + */ + getPackages(): any; + /** + * Returns the descriptor for an element + */ + getElementDescriptor(element: any): any; + + /** + * Returns true if the given descriptor or instance + * represents the given type. + * + * May be applied to this, if element is omitted. + */ + hasType(element: any, type: string): any; + + /** + * Returns the descriptor of an elements named property + */ + getPropertyDescriptor(element: any, property: any): any; + /** + * Returns a mapped type's descriptor + */ + getTypeDescriptor(type: string): any; + } + + interface BPMNModdle extends Moddle { + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param done + * done callback + */ + fromXML(xmlStr: string, done: ImportFn): void; + + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param options + * Options to pass to the underlying reader + * + * @param done + * done callback + */ + fromXML(xmlStr: string, options: Option, done: ImportFn): void; + + /** + * Instantiates a BPMN model tree from a given xml string. + * + * @param xmlStr + * XML string + * + * @param typeName + * Name of the root element + * + * @param options + * Options to pass to the underlying reader + * + * @param done + * done callback + */ + fromXML( + xmlStr: string, + typeName: string, + options: Option, + done: ImportFn + ): void; + } +} + +declare const BPMNModdle: BPMNModdle.BPMNModdleConstructor; +export = BPMNModdle; diff --git a/types/bpmn-moddle/tsconfig.json b/types/bpmn-moddle/tsconfig.json new file mode 100644 index 0000000000..2fbd3fe7c3 --- /dev/null +++ b/types/bpmn-moddle/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "bpmn-moddle-tests.ts"] +} diff --git a/types/bpmn-moddle/tslint.json b/types/bpmn-moddle/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bpmn-moddle/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/braft-editor/index.d.ts b/types/braft-editor/index.d.ts index 1ad5f728ad..62f339a41b 100644 --- a/types/braft-editor/index.d.ts +++ b/types/braft-editor/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for braft-editor 1.1 +// Type definitions for braft-editor 1.9 // Project: https://github.com/margox/braft#readme // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; import { RawDraftContentState } from 'draft-js'; @@ -17,25 +17,44 @@ declare namespace BraftEditor { editorState?: any; contentFormat?: 'raw' | 'html'; initialContent?: string | null; + contentId?: string | number; onChange?: (content: RawDraftContentState) => void; onRawChange?: (content: RawDraftContentState) => void; onHTMLChange?: (content: string) => void; + onTab?: (event: Event) => void; + onSave?: () => void; + onFocus?: () => void; + onBlur?: () => void; controls?: string[]; + excludeControls?: string[]; extendControls?: any[]; + extendAtomics?: any[]; + disabled?: boolean; height?: number; language?: string; placeholder?: string; viewWrapper?: string; + tabIndents?: number; + forceNewLine?: boolean; + textAlignOptions?: string[]; colors?: string[]; + allowSetTextBackgroundColor?: boolean; fontSizes?: number[]; + lineHeights?: number[]; + letterSpacings?: number[]; + indents?: number[]; fontFamilies?: fontFamiliesRange[]; + emojis?: string[]; + pasteMode?: 'text' | ''; media?: { [key: string]: any }; + imageControls?: any; getContent?: (format?: string) => RawDraftContentState; setContent?: (content: RawDraftContentState, format?: string) => void; toggleSelectionBlockType?: (blockquote: string) => any; toggleSelectionInlineStyle?: (style: string, stylesToBeRemoved?: string[]) => any; - insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => void; - insertText?: (text: string, replace?: boolean) => void; + insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => any; + insertText?: (text: string, replace?: boolean) => any; + insertHTML?: (htmlString: string) => any; toggleSelectionLink?: (href: string, target: string) => void; toggleSelectionAlignment?: (alignment: string) => any; toggleSelectionColor?: (hexColor: string) => void; @@ -50,10 +69,12 @@ declare namespace BraftEditor { getDraftInstance?: () => any; getMediaLibraryInstance?: () => any; getSelectionInlineStyle?: () => any; + isEmpty?: () => boolean; + clear?: () => any; undo?: () => any; redo?: () => any; - focus?: () => void; - blur?: () => void; + focus?: () => any; + blur?: () => any; } } declare class BraftEditor extends React.Component { } diff --git a/types/bro-fs/bro-fs-tests.ts b/types/bro-fs/bro-fs-tests.ts new file mode 100644 index 0000000000..75451a303a --- /dev/null +++ b/types/bro-fs/bro-fs-tests.ts @@ -0,0 +1,7 @@ +import * as fs from 'bro-fs'; + +fs.init({type: window.TEMPORARY, bytes: 5 * 1024 * 1024}) + .then(() => fs.mkdir('dir')) + .then(() => fs.writeFile('dir/file.txt', 'hello world')) + .then(() => fs.readFile('dir/file.txt', {type: 'Text'})) + .then(content => console.log(content)); // => "hello world" diff --git a/types/bro-fs/index.d.ts b/types/bro-fs/index.d.ts new file mode 100644 index 0000000000..e0d11cddbe --- /dev/null +++ b/types/bro-fs/index.d.ts @@ -0,0 +1,53 @@ +// Type definitions for bro-fs 0.4 +// Project: https://github.com/vitalets/bro-fs#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export type TextType = 'Text' | 'BinaryString' | 'DataURL'; + +export interface FSOptions { + bytes?: number; + /** + * show request quota popup for PERSISTENT type + * (for Chrome extensions with `unlimitedStorage` permission it is useful to pass `options.requestQuota = false`) + */ + requestQuota?: boolean; + /** `window.PERSISTENT` | `window.TEMPORARY` */ + type?: number; +} + +export interface StatObject { + fullPath: string; + isDirectory: boolean; + isFile: boolean; + modificationTime: Date; + name: string; + size: number; +} + +export interface UsageObject { + grantedBytes: number; + usedBytes: number; +} + +export function appendFile(path: string | FileEntry, data: string | Blob | File | ArrayBuffer): Promise; +export function clear(): Promise; +export function copy(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; +export function exists(path: string): Promise; +export function getEntry(path: FileEntry): Promise; +export function getRoot(): Promise; +export function getUrl(path: string | FileEntry): Promise; +export function init(options?: FSOptions): Promise; +export function isSupported(): boolean; +export function mkdir(path: string): Promise; +export function readdir(path: string | DirectoryEntry, options?: {deep?: boolean}): Promise; +export function readFile(path: string | FileEntry, options: {type: 'ArrayBuffer'}): Promise; +export function readFile(path: string | FileEntry, options?: {type?: TextType}): Promise; +export function rename(oldPath: string | FileEntry, newPath: string, options?: {create?: boolean}): Promise; +export function rmdir(path: string | DirectoryEntry): Promise; +export function stat(path: string | FileEntry): Promise; +export function unlink(path: string | FileEntry): Promise; +export function usage(): Promise; +export function writeFile(path: string, data: string | Blob | File | ArrayBuffer): Promise; diff --git a/types/storejs/tsconfig.json b/types/bro-fs/tsconfig.json similarity index 94% rename from types/storejs/tsconfig.json rename to types/bro-fs/tsconfig.json index df8e4268e3..d8a019ec81 100644 --- a/types/storejs/tsconfig.json +++ b/types/bro-fs/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "storejs-tests.ts" + "bro-fs-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bro-fs/tslint.json b/types/bro-fs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bro-fs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index c63cb0c862..1c7e7e5996 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -1,4 +1,5 @@ import browserSync = require("browser-sync"); +import { EventEmitter } from "events"; (() => { //make sure that the interfaces are correctly exposed @@ -391,6 +392,57 @@ bs.init({ bs.reload(); +browserSync.use( + { + plugin: function(opts: object, bs: browserSync.BrowserSyncInstance) { + console.log(opts); + }, + "plugin:name": "test" + }, + { files: "*.css" } +); + +browserSync.use({ + plugin: function(opts: object, bs: browserSync.BrowserSyncInstance) { + console.log(bs.name); + } +}); + +browserSync( + { + server: { + baseDir: "test/fixtures" + }, + logLevel: "silent", + open: false + } +); + +var instanceName = "TestInstance"; +var namedInstance = browserSync.create(instanceName); +namedInstance.init({ + server: { index: "./app" }, + https: true +}); + +console.log(namedInstance.getOption("https")); // Should output true. + +var existingInstance = browserSync.get(instanceName); + +browserSync.create("InstanceWithEventEmitter", new EventEmitter()); + +// Should output something greater than 0. +console.log(browserSync.instances.length); + +browserSync.reset(); + +// Should output 0. +console.log(browserSync.instances.length); + +var cleanupTestInstance = browserSync.create("CleanupTest"); +cleanupTestInstance.cleanup(); +console.log(cleanupTestInstance.active); // Should output false. + function browserSyncInit(): browserSync.BrowserSyncInstance { var browser = browserSync.create(); browser.init(); diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index de0a457266..bcf0aa966e 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -456,11 +456,15 @@ declare namespace browserSync { * depending on your use-case. */ (config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; + /** + * + */ + instances: Array; /** * Create a Browsersync instance * @param name an identifier that can used for retrieval later */ - create(name?: string): BrowserSyncInstance; + create(name?: string, emitter?: NodeJS.EventEmitter): BrowserSyncInstance; /** * Get a single instance by name. This is useful if you have your build scripts in separate files * @param name the identifier used for retrieval @@ -471,6 +475,11 @@ declare namespace browserSync { * @param name the name of the instance */ has(name: string): boolean; + /** + * Reset the state of the module. + * (should only be needed for test environments) + */ + reset(): void; } interface BrowserSyncInstance { @@ -481,6 +490,24 @@ declare namespace browserSync { * depending on your use-case. */ init(config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance; + /** + * This method will close any running server, stop file watching & exit the current process. + */ + exit(): void; + /** + * Helper method for browser notifications + * @param message Can be a simple message such as 'Connected' or HTML + * @param timeout How long the message will remain in the browser. @since 1.3.0 + */ + notify(message: string, timeout?: number): void; + /** + * Method to pause file change events + */ + pause(): void; + /** + * Method to resume paused watchers + */ + resume(): void; /** * Reload the browser * The reload method will inform all browsers about changed files and will either cause the browser @@ -510,28 +537,30 @@ declare namespace browserSync { */ stream(opts?: StreamOptions): NodeJS.ReadWriteStream; /** - * Helper method for browser notifications - * @param message Can be a simple message such as 'Connected' or HTML - * @param timeout How long the message will remain in the browser. @since 1.3.0 + * Instance Cleanup. */ - notify(message: string, timeout?: number): void; + cleanup(fn?: (error: NodeJS.ErrnoException, bs: BrowserSyncInstance) => void): void; /** - * This method will close any running server, stop file watching & exit the current process. + * Register a plugin. + * Must implement at least a 'plugin' property that returns + * callable function. + * + * @method use + * @param {object} module The object to be `required`. + * @param {object} options The + * @param {any} cb A callback function that will return any errors. */ - exit(): void; + use(module: { "plugin:name"?: string, plugin: (opts: object, bs: BrowserSyncInstance) => any }, options?: object, cb?: any): void; + /** + * Callback helper to examine what options have been set. + * @param {string} name The key to search options map for. + */ + getOption(name: string): any; /** * Stand alone file-watcher. Use this along with Browsersync to create your own, minimal build system */ watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any) : NodeJS.EventEmitter; - /** - * Method to pause file change events - */ - pause(): void; - /** - * Method to resume paused watchers - */ - resume(): void; /** * The internal Event Emitter used by the running Browsersync instance (if there is one). You can use * this to emit your own events, such as changed files, logging etc. diff --git a/types/bson/bson-tests.ts b/types/bson/bson-tests.ts index b3173053c8..f75ee94523 100644 --- a/types/bson/bson-tests.ts +++ b/types/bson/bson-tests.ts @@ -9,7 +9,7 @@ let Long = bson.Long; let doc = { long: Long.fromNumber(100) } // Serialize a document -let data = BSON.serialize(doc, false, true, false); +let data = BSON.serialize(doc); console.log("data:", data); // Deserialize the resulting Buffer diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 3b0feb0113..e6afab65a5 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bson 1.0.4 +// Type definitions for bson 1.0.6 // Project: https://github.com/mongodb/js-bson // Definitions by: Hiroki Horiuchi // Federico Caselli @@ -6,34 +6,81 @@ /// +interface CommonSerializeOptions { + /** {default:false}, the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** {default:false}, serialize the javascript functions. */ + serializeFunctions?: boolean; + /** {default:true}, ignore undefined fields. */ + ignoreUndefined?: boolean; +} + +export interface SerializeOptions extends CommonSerializeOptions { + /** {default:1024*1024*17}, minimum size of the internal temporary serialization buffer. */ + minInternalBufferSize?: number; +} + +export interface SerializeWithBufferAndIndexOptions extends CommonSerializeOptions { + /** {default:0}, the index in the buffer where we wish to start serializing into. */ + index?: number; +} + export interface DeserializeOptions { - /** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized. */ + /** {default:false}, evaluate functions in the BSON document scoped to the object deserialized. */ evalFunctions?: boolean; - /** {Boolean, default:false}, cache evaluated functions for reuse. */ + /** {default:false}, cache evaluated functions for reuse. */ cacheFunctions?: boolean; - /** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function. */ + /** {default:false}, use a crc32 code for caching, otherwise use the string of the function. */ cacheFunctionsCrc32?: boolean; - /** {Boolean, default:false}, deserialize Binary data directly into node.js Buffer object. */ + /** {default:true}, when deserializing a Long will fit it into a Number if it's smaller than 53 bits. */ + promoteLongs?: boolean; + /** {default:false}, deserialize Binary data directly into node.js Buffer object. */ promoteBuffers?: boolean; + /** {default:false}, when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** {default:null}, allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: { readonly [fieldName: string]: boolean }; + /** {default:false}, return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; } export interface CalculateObjectSizeOptions { - /** {Boolean, default:false}, serialize the javascript functions */ + /** {default:false}, serialize the javascript functions */ serializeFunctions?: boolean; - /** {Boolean, default:true}, ignore undefined fields. */ + /** {default:true}, ignore undefined fields. */ ignoreUndefined?: boolean; } export class BSON { + /** - * @param {Object} object the Javascript object to serialize. - * @param {Boolean} checkKeys the serializer will check if keys are valid. - * @param {Boolean} asBuffer return the serialized object as a Buffer object (ignore). - * @param {Boolean} serializeFunctions serialize the javascript functions (default:false) - * @return {Buffer} returns a TypedArray or Array depending on what your browser supports + * Serialize a Javascript object. + * + * @param object The Javascript object to serialize. + * @param options Serialize options. + * @return The Buffer object containing the serialized object. */ - serialize(object: any, checkKeys?: boolean, asBuffer?: boolean, serializeFunctions?: boolean): Buffer; - deserialize(buffer: Buffer, options?: DeserializeOptions, isArray?: boolean): any; + serialize(object: any, options?: SerializeOptions): Buffer; + + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization. + * + * @param object The Javascript object to serialize. + * @param buffer The Buffer you pre-allocated to store the serialized BSON object. + * @param options Serialize options. + * @returns The index pointing to the last written byte in the buffer + */ + serializeWithBufferAndIndex(object: any, buffer: Buffer, options?: SerializeWithBufferAndIndexOptions): number; + + /** + * Deserialize data as BSON. + * + * @param buffer The buffer containing the serialized set of BSON documents. + * @param options Deserialize options. + * @returns The deserialized Javascript Object. + */ + deserialize(buffer: Buffer, options?: DeserializeOptions): any; + /** * Calculate the bson size for a passed in Javascript object. * @@ -42,21 +89,50 @@ export class BSON { * @return {Number} returns the number of bytes the BSON object will take up. */ calculateObjectSize(object: any, options?: CalculateObjectSizeOptions): number; + + /** + * Deserialize stream data as BSON documents. + * + * @param data The buffer containing the serialized set of BSON documents. + * @param startIndex The start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments Number of documents to deserialize + * @param documents An array where to store the deserialized documents + * @param docStartIndex The index in the documents array from where to start inserting documents + * @param options Additional options used for the deserialization + * @returns The next index in the buffer after deserialization of the `numberOfDocuments` + */ + deserializeStream( + data: Buffer, + startIndex: number, + numberOfDocuments: number, + documents: Array, + docStartIndex: number, + options?: DeserializeOptions + ): number; + } +/** A class representation of the BSON Binary type. */ export class Binary { - static SUBTYPE_DEFAULT: number; - static SUBTYPE_FUNCTION: number; - static SUBTYPE_BYTE_ARRAY: number; - static SUBTYPE_UUID_OLD: number; - static SUBTYPE_UUID: number; - static SUBTYPE_MD5: number; - static SUBTYPE_USER_DEFINED: number; + static readonly SUBTYPE_DEFAULT: number; + static readonly SUBTYPE_FUNCTION: number; + static readonly SUBTYPE_BYTE_ARRAY: number; + static readonly SUBTYPE_UUID_OLD: number; + static readonly SUBTYPE_UUID: number; + static readonly SUBTYPE_MD5: number; + static readonly SUBTYPE_USER_DEFINED: number; + + /** + * @param buffer A buffer object containing the binary data + * @param subType Binary data subtype + */ constructor(buffer: Buffer, subType?: number); /** The underlying Buffer which stores the binary data. */ readonly buffer: Buffer; + /** Binary data subtype */ + readonly sub_type?: number; /** The length of the binary. */ length(): number; @@ -69,80 +145,211 @@ export class Binary { /** Writes a buffer or string to the binary */ write(buffer: Buffer | string, offset: number): void; } + +/** A class representation of the BSON Code type. */ export class Code { + + /** + * @param code A string or function. + * @param scope An optional scope for the function. + */ constructor(code: string | Function, scope?: any); + + readonly code: string | Function; + readonly scope?: any; + } + +/** + * A class representation of the BSON DBRef type. + * @deprecated + */ export class DBRef { + /** + * @param namespace The collection name. + * @param oid The reference ObjectID. + * @param db Optional db name, if omitted the reference is local to the current db + */ constructor(namespace: string, oid: ObjectID, db?: string); + namespace: string; oid: ObjectID; db?: string; } + +/** A class representation of the BSON Double type. */ export class Double { + /** + * @param value The number we want to represent as a double. + */ constructor(value: number); valueOf(): number; } -export class Long { - static MAX_VALUE: Long; - static MIN_VALUE: Long; - static NEG_ONE: Long; - static ONE: Long; - static ZERO: Long; - static fromInt(i: number): Long; - static fromNumber(n: number): Long; - static fromBits(lowBits: number, highBits: number): Long; - static fromString(s: string, opt_radix?: number): Long; +/** A class representation of the BSON Int32 type. */ +export class Int32 { + /** + * @param value The number we want to represent as an int32. + */ + constructor(value: number); + valueOf(): number; +} + +/** + * Base class for Long and Timestamp. + * In original js-node@1.0.x code 'Timestamp' is a 100% copy-paste of 'Long' + * with 'Long' replaced by 'Timestamp' (changed to inheritance in js-node@2.0.0) + */ +declare class LongLike { + + /** + * @param low The low (signed) 32 bits. + * @param high The high (signed) 32 bits. + */ constructor(low: number, high: number); - add(other: Long): Long; - and(other: Long): Long; - compare(other: Long): number; - div(other: Long): Long; - equals(other: Long): boolean; + /** Returns the sum of `this` and the `other`. */ + add(other: T): T; + /** Returns the bitwise-AND of `this` and the `other`. */ + and(other: T): T; + /** + * Compares `this` with the given `other`. + * @returns 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater. + */ + compare(other: T): number; + /** Returns `this` divided by the given `other`. */ + div(other: T): T; + /** Return whether `this` equals the `other` */ + equals(other: T): boolean; + /** Return the high 32-bits value. */ getHighBits(): number; + /** Return the low 32-bits value. */ getLowBits(): number; + /** Return the low unsigned 32-bits value. */ getLowBitsUnsigned(): number; + /** Returns the number of bits needed to represent the absolute value of `this`. */ getNumBitsAbs(): number; - greaterThan(other: Long): number; - greaterThanOrEqual(other: Long): number; + /** Return whether `this` is greater than the `other`. */ + greaterThan(other: T): boolean; + /** Return whether `this` is greater than or equal to the `other`. */ + greaterThanOrEqual(other: T): boolean; + /** Return whether `this` value is negative. */ isNegative(): boolean; + /** Return whether `this` value is odd. */ isOdd(): boolean; + /** Return whether `this` value is zero. */ isZero(): boolean; - lessThan(other: Long): boolean; - lessThanOrEqual(other: Long): boolean; - modulo(other: Long): Long; - multiply(other: Long): Long; - negate(): Long; - not(): Long; - notEquals(other: Long): boolean; - or(other: Long): Long; - shiftLeft(other: number): Long; - shiftRight(other: number): Long; - shiftRightUnsigned(other: number): Long; - subtract(other: Long): Long; + /** Return whether `this` is less than the `other`. */ + lessThan(other: T): boolean; + /** Return whether `this` is less than or equal to the `other`. */ + lessThanOrEqual(other: T): boolean; + /** Returns `this` modulo the given `other`. */ + modulo(other: T): T; + /** Returns the product of `this` and the given `other`. */ + multiply(other: T): T; + /** The negation of this value. */ + negate(): T; + /** The bitwise-NOT of this value. */ + not(): T; + /** Return whether `this` does not equal to the `other`. */ + notEquals(other: T): boolean; + /** Returns the bitwise-OR of `this` and the given `other`. */ + or(other: T): T; + /** + * Returns `this` with bits shifted to the left by the given amount. + * @param numBits The number of bits by which to shift. + */ + shiftLeft(numBits: number): T; + /** + * Returns `this` with bits shifted to the right by the given amount. + * @param numBits The number of bits by which to shift. + */ + shiftRight(numBits: number): T; + /** + * Returns `this` with bits shifted to the right by the given amount, with the new top bits matching the current sign bit. + * @param numBits The number of bits by which to shift. + */ + shiftRightUnsigned(numBits: number): T; + /** Returns the difference of `this` and the given `other`. */ + subtract(other: T): T; + /** Return the int value (low 32 bits). */ toInt(): number; + /** Return the JSON value. */ toJSON(): string; + /** Returns closest floating-point representation to `this` value */ toNumber(): number; + /** + * Return as a string + * @param radix the radix in which the text should be written. {default:10} + */ toString(radix?: number): string; - xor(other: Long): Long; + /** Returns the bitwise-XOR of `this` and the given `other`. */ + xor(other: T): T; + } + +/** + * A class representation of the BSON Long type, a 64-bit two's-complement + * integer value, which faithfully simulates the behavior of a Java "Long". This + * implementation is derived from LongLib in GWT. + */ +export class Long extends LongLike { + + static readonly MAX_VALUE: Long; + static readonly MIN_VALUE: Long; + static readonly NEG_ONE: Long; + static readonly ONE: Long; + static readonly ZERO: Long; + + /** Returns a Long representing the given (32-bit) integer value. */ + static fromInt(i: number): Long; + /** Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(n: number): Long; + /** + * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits. + * @param lowBits The low 32-bits. + * @param highBits The high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Long; + /** + * Returns a Long representation of the given string + * @param opt_radix The radix in which the text is written. {default:10} + */ + static fromString(s: string, opt_radix?: number): Long; + +} + +/** A class representation of the BSON Decimal128 type. */ export class Decimal128 { + + /** Create a Decimal128 instance from a string representation. */ static fromString(s: string): Decimal128; + /** + * @param bytes A buffer containing the raw Decimal128 bytes. + */ constructor(bytes: Buffer); + /** A buffer containing the raw Decimal128 bytes. */ + readonly bytes: Buffer; + toJSON(): string; toString(): string; } + +/** A class representation of the BSON MaxKey type. */ export class MaxKey { constructor(); } + +/** A class representation of the BSON MinKey type. */ export class MinKey { constructor(); } + +/** A class representation of the BSON ObjectID type. */ export class ObjectID { /** * Create a new ObjectID instance @@ -173,19 +380,19 @@ export class ObjectID { static isValid(id: string | number | ObjectID): boolean; /** * Compares the equality of this ObjectID with `otherID`. - * @param {object} otherID ObjectID instance to compare against. + * @param {ObjectID|string} otherID ObjectID instance to compare against. * @return {boolean} the result of comparing two ObjectID's */ - equals(otherID: ObjectID): boolean; + equals(otherID: ObjectID | string): boolean; /** * Generate a 12 byte id string used in ObjectID's * @param {number} time optional parameter allowing to pass in a second based timestamp. * @return {string} return the 12 byte id binary string. */ - generate(time?: number): string; + generate(time?: number): Buffer; /** * Returns the generation date (accurate up to the second) that this ID was generated. - * @return {date} the generation date + * @return {Date} the generation date */ getTimestamp(): Date; /** @@ -194,56 +401,55 @@ export class ObjectID { */ toHexString(): string; } + export { ObjectID as ObjectId }; + +/** A class representation of the BSON RegExp type. */ export class BSONRegExp { + constructor(pattern: string, options: string); + + readonly pattern: string; + readonly options: string; + } + +/** + * A class representation of the BSON Symbol type. + * @deprecated + */ export class Symbol { + constructor(value: string); + + /** Access the wrapped string value. */ + valueOf(): string; + } -export class Timestamp { - constructor(low: number, high: number); - static MAX_VALUE: Timestamp; - static MIN_VALUE: Timestamp; - static NEG_ONE: Timestamp; - static ONE: Timestamp; - static ZERO: Timestamp; +/** A class representation of the BSON Timestamp type. */ +export class Timestamp extends LongLike { - static fromBits(lowBits: number, highBits: number): Timestamp; + static readonly MAX_VALUE: Timestamp; + static readonly MIN_VALUE: Timestamp; + static readonly NEG_ONE: Timestamp; + static readonly ONE: Timestamp; + static readonly ZERO: Timestamp; + + /** Returns a Timestamp represented by the given (32-bit) integer value */ static fromInt(value: number): Timestamp; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. */ static fromNumber(value: number): Timestamp; - static fromString(str: string, radix?: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * @param lowBits The low 32-bits. + * @param highBits The high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string. + * @param opt_radix The radix in which the text is written. {default:10} + */ + static fromString(str: string, opt_radix?: number): Timestamp; - add(other: Timestamp): Timestamp; - and(other: Timestamp): Timestamp; - compare(other: Timestamp): number; - div(other: Timestamp): Timestamp; - equals(other: Timestamp): boolean; - getHighBits(): number; - getLowBits(): number; - getLowBitsUnsigned(): number; - getNumBitsAbs(): number; - greaterThan(other: Timestamp): number; - greaterThanOrEqual(other: Timestamp): number; - isNegative(): boolean; - isOdd(): boolean; - isZero(): boolean; - lessThan(other: Timestamp): boolean; - lessThanOrEqual(other: Timestamp): boolean; - modulo(other: Timestamp): Timestamp; - multiply(other: Timestamp): Timestamp; - negate(): Timestamp; - not(): Timestamp; - notEquals(other: Timestamp): boolean; - or(other: Timestamp): Timestamp; - shiftLeft(other: number): Timestamp; - shiftRight(other: number): Timestamp; - shiftRightUnsigned(other: number): Timestamp; - subtract(other: Timestamp): Timestamp; - toInt(): number; - toJSON(): string; - toNumber(): number; - toString(radix?: number): string; - xor(other: Timestamp): Timestamp; } diff --git a/types/buffer-from/buffer-from-tests.ts b/types/buffer-from/buffer-from-tests.ts new file mode 100644 index 0000000000..8fdd4fa811 --- /dev/null +++ b/types/buffer-from/buffer-from-tests.ts @@ -0,0 +1,6 @@ +import bufferFrom = require('buffer-from'); + +bufferFrom([1, 2, 3, 4]); // $ExpectType Buffer +bufferFrom(new Uint8Array([1, 2, 3, 4]).buffer, 1, 2); // $ExpectType Buffer +bufferFrom('test', 'utf8'); // $ExpectType Buffer +bufferFrom(bufferFrom('test')); // $ExpectType Buffer diff --git a/types/buffer-from/index.d.ts b/types/buffer-from/index.d.ts new file mode 100644 index 0000000000..412056ed8a --- /dev/null +++ b/types/buffer-from/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for buffer-from 1.1 +// Project: https://github.com/LinusU/buffer-from#readme +// Definitions by: Nat Burns +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function bufferFrom(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; +declare function bufferFrom(str: string, encoding?: string): Buffer; +declare function bufferFrom(data: ReadonlyArray | Buffer): Buffer; + +export = bufferFrom; diff --git a/types/buffer-from/tsconfig.json b/types/buffer-from/tsconfig.json new file mode 100644 index 0000000000..195d0a78b6 --- /dev/null +++ b/types/buffer-from/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "buffer-from-tests.ts" + ] +} diff --git a/types/buffer-from/tslint.json b/types/buffer-from/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buffer-from/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/buffer-reader/buffer-reader-tests.ts b/types/buffer-reader/buffer-reader-tests.ts new file mode 100644 index 0000000000..9868131c93 --- /dev/null +++ b/types/buffer-reader/buffer-reader-tests.ts @@ -0,0 +1,28 @@ +import BufferReader from 'buffer-reader'; + +const buffer = new Buffer(1000); +const reader = new BufferReader(buffer); +reader.append(new Buffer(1)); +reader.tell(); +reader.seek(1); +reader.move(2); +reader.restAll(); +reader.nextBuffer(2); +reader.nextString(5); +reader.nextString(5, 'utf8'); +reader.nextStringZero(); +reader.nextStringZero('utf8'); +reader.nextInt8(); +reader.nextUInt8(); +reader.nextInt16LE(); +reader.nextUInt16LE(); +reader.nextInt16BE(); +reader.nextUInt16BE(); +reader.nextInt32LE(); +reader.nextUInt32LE(); +reader.nextInt32BE(); +reader.nextUInt32BE(); +reader.nextFloatLE(); +reader.nextFloatBE(); +reader.nextDouble32LE(); +reader.nextDouble32BE(); diff --git a/types/buffer-reader/index.d.ts b/types/buffer-reader/index.d.ts new file mode 100644 index 0000000000..e83f081e69 --- /dev/null +++ b/types/buffer-reader/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for buffer-reader 0.1 +// Project: https://github.com/villadora/node-buffer-reader +// Definitions by: nrlquaker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +/// + +export = BufferReader; + +declare class BufferReader { + /** + * Create a new reader, if no buffer provided, a empty buffer will be used. + */ + constructor(buffer?: Buffer) + /** + * Append new buffer to the end of current reader. + * @param buffer buffer to append + */ + append(buffer: Buffer): void; + /** + * Return current position of the reader. + */ + tell(): number; + /** + * Set new position of the reader, if the pos is invalid, an exception will be raised. + * @param position new position + */ + seek(position: number): void; + /** + * Move the position of reader by offset, offset can be negative; it can be used to skip some bytes. + * @param offset offset to move by + */ + move(offset: number): void; + /** + * Get all the remaining bytes as a Buffer. + */ + restAll(): Buffer; + /** + * Read a buffer with specified length. + * @param length specified length + */ + nextBuffer(length: number): Buffer; + /** + * Read next length of bytes as String, encoding default is 'utf8'. + * @param length length of the string to read + * @param encoding encoding of the string + */ + nextString(length: number, encoding?: string): string; + /** + * Read next bytes till the end of buffer as null-terminated string, encoding default is 'utf8'. + * @param encoding encoding of the string + */ + nextStringZero(encoding?: string): string; + /** + * Read next bytes as Int8, the value is just as the same format Buffer in nodejs doc. + */ + nextInt8(): number; + /** + * Read next bytes as UInt8, the value is just as the same format Buffer in nodejs doc. + */ + nextUInt8(): number; + /** + * Read next bytes as Int16LE, the value is just as the same format Buffer in nodejs doc. + */ + nextInt16LE(): number; + /** + * Read next bytes as UInt16LE, the value is just as the same format Buffer in nodejs doc. + */ + nextUInt16LE(): number; + /** + * Read next bytes as Int16BE, the value is just as the same format Buffer in nodejs doc. + */ + nextInt16BE(): number; + /** + * Read next bytes as UInt16BE, the value is just as the same format Buffer in nodejs doc. + */ + nextUInt16BE(): number; + /** + * Read next bytes as Int32LE, the value is just as the same format Buffer in nodejs doc. + */ + nextInt32LE(): number; + /** + * Read next bytes as UInt32LE, the value is just as the same format Buffer in nodejs doc. + */ + nextUInt32LE(): number; + /** + * Read next bytes as Int32BE, the value is just as the same format Buffer in nodejs doc. + */ + nextInt32BE(): number; + /** + * Read next bytes as UInt32BE, the value is just as the same format Buffer in nodejs doc. + */ + nextUInt32BE(): number; + /** + * Read next bytes as FloatLE, the value is just as the same format Buffer in nodejs doc. + */ + nextFloatLE(): number; + /** + * Read next bytes as FloatBE, the value is just as the same format Buffer in nodejs doc. + */ + nextFloatBE(): number; + /** + * Read next bytes as Double32LE, the value is just as the same format Buffer in nodejs doc. + */ + nextDouble32LE(): number; + /** + * Read next bytes as Double32BE, the value is just as the same format Buffer in nodejs doc. + */ + nextDouble32BE(): number; +} diff --git a/types/buffer-reader/tsconfig.json b/types/buffer-reader/tsconfig.json new file mode 100644 index 0000000000..da70d80fe1 --- /dev/null +++ b/types/buffer-reader/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "buffer-reader-tests.ts" + ] +} diff --git a/types/buffer-reader/tslint.json b/types/buffer-reader/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buffer-reader/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index c2e0d3161f..a8c7f403a7 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -6,7 +6,10 @@ import Redis = require("ioredis"); import Queue = require("bull"); const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379'); -const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object +const audioQueue = new Queue('audio transcoding', { + redis: {port: 6379, host: '127.0.0.1'}, // Specify Redis connection using object + settings: {}, +}); const imageQueue: Queue.Queue<{ image: string }> = new Queue('image transcoding'); videoQueue.process((job, done) => { diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index cdef279acb..ac820290f2 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -7,8 +7,11 @@ // Gabriel Terwesten // Oleg Repin // David Koblas +// Bond Akinmade +// Wuha Team +// Alec Brunelle // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as Redis from "ioredis"; import * as Promise from "bluebird"; @@ -82,6 +85,13 @@ declare namespace Bull { * Delay before processing next job in case of internal error */ retryProcessDelay?: number; + + /** + * Define a custom backoff strategy + */ + backoffStrategies?: { + [key: string]: (attemptsMade: number, err: typeof Error) => number; + }; } type DoneCallback = (error?: Error | null, value?: any) => void; @@ -142,6 +152,21 @@ declare namespace Bull { * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. */ promote(): Promise; + + /** + * The lock id of the job + */ + lockKey(): string; + + /** + * Releases the lock on the job. Only locks owned by the queue instance can be released. + */ + releaseLock(): Promise; + + /** + * Takes a lock for this job so that no other queue worker can process it at the same time. + */ + takeLock(): Promise; } type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; @@ -150,20 +175,15 @@ declare namespace Bull { /** * Backoff type, which can be either `fixed` or `exponential` */ - type: 'fixed' | 'exponential'; + type: string; /** * Backoff delay, in milliseconds */ - delay: number; + delay?: number; } interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - /** * Timezone */ @@ -180,6 +200,20 @@ declare namespace Bull { limit?: number; } + interface CronRepeatOptions extends RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + } + + interface EveryRepeatOptions extends RepeatOptions { + /** + * Repeat every millis (cron setting cannot be used together with this setting.) + */ + every: number; + } + interface JobOptions { /** * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). @@ -201,7 +235,7 @@ declare namespace Bull { /** * Repeat job according to a cron specification */ - repeat?: RepeatOptions; + repeat?: CronRepeatOptions | EveryRepeatOptions; /** * Backoff setting for automatic retries if the job fails @@ -467,7 +501,7 @@ declare namespace Bull { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: JobId): Promise>; + getJob(jobId: JobId): Promise | null>; /** * Returns a promise that will return an array with the waiting jobs between start and end. @@ -509,7 +543,7 @@ declare namespace Bull { * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones * used for the job when it was added. */ - removeRepeatable(repeat: RepeatOptions & { jobId?: JobId }): Promise; + removeRepeatable(repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; /** * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones @@ -517,7 +551,13 @@ declare namespace Bull { * * name: The name of the to be removed job */ - removeRepeatable(name: string, repeat: RepeatOptions & { jobId?: JobId }): Promise; + removeRepeatable(name: string, repeat: (CronRepeatOptions | EveryRepeatOptions) & { jobId?: JobId }): Promise; + + /** + * Returns a promise that will return an array of job instances of the given types. + * Optional parameters for range and ordering are provided. + */ + getJobs(types: string[], start?: number, end?: number, asc?: boolean): Promise; /** * Returns a promise that resolves with the job counts for the given queue. diff --git a/types/bull/tsconfig.json b/types/bull/tsconfig.json index 3ce6f08792..7dbd4e7b61 100644 --- a/types/bull/tsconfig.json +++ b/types/bull/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/bull/v2/index.d.ts b/types/bull/v2/index.d.ts index 3c89655101..4ea3f82df7 100644 --- a/types/bull/v2/index.d.ts +++ b/types/bull/v2/index.d.ts @@ -54,6 +54,24 @@ declare module "bull" { * since pubsub does not give any guarantees. */ finished(): Promise; + + /** + * Moves a job to the `completed` queue. Pulls a job from 'waiting' to + * 'active' and returns a tuple containing the next jobs data and id. If no + * job is in the `waiting` queue, returns null. + * @param returnValue The jobs success message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns Contains the next jobs data and id or null if job left in 'waiting' queue. + */ + moveToCompleted(returnValue: string, ignoreLock: boolean): Promise; + + /** + * Moves a job to the failed queue. + * @param errorInfo The jobs error message. + * @param ignoreLock True when wanting to ignore the redis lock on this job. + * @returns void + */ + moveToFailed(errorInfo: ErrorMessage, ignoreLock: boolean): Promise; } export interface Backoff { @@ -204,7 +222,7 @@ declare module "bull" { * Returns a promise that will return the job instance associated with the jobId parameter. * If the specified job cannot be located, the promise callback parameter will be set to null. */ - getJob(jobId: string): Promise; + getJob(jobId: string): Promise; /** * Tells the queue remove all jobs created outside of a grace period in milliseconds. @@ -217,6 +235,18 @@ declare module "bull" { * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned' */ on(eventName: string, callback: EventCallback): void; + + /** + * Moves the next job from 'waiting' to 'active'. + * Sets the processedOn timestamp to the current datetime. + * @param jobId If specified, will move a specific job from 'waiting' to 'active', + * @returns Returns the job moved from waiting to active queue. + */ + getNextJob:(jobId?: string) => Promise; + } + + interface ErrorMessage { + message: string; } interface EventCallback { diff --git a/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts b/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts index fc4518fa29..f6abd7e736 100644 --- a/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts +++ b/types/bunyan-winston-adapter/bunyan-winston-adapter-tests.ts @@ -1,7 +1,7 @@ import { createAdapter } from "bunyan-winston-adapter"; -import { Logger, LoggerInstance, transports } from "winston"; +import { createLogger } from "winston"; -const logger = new Logger(); +const logger = createLogger(); const mapping = { trace: 'silly' }; diff --git a/types/bunyan-winston-adapter/index.d.ts b/types/bunyan-winston-adapter/index.d.ts index 6798b8f1c9..718c9804e1 100644 --- a/types/bunyan-winston-adapter/index.d.ts +++ b/types/bunyan-winston-adapter/index.d.ts @@ -5,6 +5,6 @@ // TypeScript Version: 2.1 import * as bunyan from "bunyan"; -import { LoggerInstance } from "winston"; +import { Logger } from "winston"; -export function createAdapter(logger: LoggerInstance, mapping?: any): bunyan; +export function createAdapter(logger: Logger, mapping?: any): bunyan; diff --git a/types/bunyan-winston-adapter/package.json b/types/bunyan-winston-adapter/package.json new file mode 100644 index 0000000000..0aa4cf368f --- /dev/null +++ b/types/bunyan-winston-adapter/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "winston": "^3.0.0" + } +} diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index f2e630cd09..6d7ea67287 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -452,6 +452,7 @@ function gauge_examples() { max: 100, units: " %", width: 10, + fullCircle: true, } }); } diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 6c466458e3..0d94347ca3 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -276,6 +276,12 @@ export interface ChartConfiguration { * Set width of gauge chart. */ width?: number; + /** + * Whether this should be displayed + * as a full circle instead of a + * half circle. + */ + fullCircle?: boolean; }; spline?: { diff --git a/types/canvas-gauges/index.d.ts b/types/canvas-gauges/index.d.ts index e5b4f69047..3c3a617ed7 100644 --- a/types/canvas-gauges/index.d.ts +++ b/types/canvas-gauges/index.d.ts @@ -118,6 +118,8 @@ declare namespace CanvasGauges { barProgress?: boolean, barShadow?: number } + + export const GenericOptions: GenericOptions; export interface RadialGaugeOptions extends GenericOptions { ticksAngle?: number, diff --git a/types/capture-console/capture-console-tests.ts b/types/capture-console/capture-console-tests.ts new file mode 100644 index 0000000000..45dd3a7130 --- /dev/null +++ b/types/capture-console/capture-console-tests.ts @@ -0,0 +1,53 @@ +import * as captureconsole from "capture-console"; + +captureconsole.capture(process.stdout, () => { }); // $ExpectType string[] +captureconsole.capture(process.stdout, {}, () => { }); // $ExpectType string[] +captureconsole.capture(process.stdout, { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.capture([process.stdout, process.stdin], () => { }); // $ExpectType string[] +captureconsole.capture([process.stdout, process.stdin], {}, () => { }); // $ExpectType string[] +captureconsole.capture([process.stdout, process.stdin], { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.captureStderr(() => { }); // $ExpectType string +captureconsole.captureStderr({}, () => { }); // $ExpectType string +captureconsole.captureStderr({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.captureStdio(() => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.captureStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.captureStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; } + +captureconsole.captureStdout(() => { }); // $ExpectType string +captureconsole.captureStdout({}, () => { }); // $ExpectType string +captureconsole.captureStdout({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.hook(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean +captureconsole.hook(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean +captureconsole.hook(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean + +captureconsole.intercept(process.stdout, () => { }); // $ExpectType string[] +captureconsole.intercept(process.stdout, {}, () => { }); // $ExpectType string[] +captureconsole.intercept(process.stdout, { quiet: true }, () => { }); // $ExpectType string[] + +captureconsole.interceptStderr(() => { }); // $ExpectType string +captureconsole.interceptStderr({}, () => { }); // $ExpectType string +captureconsole.interceptStderr({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.interceptStdio(() => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.interceptStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; } +captureconsole.interceptStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; } + +captureconsole.interceptStdout(() => { }); // $ExpectType string +captureconsole.interceptStdout({}, () => { }); // $ExpectType string +captureconsole.interceptStdout({ quiet: true }, () => { }); // $ExpectType string + +captureconsole.startCapture(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean +captureconsole.startCapture(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean +captureconsole.startCapture(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean + +captureconsole.startIntercept(process.stdout, () => { }); // $ExpectType boolean +captureconsole.startIntercept(process.stdout, {}, () => { }); // $ExpectType boolean +captureconsole.startIntercept(process.stdout, { quiet: true }, () => { }); // $ExpectType boolean + +captureconsole.stopCapture(process.stdout); // $ExpectType boolean + +captureconsole.stopIntercept(process.stdout); // $ExpectType boolean diff --git a/types/capture-console/index.d.ts b/types/capture-console/index.d.ts new file mode 100644 index 0000000000..d3ebd914f9 --- /dev/null +++ b/types/capture-console/index.d.ts @@ -0,0 +1,190 @@ +// Type definitions for capture-console 1.0 +// Project: https://github.com/zackehh/capture-console +// Definitions by: Auston Zahrt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Options controlling behavior when capturing + */ +export interface CaptureOptions { + /** + * Option to silence the output going to the console + */ + quiet?: boolean; +} + +/** + * Executes the provided function with the output + * on the provided streams. + */ +export function capture( + streams: ReadonlyArray | NodeJS.WritableStream, + exec: () => void +): string[]; + +/** + * Executes the provided function with the output + * on the provided streams. Accepts options to silence + * the output going to the console. + */ +export function capture( + streams: ReadonlyArray | NodeJS.WritableStream, + opts: CaptureOptions, + exec: () => void +): string[]; + +/** + * Captures stderr for the provided execution scope. + */ +export function captureStderr(exec: () => void): string; + +/** + * Captures stderr for the provided execution scope. + */ +export function captureStderr(opts: CaptureOptions, exec: () => void): string; + +/** + * Captures stdout and stderr into an object for + * the provided execution scope. + */ +export function captureStdio(exec: () => void): { stdout: string; stderr: string; }; + +/** + * Captures stdout and stderr into an object for + * the provided execution scope. + */ +export function captureStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; }; + +/** + * Captures stdout for the provided execution scope. + */ +export function captureStdout(exec: () => void): string; + +/** + * Captures stdout for the provided execution scope. + */ +export function captureStdout(opts: CaptureOptions, exec: () => void): string; + +/** + * Listens to a provided stream, and executes the provided + * function for every write call. Accepts options to silence + * the output going to the console. + * + * Returns a function to call when you wish to stop listening + * to the call. + */ +export function hook( + stream: NodeJS.WritableStream, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): () => boolean; + +/** + * Listens to a provided stream, and executes the provided + * function for every write call. Accepts options to silence + * the output going to the console. + * + * Returns a function to call when you wish to stop listening + * to the call. + */ +export function hook( + stream: NodeJS.WritableStream, + opts: CaptureOptions, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): () => boolean; + +/** + * Delegate to #capture with a quiet passthrough. + */ +export function intercept(stream: NodeJS.WritableStream, exec: () => void): string[]; + +/** + * Delegate to #capture with a quiet passthrough. + */ +export function intercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): string[]; + +/** + * Delegate to #captureStderr with a quiet passthrough. + */ +export function interceptStderr(exec: () => void): string; + +/** + * Delegate to #captureStderr with a quiet passthrough. + */ +export function interceptStderr(opts: CaptureOptions, exec: () => void): string; + +/** + * Delegate to #captureStdio with a quiet passthrough. + */ +export function interceptStdio(exec: () => void): { stdout: string; stderr: string; }; + +/** + * Delegate to #captureStdio with a quiet passthrough. + */ +export function interceptStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; }; + +/** + * Delegate to #captureStdout with a quiet passthrough. + */ +export function interceptStdout(exec: () => void): string; + +/** + * Delegate to #captureStdout with a quiet passthrough. + */ +export function interceptStdout(opts: CaptureOptions, exec: () => void): string; + +/** + * Starts a capture on the provided stream using the + * provided options and stream execution. + */ +export function startCapture( + stream: NodeJS.WritableStream, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): boolean; + +/** + * Starts a capture on the provided stream using the + * provided options and stream execution. + */ +export function startCapture( + stream: NodeJS.WritableStream, + opts: CaptureOptions, + exec: ( + string: string, + encoding?: string, + fd?: (error?: any) => void + ) => void +): boolean; + +/** + * Delegate to #startCapture with a quiet passthrough. + */ +export function startIntercept(stream: NodeJS.WritableStream, exec: () => void): boolean; + +/** + * Delegate to #startCapture with a quiet passthrough. + */ +export function startIntercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): boolean; + +/** + * Stops a capture on the provided stream. + */ +export function stopCapture(stream: NodeJS.WritableStream): boolean; + +/** + * Delegate to #stopCapture with a quiet passthrough. + */ +export function stopIntercept(stream: NodeJS.WritableStream): boolean; diff --git a/types/capture-console/tsconfig.json b/types/capture-console/tsconfig.json new file mode 100644 index 0000000000..01807d6e22 --- /dev/null +++ b/types/capture-console/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "capture-console-tests.ts" + ] +} \ No newline at end of file diff --git a/types/capture-console/tslint.json b/types/capture-console/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/capture-console/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/catbox-redis/catbox-redis-tests.ts b/types/catbox-redis/catbox-redis-tests.ts new file mode 100644 index 0000000000..d7fb5eb701 --- /dev/null +++ b/types/catbox-redis/catbox-redis-tests.ts @@ -0,0 +1,12 @@ +import * as CatbotRedis from 'catbox-redis'; + +const cache = new CatbotRedis({ + host: 'localhost', + partition: 'test', + port: 2018, +}); + +cache.get({ + segment: 'test', + id: 'test', +}); diff --git a/types/catbox-redis/index.d.ts b/types/catbox-redis/index.d.ts new file mode 100644 index 0000000000..a0d3590953 --- /dev/null +++ b/types/catbox-redis/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for catbox-redis 4.1 +// Project: https://github.com/hapijs/catbox-redis#readme +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +// tslint:disable-next-line +declare module 'catbox-redis' { + import { Redis } from 'ioredis'; + import { EnginePrototype, ClientOptions, Client } from 'catbox'; + namespace CatboxRedis { + interface CatboxRedisOptions extends ClientOptions { + /** + * Raw client. + */ + client?: Redis; + /** + * the Redis server URL (if url is provided, host, port, and socket are ignored) + */ + url?: string; + /** + * the Redis server hostname. + * Defaults to '127.0.0.1'. + */ + host?: string; + /** + * the Redis server port or unix domain socket path. + * Defaults to 6379. + */ + port?: number; + /** + * the unix socket string to connect to (if socket is provided, host and port are ignored) + */ + socket?: string; + /** + * the Redis authentication password when required. + */ + password?: string; + /** + * the Redis database. + */ + database?: string; + /** + * an array of redis sentinel addresses to connect to. + */ + sentinels?: Array<{ + host: string; + }>; + /** + * the name of the sentinel master. + * (Only needed when sentinels is specified) + */ + sentinelName?: string; + } + } + class CatboxRedis extends Client { + constructor(options: CatboxRedis.CatboxRedisOptions); + } + export = CatboxRedis; + } diff --git a/types/catbox-redis/tsconfig.json b/types/catbox-redis/tsconfig.json new file mode 100644 index 0000000000..2d31a4bc59 --- /dev/null +++ b/types/catbox-redis/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "catbox-redis-tests.ts" + ] +} diff --git a/types/catbox-redis/tslint.json b/types/catbox-redis/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/catbox-redis/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index 6d51e48696..f6881b1aef 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -112,6 +112,9 @@ export interface CachedObject { export type CacheItem = any; export interface ClientOptions { + /** + * this will store items under keys that start with this value. + */ partition: string; } diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 21b80f7d05..3ea9745ebd 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for cesium 1.44 +// Type definitions for cesium 1.47 // Project: http://cesiumjs.org // Definitions by: Aigars Zeiza // Harry Nicholls // Jared Szechy +// Radek Goláň jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1437,10 +1438,10 @@ declare namespace Cesium { } class TerrainData { + credits: Credit[]; waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; - createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; wasCreatedByUpsampling(): boolean; } @@ -1459,7 +1460,7 @@ declare namespace Cesium { } abstract class TerrainProvider { - availability: any; // TileAvailability + availability: TileAvailability; credit: Credit; errorEvent: Event; hasVertexNormals: boolean; @@ -1475,6 +1476,15 @@ declare namespace Cesium { requestTileGeometry(x: number, y: number, level: number, throttleRequests?: boolean): Promise; } + class TileAvailability { + constructor(tilingScheme: TilingScheme, maximumLevel: number); + addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void; + computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number; + computeChildMaskForTile(level: number, x: number, y: number): number; + computeMaximumLevelAtPosition(position: Cartographic): number; + isTileAvailable(level: number, x: number, y: number): boolean; + } + class TileProviderError { provider: ImageryProvider | TerrainProvider; message: string; @@ -1925,15 +1935,15 @@ declare namespace Cesium { semiMinorAxis: Property; rotation: Property; show: Property; - material: MaterialProperty; + material: MaterialProperty | Color; height: Property; extrudedHeight: Property; granularity: Property; stRotation: Property; - fill: Property; - outline: Property; - outlineColor: Property; - outlineWidth: Property; + fill: boolean; + outline: boolean; + outlineColor: Color; + outlineWidth: number; numberOfVerticalLines: Property; constructor(options?: { semiMajorAxis?: number; @@ -1941,11 +1951,11 @@ declare namespace Cesium { height?: Property; extrudedHeight?: Property; show?: Property; - fill?: Property; - material?: MaterialProperty; - outline?: Property; - outlineColor?: Property; - outlineWidth?: Property; + fill?: boolean; + material?: MaterialProperty | Color + outline?: boolean; + outlineColor?: Color; + outlineWidth?: number; numberOfVerticalLines?: Property; rotation?: Property; stRotation?: Property; @@ -2197,11 +2207,11 @@ declare namespace Cesium { class LabelGraphics { definitionChanged: Event; text: Property; - font: Property; + font: string; style: Property; - fillColor: Property; - outlineColor: Property; - outlineWidth: Property; + fillColor: Color; + outlineColor: Color; + outlineWidth: number; horizontalOrigin: Property; verticalOrigin: Property; eyeOffset: Property; @@ -2212,11 +2222,11 @@ declare namespace Cesium { pixelOffsetScaleByDistance: Property; constructor(options?: { text?: Property; - font?: Property; + font?: string; style?: Property; - fillColor?: Property; - outlineColor?: Property; - outlineWidth?: Property; + fillColor?: Color; + outlineColor?: Color; + outlineWidth?: number; show?: Property; scale?: Property; horizontalOrigin?: Property; @@ -2352,16 +2362,16 @@ declare namespace Cesium { class PolygonGraphics { definitionChanged: Event; show: Property; - material: MaterialProperty; + material: MaterialProperty | Color; positions: Property; hierarchy: Property; height: Property; extrudedHeight: Property; granularity: Property; stRotation: Property; - fill: Property; + fill: boolean; outline: Property; - outlineColor: Property; + outlineColor: Color; outlineWidth: Property; perPositionHeight: Property; constructor(options?: { @@ -2369,10 +2379,10 @@ declare namespace Cesium { height?: number; extrudedHeight?: Property; show?: Property; - fill?: Property; - material?: MaterialProperty; + fill?: boolean; + material?: MaterialProperty | Color; outline?: boolean; - outlineColor?: Property; + outlineColor?: Color; outlineWidth?: number; stRotation?: Property; granularity?: Property; @@ -3007,23 +3017,84 @@ declare namespace Cesium { destroy(): void; } + class GoogleEarthEnterpriseMetadata { + imageryPresent: boolean; + key: ArrayBuffer; + negativeAltitudeExponentBias: number; + negativeAltitudeThreshold: number; + protoImagery: boolean; + readonly proxy: Proxy; + readonly readyPromise: Promise; + readonly resource: Resource; + terrainPresent: boolean; + readonly url: string; + constructor(resourceOrUrl: Resource | string); + static quadKeyToTileXY(quadkey: string): {x: number, y: number, level: number}; + static tileXYToQuadKey(x: number, y: number, level: number): string; + } + class GoogleEarthEnterpriseImageryProvider extends ImageryProvider { - url: string; - path: string; - channel: number; - version: number; - requestType: string; + readonly url: string; constructor(options: { - url: string; + url: Resource | string; + metadata: GoogleEarthEnterpriseMetadata; + ellipsoid?: Ellipsoid; + tileDiscardPolicy?: TileDiscardPolicy; + credit?: Credit | string; + }); + } + + class GoogleEarthEnterpriseMapsProvider extends ImageryProvider { + readonly channel: number; + readonly path: string; + readonly requestType: string; + readonly url: string; + readonly version: number; + static logoUrl: string; + constructor(options: { + url: Resource | string; channel: number; path?: string; maximumLevel?: number; tileDiscardPolicy?: TileDiscardPolicy; ellipsoid?: Ellipsoid; - proxy?: Proxy }); } + class GoogleEarthEnterpriseTerrainData extends TerrainData { + constructor(options: { + buffer: ArrayBuffer; + negativeAltitudeExponentBias: number; + negativeElevationThreshold: number; + childTileMask?: number; + createdByUpsampling?: boolean; + credits?: Credit[]; + }); + } + + class GoogleEarthEnterpriseTerrainProvider { + static heightmapTerrainQuality: number; + availability: TileAvailability; + credit: Credit; + errorEvent: Event; + hasVertexNormals: boolean; + hasWaterMask: boolean; + ready: boolean; + readonly readyPromise: Promise; + tilingScheme: TilingScheme; + constructor(options: { + url: Resource | string; + metadata: GoogleEarthEnterpriseMetadata; + ellipsoid?: Ellipsoid; + credit?: Credit | string; + }) + static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; + static getRegularGridIndices(width: number, height: number): Uint16Array; + getLevelMaximumGeometricError(level: number): number; + getTileDataAvailable(x: number, y: number, level: number): boolean; + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise; + } + class GridImageryProvider extends ImageryProvider { constructor(options?: { tilingScheme?: TilingScheme; @@ -3522,7 +3593,7 @@ declare namespace Cesium { cull?: boolean; asynchronous?: boolean; debugShowBoundingVolume?: boolean; - shadows: ShadowMode + shadows?: ShadowMode }); destroy(): void; getGeometryInstanceAttributes(id: any): any; diff --git a/types/chai-datetime/chai-datetime-tests.ts b/types/chai-datetime/chai-datetime-tests.ts index 255d816b5a..f955e78e27 100644 --- a/types/chai-datetime/chai-datetime-tests.ts +++ b/types/chai-datetime/chai-datetime-tests.ts @@ -3,47 +3,65 @@ import chai = require('chai'); import chaiDateTime = require('chai-datetime'); chai.use(chaiDateTime); -var expect = chai.expect; -var assert = chai.assert; +const expect = chai.expect; +const assert = chai.assert; function test_equalTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.equalTime(date); date.should.equalTime(date); assert.equalTime(date, date); } function test_beforeTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.beforeTime(date); date.should.be.beforeTime(date); assert.beforeTime(date, date); } function test_afterTime(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.afterTime(date); date.should.be.afterTime(date); assert.afterTime(date, date); } +function test_withinTime(){ + const date: Date = new Date(2014, 7, 1); + const fromDate: Date = new Date(2014, 1, 1); + const toDate: Date = new Date(2015, 1, 1); + expect(date).to.be.withinTime(fromDate, toDate); + date.should.be.withinTime(fromDate, toDate); + assert.withinTime(date, fromDate, toDate); +} + function test_equalDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.equalDate(date); date.should.equalDate(date); assert.equalDate(date, date); } function test_beforeDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.beforeDate(date); date.should.be.beforeDate(date); assert.beforeDate(date, date); } function test_afterDate(){ - var date: Date = new Date(2014, 1, 1); + const date: Date = new Date(2014, 1, 1); expect(date).to.be.afterDate(date); date.should.be.afterDate(date); assert.afterDate(date, date); } + +function test_withinDate(){ + const date: Date = new Date(2014, 7, 1); + const fromDate: Date = new Date(2014, 1, 1); + const toDate: Date = new Date(2015, 1, 1); + expect(date).to.be.withinDate(fromDate, toDate); + date.should.be.withinDate(fromDate, toDate); + assert.withinDate(date, fromDate, toDate); +} diff --git a/types/chai-datetime/index.d.ts b/types/chai-datetime/index.d.ts index 176d112dc0..be623a05d4 100644 --- a/types/chai-datetime/index.d.ts +++ b/types/chai-datetime/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for chai-datetime // Project: https://github.com/gaslight/chai-datetime.git -// Definitions by: Cliff Burger +// Definitions by: Cliff Burger , +// Matt Bishop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -14,9 +15,11 @@ declare global { afterDate(date: Date): Assertion; beforeDate(date: Date): Assertion; equalDate(date: Date): Assertion; + withinDate(dateFrom: Date, dateTo: Date): Assertion; afterTime(date: Date): Assertion; beforeTime(date: Date): Assertion; equalTime(date: Date): Assertion; + withinTime(dateFrom: Date, dateTo: Date): Assertion; } interface Assert { @@ -26,12 +29,16 @@ declare global { notBeforeTime(val: Date, exp: Date, msg?: string): void; afterTime(val: Date, exp: Date, msg?: string): void; notAfterTime(val: Date, exp: Date, msg?: string): void; + withinTime(val: Date, expFrom: Date, expTo: Date, msg?: string): void; + notWithinTime(val: Date, expFrom: Date, expTo: Date, msg?: string): void; equalDate(val: Date, exp: Date, msg?: string): void; notEqualDate(val: Date, exp: Date, msg?: string): void; beforeDate(val: Date, exp: Date, msg?: string): void; notBeforeDate(val: Date, exp: Date, msg?: string): void; afterDate(val: Date, exp: Date, msg?: string): void; notAfterDate(val: Date, exp: Date, msg?: string): void; + withinDate(val: Date, expFrom: Date, expTo: Date, msg?: string): void; + notWithinDate(val: Date, expFrom: Date, expTo: Date, msg?: string): void; } } diff --git a/types/chai-enzyme/index.d.ts b/types/chai-enzyme/index.d.ts index 413f5ec545..783b7fce2f 100644 --- a/types/chai-enzyme/index.d.ts +++ b/types/chai-enzyme/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/producthunt/chai-enzyme // Definitions by: Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/chai-http/chai-http-tests.ts b/types/chai-http/chai-http-tests.ts index 882f089a47..37a4df794e 100644 --- a/types/chai-http/chai-http-tests.ts +++ b/types/chai-http/chai-http-tests.ts @@ -84,6 +84,10 @@ chai.request(app) .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)) .catch((err: any) => { throw err; }); +chai.request(app) + .keepOpen() + .close((err: any) => { throw err; }); + const agent = chai.request.agent(app); agent @@ -97,6 +101,8 @@ agent .then((res: ChaiHttp.Response) => chai.expect(res).to.have.status(200)); }); +agent.close((err: any) => { throw err; }); + function test1() { const req = chai.request(app).get('/'); req.then((res: ChaiHttp.Response) => { diff --git a/types/chai-http/index.d.ts b/types/chai-http/index.d.ts index 77c711cb7f..de3caa13e7 100644 --- a/types/chai-http/index.d.ts +++ b/types/chai-http/index.d.ts @@ -64,6 +64,8 @@ declare global { del(url: string, callback?: (err: any, res: Response) => void): request.Request; options(url: string, callback?: (err: any, res: Response) => void): request.Request; patch(url: string, callback?: (err: any, res: Response) => void): request.Request; + keepOpen(): Agent; + close(callback?: (err: any) => void): Agent; } interface TypeComparison { diff --git a/types/chai-roughly/chai-roughly-tests.ts b/types/chai-roughly/chai-roughly-tests.ts new file mode 100644 index 0000000000..20ef05e293 --- /dev/null +++ b/types/chai-roughly/chai-roughly-tests.ts @@ -0,0 +1,15 @@ +import chai = require('chai'); +import chaiOequal = require('chai-roughly'); + +chai.use(chaiOequal); + +import { + expect, + assert +} from 'chai'; + +expect(1.2).to.be.roughly().equal(1.1999999999); +expect(1.2).to.roughly().equal(1.1999999999); +expect(1.2).to.roughly(0.1).equal(1.1); +expect(1.2).to.roughly(0.1).deep.equal(1.1); +expect(1.2).to.roughly.equal(1.1999999999999999999); diff --git a/types/chai-roughly/index.d.ts b/types/chai-roughly/index.d.ts new file mode 100644 index 0000000000..c1f162ddb7 --- /dev/null +++ b/types/chai-roughly/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for chai-roughly 1.0 +// Project: https://github.com/Turbo87/chai-roughly#readme +// Definitions by: Tomasz Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +declare global { + namespace Chai { + // For BDD APIs + interface Roughly extends Assertion { + (tolerance?: number): Assertion; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + roughly: Roughly; + } + + // For Assert APIs + interface Assert { + roughly: Roughly; + } + } +} + +declare function chaiRoughly(chai: any, utils: any): void; +declare namespace chaiRoughly { } +export = chaiRoughly; diff --git a/types/chai-roughly/tsconfig.json b/types/chai-roughly/tsconfig.json new file mode 100644 index 0000000000..7cca2313fc --- /dev/null +++ b/types/chai-roughly/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-roughly-tests.ts" + ] +} diff --git a/types/chai-roughly/tslint.json b/types/chai-roughly/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-roughly/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chai-spies/chai-spies-tests.ts b/types/chai-spies/chai-spies-tests.ts index f5247ba13f..7bc9530164 100644 --- a/types/chai-spies/chai-spies-tests.ts +++ b/types/chai-spies/chai-spies-tests.ts @@ -24,7 +24,12 @@ let array = [ 1, 2, 3 ]; chai.spy.on(array, 'push'); // or you can track multiple object's methods -chai.spy.on(array, 'push', 'pop'); +chai.spy.on(array, ['push', 'pop']); + +// or you can track multiple object's methods +chai.spy.on(array, 'push', function(item) { + array.push(item); +}); array.push(5); @@ -149,4 +154,20 @@ spy.should.not.have.been.called.above(3); expect(spy).to.have.been.called.below(3); expect(spy).to.not.have.been.called.lt(3); spy.should.have.been.called.lt(3); -spy.should.not.have.been.called.below(3); \ No newline at end of file +spy.should.not.have.been.called.below(3); + +// You can also create sandbox +let sb = chai.spy.sandbox(); + +sb.on(array, 'pop', () => { + return 1; +}) + +let one = array.pop(); +expect(one).to.equal(1); + +// Can restore methods in sandbox +sb.restore(); +array.push(2); +let two = array.pop(); +expect(two).to.equal(2); diff --git a/types/chai-spies/index.d.ts b/types/chai-spies/index.d.ts index 75f702ca37..bb37fa8cd4 100644 --- a/types/chai-spies/index.d.ts +++ b/types/chai-spies/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for chai-spies +// Type definitions for chai-spies 1.0.0 // Project: https://github.com/chaijs/chai-spies // Definitions by: Ilya Kuznetsov +// Harm van der Werf +// Jouni Suorsa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -21,7 +23,7 @@ declare namespace Chai { * ```ts * expect(spy).to.be.spy; * spy.should.be.spy; - * ``` + * ``` */ spy: Assertion; @@ -32,7 +34,7 @@ declare namespace Chai { * expect(spy).to.have.been.called(); * spy.should.have.been.called(); * ``` - * Note that ```called``` can be used as a chainable method. + * Note that ```called``` can be used as a chainable method. */ called: ChaiSpies.Called; @@ -61,7 +63,32 @@ declare namespace Chai { } declare namespace ChaiSpies { + interface Sandbox { + /** + * #### chai.spy.on (function) + * + * Wraps an object method into spy. All calls will pass through to the original function. + * + * @param {Object} object + * @param {String} methodNames names to spy on + * @param {function} fn replacement function + * @returns function to actually call + */ + on(object: Object, methodNames: string | string[], fn?: (parameters: any[]|any) => any): any; + /** + * #### chai.spy.restore (function) + * + * Restores previously wrapped object's method. + * Restores all spied objects of a sandbox if called without parameters. + * + * @function + * @param {Object} [object] + * @param {String|String[]} [methods] name or names + * @return {Sandbox} Sandbox instance + */ + restore(object?: Object, methodNames?: string | string[]): void; + } interface Spy { /** * #### chai.spy (function) @@ -72,9 +99,9 @@ declare namespace ChaiSpies { * var spy = chai.spy(original) * , e_spy = chai.spy(); * ``` - * @param fn function to spy on. @default ```function () {}``` + * @param fn function to spy on. @default ```function () {}``` * @returns function to actually call - */ + */ (): SpyFunc0Proxy; (fn: SpyFunc0): SpyFunc0Proxy; (fn: SpyFunc1): SpyFunc1Proxy; @@ -107,10 +134,11 @@ declare namespace ChaiSpies { * var spy = chai.spy.on(Array, 'isArray'); * ``` * @param {Object} object - * @param {String} method name to spy on + * @param {String} method names to spy on + * @param {function} fn replacement function * @returns function to actually call - */ - on(object: Object, ...methodNames: string[]): any; + */ + on(object: Object, methodNames: string | string[], fn?: (parameters: any[]|any) => any): any; /** * #### chai.spy.object (function) @@ -123,10 +151,24 @@ declare namespace ChaiSpies { * @param {String[]|Object} method names or method definitions * @returns object with spied methods */ - object(name: string, methods: string[]): any; - object(methods: string[]): any; - object(name: string, methods: T): T; - object(methods: T): T; + object(name: string, methods: string[]): any; + object(methods: string[]): any; + object(name: string, methods: T): T; + object(methods: T): T; + + /** + * #### chai.spy.restore (function) + * + * Restores spy assigned to DEFAULT sandbox + * + * Restores previously wrapped object's method. + * Restores all spied objects of a sandbox if called without parameters. + * + * @param {Object} [object] + * @param {String|String[]} [methods] name or names + * @return {Sandbox} Sandbox instance + */ + restore(object?: Object, methodNames?: string | string[]): void; /** * #### chai.spy.returns (function) @@ -141,6 +183,18 @@ declare namespace ChaiSpies { */ returns(value: T): SpyFunc0Proxy; + + /** + * ### chai.spy.sandbox + * + * Creates a sandbox. + * + * Sandbox is a set of spies. + * Sandbox allows to track methods on objects and restore original methods with on restore call. + * + * @returns {Sandbox} + */ + sandbox(): Sandbox; } interface Called { @@ -158,12 +212,12 @@ declare namespace ChaiSpies { * spy.should.not.have.been.called.once; * ``` */ - once: Chai.Assertion; + once: Chai.Assertion; /** * ####.twice * Assert that a spy has been called exactly twice. - * ```ts + * ```ts * expect(spy).to.have.been.called.twice; * expect(spy).to.not.have.been.called.twice; * spy.should.have.been.called.twice; @@ -215,7 +269,7 @@ declare namespace ChaiSpies { * ```ts * expect(spy).to.have.been.called.above(3); * spy.should.not.have.been.called.above(3); - * ``` + * ``` */ above(n: number): Chai.Assertion; @@ -225,7 +279,7 @@ declare namespace ChaiSpies { * ```ts * expect(spy).to.have.been.called.gt(3); * spy.should.not.have.been.called.gt(3); - * ``` + * ``` */ gt(n: number): Chai.Assertion; @@ -235,7 +289,7 @@ declare namespace ChaiSpies { * ```ts * expect(spy).to.have.been.called.below(3); * spy.should.not.have.been.called.below(3); - * ``` + * ``` */ below(n: number): Chai.Assertion; @@ -245,7 +299,7 @@ declare namespace ChaiSpies { * ```ts * expect(spy).to.have.been.called.lt(3); * spy.should.not.have.been.called.lt(3); - * ``` + * ``` */ lt(n: number): Chai.Assertion; } @@ -301,7 +355,7 @@ declare namespace ChaiSpies { * spy.should.have.been.called.with('foo'); * ``` * Will also pass for ```spy('foo', 'bar')``` and ```spy(); spy('foo')```. - * If used with multiple arguments, assert that a spy has been called with all the given arguments at least once. + * If used with multiple arguments, assert that a spy has been called with all the given arguments at least once. * ```ts * spy('foo', 'bar', 1); * expect(spy).to.have.been.called.with('bar', 'foo'); @@ -389,7 +443,7 @@ declare namespace ChaiSpies { * * Resets __spy object parameters for instantiation and reuse * @returns proxy spy object - */ + */ reset(): this; } @@ -397,77 +451,77 @@ declare namespace ChaiSpies { (): R; } - interface SpyFunc1 { - (a: A1): R; + interface SpyFunc1 { + (a: A1): R; } - interface SpyFunc2 { - (a: A1, b: A2): R; + interface SpyFunc2 { + (a: A1, b: A2): R; } - interface SpyFunc3 { - (a: A1, b: A2, c: A3): R; + interface SpyFunc3 { + (a: A1, b: A2, c: A3): R; } - interface SpyFunc4 { - (a: A1, b: A2, c: A3, d: A4): R; + interface SpyFunc4 { + (a: A1, b: A2, c: A3, d: A4): R; } - interface SpyFunc5 { - (a: A1, b: A2, c: A3, d: A4, e: A5): R; + interface SpyFunc5 { + (a: A1, b: A2, c: A3, d: A4, e: A5): R; } - interface SpyFunc6 { - (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6): R; + interface SpyFunc6 { + (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6): R; } - interface SpyFunc7 { - (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7): R; + interface SpyFunc7 { + (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7): R; } - interface SpyFunc8 { - (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8): R; + interface SpyFunc8 { + (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8): R; } - - interface SpyFunc9 { - (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9): R; + + interface SpyFunc9 { + (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9): R; } - - interface SpyFunc10 { - (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9, j: A10): R; + + interface SpyFunc10 { + (a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9, j: A10): R; } interface SpyFunc0Proxy extends SpyFunc0, Resetable { } - interface SpyFunc1Proxy extends SpyFunc1, Resetable { + interface SpyFunc1Proxy extends SpyFunc1, Resetable { } - interface SpyFunc2Proxy extends SpyFunc2, Resetable { + interface SpyFunc2Proxy extends SpyFunc2, Resetable { } - interface SpyFunc3Proxy extends SpyFunc3, Resetable { + interface SpyFunc3Proxy extends SpyFunc3, Resetable { } - interface SpyFunc4Proxy extends SpyFunc4, Resetable { + interface SpyFunc4Proxy extends SpyFunc4, Resetable { } - interface SpyFunc5Proxy extends SpyFunc5, Resetable { + interface SpyFunc5Proxy extends SpyFunc5, Resetable { } - interface SpyFunc6Proxy extends SpyFunc6, Resetable { + interface SpyFunc6Proxy extends SpyFunc6, Resetable { } - interface SpyFunc7Proxy extends SpyFunc7, Resetable { + interface SpyFunc7Proxy extends SpyFunc7, Resetable { } - interface SpyFunc8Proxy extends SpyFunc8, Resetable { + interface SpyFunc8Proxy extends SpyFunc8, Resetable { } - - interface SpyFunc9Proxy extends SpyFunc9, Resetable { + + interface SpyFunc9Proxy extends SpyFunc9, Resetable { } - - interface SpyFunc10Proxy extends SpyFunc10, Resetable { + + interface SpyFunc10Proxy extends SpyFunc10, Resetable { } } diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index f19514fe71..2c81c42aeb 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -1361,6 +1361,39 @@ suite('assert', () => { assert.notDeepEqual(circularObject, secondCircularObject); }); + test('deepStrictEqual', () => { + assert.deepStrictEqual({tea: 'chai'}, {tea: 'chai'}); + assert.throws(() => assert.deepStrictEqual({tea: 'chai'}, {tea: 'black'})); + + const obja = Object.create({tea: 'chai'}); + const objb = Object.create({tea: 'chai'}); + + assert.deepStrictEqual(obja, objb); + + const obj1 = Object.create({tea: 'chai'}); + const obj2 = Object.create({tea: 'black'}); + + assert.throws(() => assert.deepStrictEqual(obj1, obj2)); + }); + + test('deepStrictEqual (ordering)', () => { + const a = {a: 'b', c: 'd'}; + const b = {c: 'd', a: 'b'}; + assert.deepStrictEqual(a, b); + }); + + test('deepStrictEqual (circular)', () => { + const circularObject: any = {}; + const secondCircularObject: any = {}; + circularObject.field = circularObject; + secondCircularObject.field = secondCircularObject; + + assert.deepStrictEqual(circularObject, secondCircularObject); + + secondCircularObject.field2 = secondCircularObject; + assert.deepStrictEqual(circularObject, secondCircularObject); + }); + test('isNull', () => { assert.isNull(null); assert.isNull(undefined); diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index d0f5ab099c..d260973b71 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -353,7 +353,7 @@ declare namespace Chai { notStrictEqual(actual: T, expected: T, message?: string): void; /** - * Asserts that actual is deeply equal to expected. + * Asserts that actual is deeply equal (==) to expected. * * @type T Type of the objects. * @param actual Actual value. @@ -363,7 +363,7 @@ declare namespace Chai { deepEqual(actual: T, expected: T, message?: string): void; /** - * Asserts that actual is not deeply equal to expected. + * Asserts that actual is not deeply equal (==) to expected. * * @type T Type of the objects. * @param actual Actual value. @@ -372,6 +372,16 @@ declare namespace Chai { */ notDeepEqual(actual: T, expected: T, message?: string): void; + /** + * Asserts that actual is deeply strict equal (===) to expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + deepStrictEqual(actual: T, expected: T, message?: string): void; + /** * Asserts valueToCheck is strictly greater than (>) valueToBeAbove. * diff --git a/types/chai/tslint.json b/types/chai/tslint.json index f99183c97d..e6f749320f 100644 --- a/types/chai/tslint.json +++ b/types/chai/tslint.json @@ -9,6 +9,7 @@ "no-redundant-jsdoc-2": false, "no-single-declare-module": false, "no-unnecessary-generics": false, - "strict-export-declare-modifiers": false + "strict-export-declare-modifiers": false, + "use-default-type-parameter": false } } diff --git a/types/chance/chance-tests.ts b/types/chance/chance-tests.ts index 00d8752118..238fd97cf3 100644 --- a/types/chance/chance-tests.ts +++ b/types/chance/chance-tests.ts @@ -71,3 +71,18 @@ euro = chance.euro({opt: 'abc'}); let coin = chance.coin(); coin = chance.coin(); + +// Make sure date works with min and max parameters +let date: string|Date = chance.date(); + +let min = new Date(); +let max = new Date(); +date = chance.date({min, max}); + +min = new Date(); +min.setFullYear(new Date().getFullYear() - 15); +max = new Date(); +max.setFullYear(new Date().getFullYear() + 15); +date = chance.date({min, max}); +date = chance.date({min}); +date = chance.date({max}); diff --git a/types/chance/index.d.ts b/types/chance/index.d.ts index 07418e45be..17708acc5a 100644 --- a/types/chance/index.d.ts +++ b/types/chance/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chance 1.0.13 +// Type definitions for Chance 1.0.16 // Project: http://chancejs.com // Definitions by: Chris Bowdon // Brice BERNARD @@ -189,6 +189,8 @@ declare namespace Chance { year?: number; month?: number; day?: number; + min?: Date; + max?: Date; } interface Month { diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index d0f6ebc684..36f25643d9 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -1,18 +1,24 @@ -import { Chart, ChartData, Point } from 'chart.js'; +import { Chart, ChartData, Point } from "chart.js"; // alternative: // import chartjs = require('chart.js'); // => chartjs.Chart +const plugin = { + afterDraw: (chartInstance: Chart, easing: string, options?: any) => { + } +}; + const chart: Chart = new Chart(new CanvasRenderingContext2D(), { - type: 'bar', + type: "bar", + plugins: [plugin, plugin], data: { - labels: ['group 1'], + labels: ["group 1"], datasets: [ { - backgroundColor: '#000000', + backgroundColor: "#000000", borderWidth: 1, - label: 'test', + label: "test", data: [1] } ] @@ -22,7 +28,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { intersect: true }, onHover(ev: MouseEvent, points: any[]) { - return; + return; }, title: { text: ["foo", "bar"] @@ -35,21 +41,23 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { caretPadding: 2, displayColors: true, borderColor: "rgba(0,0,0,0)", - borderWidth: 1, + borderWidth: 1 }, scales: { - xAxes: [{ - ticks: { - callback: Math.floor - }, - gridLines: { - display: false, - borderDash: [5, 15], - borderDashOffset: 2, - zeroLineBorderDash: [5, 15], - zeroLineBorderDashOffset: 2 + xAxes: [ + { + ticks: { + callback: Math.floor + }, + gridLines: { + display: false, + borderDash: [5, 15], + borderDashOffset: 2, + zeroLineBorderDash: [5, 15], + zeroLineBorderDashOffset: 2 + } } - }] + ] }, legend: { display: true, @@ -58,11 +66,13 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { padding: 40 } }, - devicePixelRatio: 2, + devicePixelRatio: 2 } }); chart.update(); +console.log(chart.getDatasetMeta(0)); + console.log(chart.ctx && chart.ctx.font); console.log(chart.canvas && chart.canvas.tagName); if (chart.chartArea) { @@ -72,6 +82,54 @@ if (chart.chartArea) { console.log(chart.chartArea.left); } +// Testing radial chart +const tickOptions: Chart.LinearTickOptions = { + max: 100, + stepSize: 33, + display: false, + beginAtZero: true +}; +const scaleOptions: Chart.RadialLinearScale = { + ticks: tickOptions, + lineArc: false, + display: false, + scaleLabel: { + display: false + }, +}; +const radarChartOptions: Chart.RadialChartOptions = { + legend: {display: false}, + scale: scaleOptions, + responsive: true, +}; +const chartConfig: Chart.ChartConfiguration = { + type: 'radar', + data: { + labels: ['#apples', '#pears', '#apricots', '#acorns', '#amigas', "#orics"], + datasets: [{ + label: "test", + lineTension: 0.15, + data: [1, 1, 2, 3, 5], + backgroundColor: '#37738353', + borderColor: '#37738353', + borderWidth: 3, + fill: true + }] + }, + options: radarChartOptions +}; +const radialChart: Chart = new Chart(new CanvasRenderingContext2D(), chartConfig); +radialChart.update(); + +console.log(radialChart.ctx && radialChart.ctx.font); +console.log(radialChart.canvas && radialChart.canvas.tagName); +if (radialChart.chartArea) { + console.log(radialChart.chartArea.top); + console.log(radialChart.chartArea.right); + console.log(radialChart.chartArea.bottom); + console.log(radialChart.chartArea.left); +} + // http://www.chartjs.org/docs/latest/configuration/tooltip.html#position-modes Chart.Tooltip.positioners.custom = (elements: any[], eventPosition: Point) => { return { diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index cb3db72855..4e82fb9ff5 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -12,6 +12,9 @@ // Simon Archer // Ken Elkabany // Slavik Nychkalo +// Francesco Benedetto +// Alexandros Dorodoulis +// Manuel Heidrich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -29,13 +32,14 @@ declare class Chart { stop: () => {}; resize: () => {}; clear: () => {}; - toBase64: () => string; + toBase64Image: () => string; generateLegend: () => {}; getElementAtEvent: (e: any) => {}; getElementsAtEvent: (e: any) => Array<{}>; getDatasetAtEvent: (e: any) => Array<{}>; - ctx: CanvasRenderingContext2D|null; - canvas: HTMLCanvasElement|null; + getDatasetMeta: (index: number) => Meta; + ctx: CanvasRenderingContext2D | null; + canvas: HTMLCanvasElement | null; chartArea: Chart.ChartArea; static pluginService: PluginServiceStatic; static plugins: PluginServiceStatic; @@ -49,37 +53,54 @@ declare class Chart { [key: string]: any; }; + static helpers: { + [key: string]: any; + }; + // Tooltip Static Options static Tooltip: Chart.ChartTooltipsStaticConfiguration; } declare class PluginServiceStatic { - register(plugin: PluginServiceRegistrationOptions): void; - unregister(plugin: PluginServiceRegistrationOptions): void; + register(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; + unregister(plugin: PluginServiceGlobalRegistration & PluginServiceRegistrationOptions): void; +} + +interface PluginServiceGlobalRegistration { + id?: string; } interface PluginServiceRegistrationOptions { beforeInit?(chartInstance: Chart, options?: any): void; afterInit?(chartInstance: Chart, options?: any): void; - resize?(chartInstance: Chart, newChartSize: Size, options?: any): void; - beforeUpdate?(chartInstance: Chart, options?: any): void; - afterScaleUpdate?(chartInstance: Chart, options?: any): void; + afterUpdate?(chartInstance: Chart, options?: any): void; + + beforeLayout?(chartInstance: Chart, options?: any): void; + afterLayout?(chartInstance: Chart, options?: any): void; + beforeDatasetsUpdate?(chartInstance: Chart, options?: any): void; afterDatasetsUpdate?(chartInstance: Chart, options?: any): void; - afterUpdate?(chartInstance: Chart, options?: any): void; + + beforeDatasetUpdate?(chartInstance: Chart, options?: any): void; + afterDatasetUpdate?(chartInstance: Chart, options?: any): void; // This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw // to do something on each animation frame beforeRender?(chartInstance: Chart, options?: any): void; + afterRender?(chartInstance: Chart, options?: any): void; // Easing is for animation beforeDraw?(chartInstance: Chart, easing: string, options?: any): void; afterDraw?(chartInstance: Chart, easing: string, options?: any): void; + // Before the datasets are drawn but after scales are drawn beforeDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; afterDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; + beforeDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDatasetDraw?(chartInstance: Chart, easing: string, options?: any): void; + // Called before drawing the `tooltip`. If any plugin returns `false`, // the tooltip drawing is cancelled until another `render` is triggered. beforeTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; @@ -87,16 +108,57 @@ interface PluginServiceRegistrationOptions { // be called if the tooltip drawing has been previously cancelled. afterTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; - destroy?(chartInstance: Chart): void; - // Called when an event occurs on the chart beforeEvent?(chartInstance: Chart, event: Event, options?: any): void; afterEvent?(chartInstance: Chart, event: Event, options?: any): void; + + resize?(chartInstance: Chart, newChartSize: Chart.ChartSize, options?: any): void; + destroy?(chartInstance: Chart): void; + + /** @deprecated since version 2.5.0. Use `afterLayout` instead. */ + afterScaleUpdate?(chartInstance: Chart, options?: any): void; } -interface Size { - height: number; - width: number; +interface Meta { + type: Chart.ChartType; + data: MetaData[]; + dataset?: Chart.ChartDataSets; + controller: { [key: string]: any; }; + hidden?: boolean; + total?: string; + xAxisID?: string; + yAxisID?: string; + "$filler"?: { [key: string]: any; }; +} + +interface MetaData { + _chart: Chart; + _datasetIndex: number; + _index: number; + _model: Model; + _start?: any; + _view: Model; + _xScale: Chart.ChartScales; + _yScale: Chart.ChartScales; + hidden?: boolean; +} + +interface Model { + backgroundColor: string; + borderColor: string; + borderWidth?: number; + controlPointNextX: number; + controlPointNextY: number; + controlPointPreviousX: number; + controlPointPreviousY: number; + hitRadius: number; + pointStyle: string; + radius: string; + skip?: boolean; + steppedLine?: undefined; + tension: number; + x: number; + y: number; } declare namespace Chart { @@ -178,8 +240,7 @@ declare namespace Chart { type?: ChartType | string; data?: ChartData; options?: ChartOptions; - // Plugins can require any options - plugins?: any; + plugins?: PluginServiceRegistrationOptions[]; } interface ChartData { @@ -187,6 +248,15 @@ declare namespace Chart { datasets?: ChartDataSets[]; } + interface RadialChartOptions extends ChartOptions { + scale?: RadialLinearScale; + } + + interface ChartSize { + height: number; + width: number; + } + interface ChartOptions { responsive?: boolean; responsiveAnimationDuration?: number; @@ -195,6 +265,7 @@ declare namespace Chart { events?: string[]; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; + onResize?(this: Chart, newSize: ChartSize): void; title?: ChartTitleOptions; legend?: ChartLegendOptions; tooltips?: ChartTooltipOptions; @@ -210,7 +281,7 @@ declare namespace Chart { rotation?: number; devicePixelRatio?: number; // Plugins can require any options - plugins?: { [plugin: string]: any }; + plugins?: { [pluginId: string]: any }; } interface ChartFontOptions { @@ -293,7 +364,7 @@ declare namespace Chart { } interface ChartTooltipsStaticConfiguration { - positioners: {[mode: string]: ChartTooltipPositioner}; + positioners: { [mode: string]: ChartTooltipPositioner }; } type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point; @@ -367,14 +438,14 @@ declare namespace Chart { } interface ChartLayoutOptions { - padding?: ChartLayoutPaddingObject | number; + padding?: ChartLayoutPaddingObject | number; } interface ChartLayoutPaddingObject { - top?: number; - right?: number; - bottom?: number; - left?: number; + top?: number; + right?: number; + bottom?: number; + left?: number; } interface GridLineOptions { @@ -410,7 +481,7 @@ declare namespace Chart { backdropPaddingX?: number; backdropPaddingY?: number; beginAtZero?: boolean; - callback?(value: any, index: any, values: any): string|number; + callback?(value: any, index: any, values: any): string | number; display?: boolean; fontColor?: ChartColor; fontFamily?: string; @@ -483,7 +554,7 @@ declare namespace Chart { pointHoverBackgroundColor?: ChartColor | ChartColor[]; pointHoverBorderColor?: ChartColor | ChartColor[]; pointHoverBorderWidth?: number | number[]; - pointStyle?: PointStyle | HTMLImageElement | Array; + pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement | Array; xAxisID?: string; yAxisID?: string; type?: string; @@ -506,6 +577,7 @@ declare namespace Chart { } interface CommonAxe { + bounds?: string; type?: ScaleType | string; display?: boolean; id?: string; @@ -513,9 +585,10 @@ declare namespace Chart { position?: string; ticks?: TickOptions; gridLines?: GridLineOptions; - barThickness?: number; + barThickness?: number | "flex"; maxBarThickness?: number; scaleLabel?: ScaleTitleOptions; + time?: TimeScale; offset?: boolean; beforeUpdate?(scale?: any): void; beforeSetDimension?(scale?: any): void; @@ -537,7 +610,6 @@ declare namespace Chart { categoryPercentage?: number; barPercentage?: number; distribution?: 'linear' | 'series'; - time?: TimeScale; } // tslint:disable-next-line no-empty-interface @@ -578,7 +650,7 @@ declare namespace Chart { minUnit?: TimeUnit; } - interface RadialLinearScale { + interface RadialLinearScale extends LinearScale { lineArc?: boolean; angleLines?: AngleLineOptions; pointLabels?: PointLabelOptions; diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 270e6e0970..bd7006723e 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -343,6 +343,7 @@ chart2.on('draw', (data: any) => { style: 'fill-opacity: 1' }, 'ct-area'); + triangle.attr({ style: 'fill-opacity: .5' }); // With data.element we get the Chartist SVG wrapper and we can replace the original point drawn by Chartist with our newly created triangle data.element.replace(triangle); } diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 80cc589ee2..3d72210c73 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -534,7 +534,7 @@ declare namespace Chartist { /** * Set attributes on the current SVG element of the wrapper you're currently working on. */ - attr(attributes: Object | string, ns: string): Object | string; + attr(attributes: Object | string, ns?: string): Object | string; /** * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. diff --git a/types/chartmogul-node/chartmogul-node-tests.ts b/types/chartmogul-node/chartmogul-node-tests.ts new file mode 100644 index 0000000000..3a09a7597c --- /dev/null +++ b/types/chartmogul-node/chartmogul-node-tests.ts @@ -0,0 +1,277 @@ +import * as ChartMogul from 'chartmogul-node'; + +const config = new ChartMogul.Config("token", "secret", "baseURL"); +config.retries = 10; +config.getAccountToken(); // $ExpectType string +config.getSecretKey(); // $ExpectType string +config.VERSION; // $ExpectType string + +ChartMogul.Ping.ping(config); // $ExpectType Promise + +// $ExpectType Promise +ChartMogul.DataSource.create(config, { + name: "" +}); + +// $ExpectType Promise +ChartMogul.DataSource.retrieve(config, ""); + +// $ExpectType Promise<{}> +ChartMogul.DataSource.destroy(config, ""); + +// $ExpectType Promise +ChartMogul.DataSource.all(config, { + name: "" +}); + +ChartMogul.DataSource.all(config).then(data => { + data.data_sources[0]; // $ExpectType DataSource + data.data_sources[0].name; // $ExpectType string +}); + +// $ExpectType Promise +ChartMogul.Customer.create(config, { + data_source_uuid: "", + name: "", + external_id: "", + attributes: { + tags: ["important", "Prio1"], + custom: [ + {type: "String", key: "channel", value: "Facebook", source: "integration"}, + {type: "Integer", key: "age", value: 18} + ] + } +}); + +// $ExpectType Promise +ChartMogul.Customer.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Customer.modify(config, "", {}); + +// $ExpectType Promise<{}> +ChartMogul.Customer.destroy(config, ""); + +// $ExpectType Promise> +ChartMogul.Customer.all(config, { + data_source_uuid: "" +}); + +ChartMogul.Customer.all(config).then(data => { + data.entries[0]; // $ExpectType Customer + data.entries[0].attributes!.stripe!['something']; // $ExpectType any + data.page!; // $ExpectType number +}); + +// $ExpectType Promise> +ChartMogul.Customer.search(config, { + email: "" +}); +// $ExpectType Promise<{}> +ChartMogul.Customer.merge(config, { + from: {customer_uuid: ""}, + into: {customer_uuid: ""} +}); +// $ExpectType Promise +ChartMogul.Customer.attributes(config, ""); + +// $ExpectType Promise +ChartMogul.Plan.create(config, { + data_source_uuid: "", + name: "", + interval_count: 1, + interval_unit: "", + external_id: "" +}); + +// $ExpectType Promise +ChartMogul.Plan.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Plan.modify(config, "", { + name: "" +}); + +// $ExpectType Promise<{}> +ChartMogul.Plan.destroy(config, ""); + +ChartMogul.Plan.all(config, { + page: 1 +}).then(data => { + data.plans[0]; // $ExpectType Plan + data.plans[0].name!; // $ExpectType string + data.page!; // $ExpectType number +}); + +// $ExpectType Promise +ChartMogul.Invoice.retrieve(config, ""); + +// $ExpectType Promise +ChartMogul.Invoice.create(config, "", { + invoices: [ + { + external_id: "" + } + ] +}); + +// $ExpectType Promise<{}> +ChartMogul.Invoice.destroy(config, ""); +ChartMogul.Invoice.all(config, { + external_id: "" +}).then(data => { + data.invoices[0]; // $ExpectType Invoice + data.invoices[0].uuid!; // $ExpectType string + data.page!; // $ExpectType number +}); + +ChartMogul.Invoice.all(config, "", { + page: 1 +}).then(data => { + data.customer_uuid!; // $ExpectType string + data.invoices[0]; // $ExpectType Invoice + data.invoices[0].uuid!; // $ExpectType string + data.page!; // $ExpectType number +}); + +// $ExpectType Promise +ChartMogul.Transaction.create(config, "", { + type: "", + date: "", + result: "" +}); + +ChartMogul.Subscription.all(config, "", { + page: 1 +}).then(data => { + data.customer_uuid!; // $ExpectType string + data.subscriptions[0]; // $ExpectType Subscription + data.subscriptions[0].uuid; // $ExpectType string + data.current_page!; // $ExpectType number +}); + +ChartMogul.Subscription.cancel(config, "", { + cancelled_at: "" +}).then(data => { + data.customer_uuid; // $ExpectType string +}); + +// $ExpectType Promise> +ChartMogul.Tag.add(config, "", { + email: "", + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.Tag.add(config, "", { + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.Tag.remove(config, "", { + tags: [""] +}); + +// $ExpectType Promise +ChartMogul.CustomAttribute.add(config, "", { + custom: [ + {type: "", key: "", value: 0} + ] +}); +// $ExpectType Promise> +ChartMogul.CustomAttribute.add(config, "", { + email: "", + custom: [ + {type: "", key: "", value: 0} + ] +}); + +// $ExpectType Promise +ChartMogul.CustomAttribute.update(config, "", { + custom: { + pro: true, + channel: "" + } +}); + +ChartMogul.CustomAttribute.remove(config, "", { + custom: [""] +}).then(data => { + data.custom["key"]; // $ExpectType any +}); + +// $ExpectType Promise +ChartMogul.Metrics.all(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-24', + interval: '', + geo: '', + plans: '' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.mrr(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.arr(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.arpa(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.asp(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.customerCount(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.customerChurnRate(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01', + geo: '', + plans: '' +}); + +// $ExpectType Promise> +ChartMogul.Metrics.mrrChurnRate(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}); + +ChartMogul.Metrics.ltv(config, { + 'start-date': '2015-01-01', + 'end-date': '2015-11-01' +}).then(data => { + data.entries[0].ltv; // $ExpectType number + data.summary; // $ExpectType Summary + data.summary.current; // $ExpectType number +}); + +// $ExpectType Promise> +ChartMogul.Metrics.Customer.subscriptions(config, "", { + page: 1 +}); + +ChartMogul.Metrics.Customer.activities(config, "", { + page: 1 +}).then(data => { + data.entries; // $ExpectType MetricsActivity[] + data.entries[0]; // $ExpectType MetricsActivity + data.entries[0]['activity-mrr']; // $ExpectType number + data.page!; // $ExpectType number +}); diff --git a/types/chartmogul-node/common.d.ts b/types/chartmogul-node/common.d.ts new file mode 100644 index 0000000000..ced10f98d7 --- /dev/null +++ b/types/chartmogul-node/common.d.ts @@ -0,0 +1,28 @@ +export interface Map { + [key: string]: any +} +export interface CursorParams { + page?: number; + per_page?: number; +} +export type Strings = string[]; + +export interface Cursor { + page?: number; + per_page?: number; + has_more?: boolean; + current_page?: number; + total_pages?: number; +} +export interface Entries extends Cursor { + entries: T[] +} +interface Summary { + current: number; + previous: number; + ['percentage-change']: number; +} +export interface EntriesSummary { + entries: T[]; + summary: Summary; +} \ No newline at end of file diff --git a/types/chartmogul-node/index.d.ts b/types/chartmogul-node/index.d.ts new file mode 100644 index 0000000000..c4bdce5aca --- /dev/null +++ b/types/chartmogul-node/index.d.ts @@ -0,0 +1,410 @@ +// Type definitions for chartmogul-node 1.0 +// Project: https://github.com/chartmogul/chartmogul-node +// Definitions by: ChartMogul +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Map, Cursor, CursorParams, Strings, Entries, EntriesSummary } from './common'; + +export class Config { + VERSION: string; + API_BASE: string; + retries: number; + + constructor(token: string, secret: string, base?: string); + getAccountToken(): string; + getSecretKey(): string; +} + +export namespace Ping { + function ping(config: Config): Promise; +} + +export namespace DataSource { + interface DataSource { + uuid?: string; + name: string; + created_at?: string; + status?: string; + system?: string; + } + interface DataSources { + data_sources: DataSource[]; + } + interface ListDataSourcesParams { + name?: string; + system?: string; + } + + function create(config: Config, data: DataSource): Promise; + function retrieve(config: Config, uuid: string): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListDataSourcesParams): Promise; +} + +export namespace Customer { + interface Customer { + id?: number; + data_source_uuid?: string; + data_source_uuids?: Strings; + uuid?: string; + external_id?: string; + external_ids?: Strings; + name?: string; + email?: string; + status?: string; + ['customer-since']?: string; + attributes?: Attributes; + address?: { + address_zip?: string; + city?: string; + state?: string; + country?: string; + }; + mrr?: number; + arr?: number; + ['billing-system-url']?: string; + ['chartmogul-url']?: string; + ['billing-system-type']?: string; + currency?: string; + ['currency-sign']?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + } + interface NewCustomer { + data_source_uuid: string; + external_id: string; + name: string; + email?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + attributes?: NewAttributes; + } + interface UpdateCustomer { + name?: string; + email?: string; + company?: string; + country?: string; + state?: string; + city?: string; + zip?: string; + lead_created_at?: string; + free_trial_started_at?: string; + attributes?: NewAttributes; + } + interface NewAttributes { + tags?: Strings; + custom?: NewCustomAttributes[]; + } + interface NewCustomAttributes { + type?: string; + key: string; + value: any; + source?: string; + } + interface Attributes { + tags?: Strings; + stripe?: Map; + clearbit?: Map; + custom?: Map; + } + interface ListCustomersParams extends CursorParams { + data_source_uuid?: string; + status?: string; + system?: string; + external_id?: string; + } + interface SearchCustomersParams extends CursorParams { + email: string; + } + interface MergeID { + customer_uuid?: string; + external_id?: string; + } + interface MergeCustomersParams { + from: MergeID; + into: MergeID; + } + + function create(config: Config, data: NewCustomer): Promise; + function retrieve(config: Config, uuid: string): Promise; + function modify(config: Config, uuid: string, data: UpdateCustomer): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListCustomersParams): Promise>; + function search(config: Config, params?: SearchCustomersParams): Promise>; + function merge(config: Config, params?: MergeCustomersParams): Promise<{}>; + function attributes(config: Config, uuid: string): Promise; +} + +export namespace Plan { + interface Plan { + uuid?: string; + data_source_uuid?: string; + external_id?: string; + name?: string; + interval_count?: number; + interval_unit?: string; + } + interface ListPlansParams extends CursorParams { + data_source_uuid?: string; + system?: string; + external_id?: string; + } + interface Plans extends Cursor { + plans: Plan[]; + } + + function create(config: Config, data: Plan): Promise; + function retrieve(config: Config, uuid: string): Promise; + function modify(config: Config, uuid: string, data: Plan): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, params?: ListPlansParams): Promise; +} + +export namespace Invoice { + interface Invoice { + uuid?: string; + customer_uuid?: string; + currency?: string; + data_source_uuid?: string; + date?: string; + due_date?: string; + external_id?: string; + line_items?: LineItem[]; + transactions?: Transaction[]; + } + interface LineItem { + uuid?: string; + account_code?: string; + amount_in_cents?: number; + cancelled_at?: string; + description?: string; + discount_amount_in_cents?: number; + discount_code?: string; + external_id?: string; + plan_uuid?: string; + prorated?: boolean; + quantity?: number; + service_period_end?: string; + service_period_start?: string; + subscription_external_id?: string; + subscription_uuid?: string; + tax_amount_in_cents?: number; + transaction_fees_in_cents?: number; + type?: string; + } + interface Transaction { + uuid?: string; + date?: string; + external_id?: string; + result?: string; + type?: string; + } + interface ListInvoicesParams extends CursorParams { + data_source_uuid?: string; + customer_uuid?: string; + external_id?: string; + } + interface Invoices extends Cursor { + customer_uuid?: string; + invoices: Invoice[]; + } + + function create(config: Config, uuid: string, data: { + invoices: Invoice[] + }): Promise; + function retrieve(config: Config, uuid: string): Promise; + function destroy(config: Config, uuid: string): Promise<{}>; + function all(config: Config, uuid: string, params?: ListInvoicesParams): Promise; + function all(config: Config, params?: ListInvoicesParams): Promise; +} + +export namespace Transaction { + interface Transaction { + uuid?: string; + date: string; + external_id?: string; + result: string; + type: string; + } + + function create(config: Config, uuid: string, data: Transaction): Promise; +} + +export namespace Subscription { + interface Subscription { + uuid: string; + external_id: string; + customer_uuid: string; + plan_uuid: string; + cancellation_dates: Strings; + data_source_uuid: string; + } + interface CancelSubscriptionParams { + cancelled_at?: string; + cancellation_dates?: Strings; + } + interface Subscriptions extends Cursor { + customer_uuid?: string; + subscriptions: Subscription[]; + } + + function all(config: Config, uuid: string, data: CursorParams): Promise; + function cancel(config: Config, uuid: string, data: CancelSubscriptionParams): Promise; +} + +export namespace Tag { + interface Tags { + tags: Strings; + } + interface TagsWithEmail { + email: string; + tags: Strings; + } + function add(config: Config, uuid: string, data: TagsWithEmail): Promise>; + function add(config: Config, uuid: string, data: Tags): Promise; + function remove(config: Config, uuid: string, data: Tags): Promise; +} + +export namespace CustomAttribute { + import NewCustomAttributes = Customer.NewCustomAttributes; + + interface CustomAttributes { + custom: Map; + } + function add(config: Config, uuid: string, data: { + email: string; + custom: NewCustomAttributes[]; + }): Promise>; + function add(config: Config, uuid: string, data: { + custom: NewCustomAttributes[]; + }): Promise; + function update(config: Config, uuid: string, data: CustomAttributes): Promise; + function remove(config: Config, uuid: string, data: { + custom: Strings; + }): Promise; +} + +export namespace Metrics { + interface Params extends ParamsNoInterval { + interval?: string; + } + interface ParamsNoInterval { + ['start-date']: string; + ['end-date']: string; + geo?: string; + plans?: string; + } + interface All { + entries: { + date: string; + ['customer-churn-rate']: number; + ['mrr-churn-rate']: number; + ltv: number; + customers: number; + asp: number; + arpa: number; + arr: number; + mrr: number; + }; + } + + interface MRR { + date: string; + mrr: number; + ['mrr-new-business']: number; + ['mrr-expansion']: number; + ['mrr-contraction']: number; + ['mrr-churn']: number; + ['mrr-reactivation']: number; + } + interface ARR { + date: string; + arr: number; + } + interface ARPA { + date: string; + arpa: number; + } + interface ASP { + date: string; + asp: number; + } + interface CustomerCount { + date: string; + customers: number; + } + interface CustomerChurnRate { + date: string; + ['customer-churn-rate']: number; + } + interface MRRChurnRate { + date: string; + ['mrr-churn-rate']: number; + } + interface LTV { + date: string; + ltv: number; + } + + function all(config: Config, params: Params): Promise; + function mrr(config: Config, params: Params): Promise>; + function arr(config: Config, params: Params): Promise>; + function asp(config: Config, params: Params): Promise>; + function arpa(config: Config, params: Params): Promise>; + function customerCount(config: Config, params: Params): Promise>; + function customerChurnRate(config: Config, params: ParamsNoInterval): Promise>; + function mrrChurnRate(config: Config, params: ParamsNoInterval): Promise>; + function ltv(config: Config, params: ParamsNoInterval): Promise>; + + namespace Customer { + interface MetricsSubscription { + id: number; + external_id: string; + plan: string; + quantity: number; + mrr: number; + arr: number; + status: string; + ['billing-cycle']: string; + ['billing-cycle-count']: number; + ['start-date']: string; + ['end-date']: string; + currency: string; + ['currency-sign']: string; + } + interface MetricsActivity { + id: number; + date: string; + ['activity-arr']: number; + ['activity-mrr']: number; + ['activity-mrr-movement']: number; + currency: string; + ['currency-sign']: string; + description: string; + type: string; + } + + function subscriptions(config: Config, uuid: string, params?: CursorParams): Promise>; + function activities(config: Config, uuid: string, params?: CursorParams): Promise>; + } +} + +export class ChartMogulError extends Error { + response: any; + httpStatus: number; +} +export class ConfigurationError extends ChartMogulError {} +export class ForbiddenError extends ChartMogulError {} +export class NotFoundError extends ChartMogulError {} +export class ResourceInvalidError extends ChartMogulError {} +export class SchemaInvalidError extends ChartMogulError {} diff --git a/types/chartmogul-node/tsconfig.json b/types/chartmogul-node/tsconfig.json new file mode 100644 index 0000000000..3b24d48da8 --- /dev/null +++ b/types/chartmogul-node/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chartmogul-node-tests.ts" + ] +} diff --git a/types/chartmogul-node/tslint.json b/types/chartmogul-node/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chartmogul-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index d686951213..719c0c70da 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -265,8 +265,7 @@ $el.text(); $el.text('text'); // .wrap( content ) -// See https://github.com/cheeriojs/cheerio/issues/731 -// $el.wrap($('
')).html(); +$el.wrap($('
')).html(); // .css $el.css('width'); diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 42bcae6eff..cb8031705e 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao , Chennakrishna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -178,10 +178,9 @@ interface Cheerio { text(): string; text(text: string): Cheerio; - // See https://github.com/cheeriojs/cheerio/issues/731 - /*wrap(content: string): Cheerio; + wrap(content: string): Cheerio; wrap(content: Document): Cheerio; - wrap(content: Cheerio): Cheerio;*/ + wrap(content: Cheerio): Cheerio; css(propertyName: string): string; css(propertyNames: string[]): string[]; @@ -215,6 +214,7 @@ interface CheerioOptionsInterface { recognizeCDATA?: boolean; recognizeSelfClosing?: boolean; normalizeWhitespace?: boolean; + ignoreWhitespace?: boolean; } interface CheerioSelector { diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts index 957c409a4f..07437c787a 100644 --- a/types/chrome-apps/index.d.ts +++ b/types/chrome-apps/index.d.ts @@ -1,31 +1,66 @@ // Type definitions for Chrome packaged application development // Project: http://developer.chrome.com/apps/ -// Definitions by: Nikolai Ommundsen , Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingvar Stepanyan , Adam Pyle +// Definitions by: Nikolai Ommundsen , Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingconst Stepanyan , Adam Pyle , Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 -/// +/// -/////////////// -// WebView ref: https://chromium.googlesource.com/chromium/src/+/68.0.3432.1/chrome/common/extensions/api/webview_tag.json -/////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// WebView ref // +// https://chromium.googlesource.com/chromium/src/+/68.0.3432.1/chrome/common/extensions/api/webview_tag.json // +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////// -// Accessibility Features -//////////////////// -/** - * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. - * @since Availability: Since Chrome 37. - * Permissions: "accessibilityFeatures.read" (For read access); "accessibilityFeatures.modify" (For modifications; Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission.) - * Important: This API works only on Chrome OS. - */ declare namespace chrome { + ////////////// + // INTERNAL // + ////////////// + + /** @deprecated Could be used, if e.g. deprecated recently */ + type deprecatedButUsable = any; + + /** @deprecated Should never be used, used to guide migrations. */ + type deprecated = never; + + // Not proper types, but used to give the programmer a hint // + + /** + * Integer + */ + type integer = number; + /** + * Double + */ + type double = number; + + + //////////////////////////// + // Accessibility Features // + //////////////////////////// + /** + * @requires Important: This API works only on Chrome OS. + * @requires Permissions: + * 'accessibilityFeatures.read' (For read access) + * 'accessibilityFeatures.modify' (For modifications) + * Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. + * @since Available since Chrome 37. + * @description + * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. + * This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. + * In order to get feature states the extension must request accessibilityFeatures.read permission. + * For modifying feature state, the extension needs accessibilityFeatures.modify permission. + * Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. + */ namespace accessibilityFeatures { interface AccessibilityFeaturesGetArg { - /** Optional. Whether to return the value that applies to the incognito session (default false). */ + /** Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } + type LevelOfControl = + 'not_controllable' | 'controlled_by_other_extensions' | + 'controllable_by_this_extension' | 'controlled_by_this_extension'; + interface AccessibilityFeaturesCallbackArg { /** The value of the setting. */ value: any; @@ -36,11 +71,13 @@ declare namespace chrome { * • controllable_by_this_extension: can be controlled by this extension * • controlled_by_this_extension: controlled by this extension */ - levelOfControl: string; - /** Optional. Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ + levelOfControl: LevelOfControl; + /** Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ incognitoSpecific?: boolean; } + type Scope = 'regular' | 'regular_only' | 'incognito_persistent' | 'incognito_session_only'; + interface AccessibilityFeaturesSetArg { /** * The value of the setting. @@ -48,26 +85,24 @@ declare namespace chrome { */ value: any; /** - * Optional. - * The scope of the ChromeSetting. One of + * The scope of the ChromeSetting. One of * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), * • regular_only: setting for the regular profile only (not inherited by the incognito profile), * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). */ - scope?: string; + scope?: Scope; } interface AccessibilityFeaturesClearArg { /** - * Optional. - * The scope of the ChromeSetting. One of + * The scope of the ChromeSetting. One of * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), * • regular_only: setting for the regular profile only (not inherited by the incognito profile), * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). */ - scope?: string; + scope?: Scope; } interface AccessibilityFeaturesSetting { @@ -96,36 +131,88 @@ declare namespace chrome { clear(details: AccessibilityFeaturesClearArg, callback?: () => void): void; } - export var spokenFeedback: AccessibilityFeaturesSetting; - export var largeCursor: AccessibilityFeaturesSetting; - export var stickyKeys: AccessibilityFeaturesSetting; - export var highContrast: AccessibilityFeaturesSetting; - export var screenMagnifier: AccessibilityFeaturesSetting; - export var autoclick: AccessibilityFeaturesSetting; - export var virtualKeyboard: AccessibilityFeaturesSetting; - export var animationPolicy: AccessibilityFeaturesSetting; + /** + * Spoken feedback (text-to-speech). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const spokenFeedback: AccessibilityFeaturesSetting; + /** + * Enlarged cursor. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const largeCursor: AccessibilityFeaturesSetting; + /** + * Sticky modifier keys (like shift or alt). The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const stickyKeys: AccessibilityFeaturesSetting; + /** + * High contrast rendering mode. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const highContrast: AccessibilityFeaturesSetting; + /** + * Full screen magnification. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const screenMagnifier: AccessibilityFeaturesSetting; + /** + * Auto mouse click after mouse stops moving. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const autoclick: AccessibilityFeaturesSetting; + /** + * Virtual on-screen keyboard. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + */ + const virtualKeyboard: AccessibilityFeaturesSetting; + /** + * Caret highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 51. + */ + const caretHighlight: AccessibilityFeaturesSetting; + /** + * Cursor highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 51. + */ + const cursorHighlight: AccessibilityFeaturesSetting; + /** + * Focus highlighting. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 51. + */ + const focusHighlight: AccessibilityFeaturesSetting; + /** + * Select-to-speak. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 51. + */ + const selectToSpeak: AccessibilityFeaturesSetting; + /** + * Switch access. The value indicates whether the feature is enabled or not. get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 51. + */ + const switchAccess: AccessibilityFeaturesSetting; + /** + * get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission. + * @since Since Chrome 42. + */ + const animationPolicy: AccessibilityFeaturesSetting; } - //////////////////// - // Alarms - //////////////////// + //////////// + // Alarms // + //////////// /** - * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. - * Availability: Since Chrome 22. - * Permissions: "alarms" + * @requires Permissions: 'alarms' + * @since Availability: Since Chrome 22. + * @description + * Use the chrome.alarms API to schedule code to run + * periodically or at a specified time in the future. */ namespace alarms { interface AlarmCreateInfo { - /** Optional. Length of time in minutes after which the onAlarm event should fire. */ + /** Length of time in minutes after which the onAlarm event should fire. */ delayInMinutes?: number; - /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ + /** If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ periodInMinutes?: number; - /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ + /** Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ when?: number; } interface Alarm { - /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ + /** If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ periodInMinutes?: number; /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */ scheduledTime: number; @@ -137,111 +224,214 @@ declare namespace chrome { /** * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. - * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. + * That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. + * `when` can be set to less than 1 minute after 'now' without warning but won't actually cause the alarm to fire for at least 1 minute. * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ - export function create(alarmInfo: AlarmCreateInfo): void; + function create(alarmInfo: AlarmCreateInfo): void; /** - * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. - * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. + * If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. + * That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. + * `when` can be set to less than 1 minute after 'now' without warning but won't actually cause the alarm to fire for at least 1 minute. * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. * @param name Optional name to identify this alarm. Defaults to the empty string. * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. */ - export function create(name: string, alarmInfo: AlarmCreateInfo): void; + function create(name: string, alarmInfo: AlarmCreateInfo): void; /** * Gets an array of all the alarms. * @param callback The callback parameter should be a function that looks like this: - * function(array of Alarm alarms) {...}; + * @example function(array of Alarm alarms) {...}; */ - export function getAll(callback: (alarms: Alarm[]) => void): void; + function getAll(callback: (alarms: Alarm[]) => void): void; /** * Clears all alarms. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * @example function(boolean wasCleared) {...}; */ - export function clearAll(callback?: (wasCleared: boolean) => void): void; + function clearAll(callback?: (wasCleared: boolean) => void): void; /** * Clears the alarm with the given name. * @param name The name of the alarm to clear. Defaults to the empty string. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * @example function(boolean wasCleared) {...}; */ - export function clear(name?: string, callback?: (wasCleared: boolean) => void): void; + function clear(name?: string, callback?: (wasCleared: boolean) => void): void; /** * Clears the alarm without a name. - * @param callback If you specify the callback parameter, it should be a function that looks like this: - * function(boolean wasCleared) {...}; + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * @example function(boolean wasCleared) {...}; */ - export function clear(callback: (wasCleared: boolean) => void): void; + function clear(callback: (wasCleared: boolean) => void): void; /** * Retrieves details about the specified alarm. * @param callback The callback parameter should be a function that looks like this: - * function( Alarm alarm) {...}; + * @example function( Alarm alarm) {...}; */ - export function get(callback: (alarm: Alarm) => void): void; + function get(callback: (alarm: Alarm) => void): void; /** * Retrieves details about the specified alarm. * @param name The name of the alarm to get. Defaults to the empty string. * @param callback The callback parameter should be a function that looks like this: - * function( Alarm alarm) {...}; + * @example function( Alarm alarm) {...}; */ - export function get(name: string, callback: (alarm: Alarm) => void): void; + function get(name: string, callback: (alarm: Alarm) => void): void; /** Fired when an alarm has elapsed. Useful for event pages. */ - export var onAlarm: AlarmEvent; + const onAlarm: AlarmEvent; } - - //////////////////// - // App - //////////////////// - namespace app { - interface AppDetails extends chrome.runtime.Manifest { - id: string; + ///////////////// + // App Runtime // + ///////////////// + /** + * @since Availability: Since Chrome 24. + * @description + * Use the chrome.app.runtime API to manage the app lifecycle. + * The app runtime manages app installation, controls the event page, + * and can shut down the app at anytime. + */ + namespace app.runtime { + /** + * @todo TODO UNDOCUMENTED? + */ + enum PlayStoreStatus { + ENABLED = 'enabled', + AVAILABLE = 'available', + UNKNOWN = 'unknown' + } + enum LaunchSource { + ABOUT_PAGE = "about_page", + APP_LAUNCHER = "app_launcher", + BACKGROUND = "background", + CHROME_INTERNAL = "chrome_internal", + COMMAND_LINE = "command_line", + CONTEXT_MENU = "context_menu", + EPHEMERAL_APP = "ephemeral_app", + EXTENSIONS_PAGE = "extensions_page", + FILE_HANDLER = "file_handler", + INSTALLED_NOTIFICATION = "installed_notification", + KEYBOARD = "keyboard", + KIOSK = "kiosk", + LOAD_AND_LAUNCH = "load_and_launch", + MANAGEMENT_API = "management_api", + NEW_TAB_PAGE = "new_tab_page", + RELOAD = "reload", + RESTART = "restart", + SYSTEM_TRAY = "system_tray", + TEST = "test", + UNTRACKED = "untracked", + URL_HANDLER = "url_handler" } - export function getDetails(): AppDetails; - } + interface EmbedRequest { + /** + * Optional developer specified data that the app to be embedded can use when making an embedding decision. + */ + data?: any; + /** + * Allows embedderId to embed this app in an element. The url specifies the content to embed. + */ + allow: (url: string) => void; + /** + * Prevents embedderId from embedding this app in an element. + */ + deny: () => void; + } - //////////////////// - // App Runtime - //////////////////// - namespace app.runtime { - type LaunchSource = 'untracked' | 'app_launcher' | 'new_tab_page' | 'reload' | 'restart' | - 'load_and_launch' | 'command_line' | 'file_handler' | 'url_handler' | 'system_tray' | - 'about_page' | 'keyboard' | 'extensions_page' | 'management_api' | 'ephemeral_app' | - 'background' | 'kiosk' | 'chrome_internal' | 'test' | 'installed_notification' | 'context_menu'; + type actionType = 'new_note'; + + const ActionType: { + NEW_NOTE: actionType + } interface LaunchData { + /** + * The ID of the file or URL handler that the app is being invoked with. + * Handler IDs are the top-level keys in the file_handlers and/or url_handlers dictionaries in the manifest. + */ id?: string; + /** + * The file entries for the onLaunched event triggered by a matching file handler in the file_handlers manifest key. + */ items?: LaunchDataItem[]; + /** + * The URL for the onLaunched event triggered by a matching URL handler in the url_handlers manifest key. + */ url?: string; + /** + * The referrer URL for the onLaunched event triggered by a matching URL handler in the url_handlers manifest key. + */ referrerUrl?: string; + /** + * Whether the app is being launched in a Chrome OS kiosk session. + */ isKioskSession?: boolean; + /** + * Whether the app is being launched in a Chrome OS public session. + * @since Since Chrome 47. + */ isPublicSession?: boolean; + /** + * Where the app is launched from. + */ source?: LaunchSource; - actionData?: {}; + /** + * Contains data that specifies the ActionType this app was launched with. This is null if the app was not launched with a specific action intent. + * ______________________________________________________________________________ + * | type of 'new_note' | actionType | new_note | + * | | | The user wants to quickly take a new note. | + * |____________________|____________|____________________________________________| + * @since Since Chrome 54. + */ + actionData?: actionType; } interface LaunchDataItem { + /** + * Entry for the item + */ entry: FileEntry; - type: string; + /** + * The MIME type of the file. + */ + type?: string; } - interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> { } - - interface RestartedEvent extends chrome.events.Event<() => void> { } - - export var onLaunched: LaunchedEvent; - export var onRestarted: RestartedEvent; + /** + * Fired when an embedding app requests to embed this app. This event is only available on dev channel with the flag --enable-app-view. + * @since Since Chrome 38. + */ + const onEmbedRequest: chrome.events.Event<(request: EmbedRequest) => void>; + /** + * Fired when an app is launched from the launcher. + */ + const onLaunched: chrome.events.Event<(launchData: LaunchData) => void>; + /** + * Fired at Chrome startup to apps that were running when Chrome last shut down, + * or when apps have been requested to restart from their previous state for other reasons + * (e.g. when the user revokes access to an app's retained files the runtime will restart the app). + * In these situations if apps do not have an onRestarted handler they will be sent an onLaunched event instead. + */ + const onRestarted: chrome.events.Event<() => void>; } //////////////////// // App Window //////////////////// - namespace app.window { + /** + * @since Availability: Since Chrome 24. + * @description + * Use the chrome.app.window API to create windows. + * Windows have an optional frame with title bar and size controls. + * They are not associated with any Chrome browser windows. + * See the Window State Sample for a demonstration of these options. + */ + namespace app { interface ContentBounds { left?: number; top?: number; @@ -250,134 +440,383 @@ declare namespace chrome { } interface BoundsSpecification { + /** The X coordinate of the content or window. */ left?: number; + /** The Y coordinate of the content or window. */ top?: number; + /** The width of the content or window. */ width?: number; + /** The height of the content or window. */ height?: number; + /** The minimum width of the content or window. */ minWidth?: number; + /** The minimum height of the content or window. */ minHeight?: number; + /** The maximum width of the content or window. */ maxWidth?: number; + /** The maximum height of the content or window. */ maxHeight?: number; } interface Bounds { + /** This property can be used to read or write the current X coordinate of the content or window. */ left: number; + /** This property can be used to read or write the current Y coordinate of the content or window. */ top: number; + /** This property can be used to read or write the current width of the content or window. */ width: number; + /** This property can be used to read or write the current height of the content or window. */ height: number; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; + /** This property can be used to read or write the current minimum width of the content or window. A value of null indicates 'unspecified'. */ + minWidth?: number | null; + /** This property can be used to read or write the current minimum height of the content or window. A value of null indicates 'unspecified'. */ + minHeight?: number | null; + /** This property can be used to read or write the current maximum width of the content or window. A value of null indicates 'unspecified'. */ + maxWidth?: number | null; + /** This property can be used to read or write the current maximum height of the content or window. A value of null indicates 'unspecified'. */ + maxHeight?: number | null; + /** Set the left and top position of the content or window. */ setPosition(left: number, top: number): void; + /** Set the width and height of the content or window. */ setSize(width: number, height: number): void; - setMinimumSize(minWidth: number, minHeight: number): void; - setMaximumSize(maxWidth: number, maxHeight: number): void; + /** Set the minimum size constraints of the content or window. + * The minimum width or height can be set to null to remove the constraint. + * A value of undefined will leave a constraint unchanged. + **/ + setMinimumSize(minWidth: number | null | undefined, minHeight: number | null | undefined): void; + /** + * Set the maximum size constraints of the content or window. + * The maximum width or height can be set to null to remove the constraint. + * A value of undefined will leave a constraint unchanged. + */ + setMaximumSize(maxWidth: number | null | undefined, maxHeight: number | null | undefined): void; } interface FrameOptions { - type?: string; + /** + * Frame type: none or chrome (defaults to chrome). + * + * For none, the -webkit-app-region CSS property can be used to apply draggability to the app's window. + * -webkit-app-region: drag can be used to mark regions draggable. no-drag can be used to disable this style on nested elements. + */ + type: 'none'; + } + interface FrameOptionsChrome { + /** + * Frame type: none or chrome (defaults to chrome). + * + * For none, the -webkit-app-region CSS property can be used to apply draggability to the app's window. + * -webkit-app-region: drag can be used to mark regions draggable. no-drag can be used to disable this style on nested elements. + */ + type: 'chrome'; + /** + * Allows the frame color to be set. Frame coloring is only available if the frame type is chrome. + * @since Frame coloring is new in Chrome 36. + */ color?: string; + /** + * Allows the frame color of the window when active to be set. Frame coloring is only available if the frame type is chrome. + * Frame coloring is only available if the frame type is chrome. + * @since Frame coloring is new in Chrome 36. + */ activeColor?: string; + /** + * Allows the frame color of the window when inactive to be set differently to the active color. Frame coloring is only available if the frame type is chrome. + * inactiveColor must be used in conjunction with color. + * @since Frame coloring is new in Chrome 36. + */ inactiveColor?: string; } + enum State { + NORMAL = 'normal', + FULLSCREEN = 'fullscreen', + MAXIMIZED = 'maximized', + MINIMIZED = 'minimized' + } + interface CreateWindowOptions { + /** + * Id to identify the window. + * + * This will be used to remember the size and position of the window and restore that geometry when a window with the same id is later opened. + * If a window with a given id is created while another window with the same id already exists, + * the currently opened window will be focused instead of creating a new window. + */ id?: string; + /** + * Used to specify the initial position, initial size and constraints of the window's content (excluding window decorations). + * If an id is also specified and a window with a matching id has been shown before, the remembered bounds will be used instead. + * Note that the padding between the inner and outer bounds is determined by the OS. + * Therefore setting the same bounds property for both the innerBounds and outerBounds will result in an error. + * @since This property is new in Chrome 36. + */ innerBounds?: BoundsSpecification; + /** + * Used to specify the initial position, initial size and constraints of the window (including window decorations such as the title bar and frame). + * If an id is also specified and a window with a matching id has been shown before, the remembered bounds will be used instead. + * Note that the padding between the inner and outer bounds is determined by the OS. + * Therefore setting the same bounds property for both the innerBounds and outerBounds will result in an error. + * @since This property is new in Chrome 36. + */ outerBounds?: BoundsSpecification; + /** + * Minimum width of the window. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + */ minWidth?: number; + /** + * Minimum height of the window. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + */ minHeight?: number; + /** + * Maximum width of the window. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + */ maxWidth?: number; + /** + * Maximum height of the window. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + */ maxHeight?: number; + /** Type of window to create */ + type?: 'shell'; /** - * @description - * @type {(string | FrameOptions)} string ("none", "chrome") or FrameOptions - * @memberof CreateWindowOptions + * If true, the window will have its own shelf icon. + * Otherwise the window will be grouped in the shelf with other windows that are associated with the app. + * Defaults to false. + * If showInShelf is set to true you need to specify an id for the window. + * @since Since Chrome 54. + */ + showInShelf?: boolean; + /** + * URL of the window icon. A window can have its own icon when showInShelf is set to true. The URL should be a global or an extension local URL. + * @since Since Chrome 54. + */ + icon?: string; + /** + * Frame type: none or chrome (defaults to chrome). + * For none, the -webkit-app-region CSS property can be used to apply draggability to the app's window. + * -webkit-app-region: drag can be used to mark regions draggable. no-drag can be used to disable this style on nested elements. + * @since Use of FrameOptions is new in M36. + */ + frame?: 'none' | 'chrome' | FrameOptions | FrameOptionsChrome; + /** + * Size and position of the content in the window (excluding the titlebar). + * If an id is also specified and a window with a matching id has been shown before, + * the remembered bounds of the window will be used instead. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. */ - frame?: string | FrameOptions; bounds?: ContentBounds; - alphaEnabled?: boolean; /** - * @description - * @type {string} "normal", "fullscreen", "maximized", "minimized" - * @memberof CreateWindowOptions + * The initial state of the window, allowing it to be created already fullscreen, maximized, or minimized. Defaults to 'normal'. + */ + state?: State; + /** + * If true, the window will be created in a hidden state. Call show() on the window to show it once it has been created. Defaults to false. */ - state?: string; hidden?: boolean; + /** + * If true, the window will be resizable by the user. Defaults to true. + */ resizable?: boolean; + /** + * @deprecated Deprecated since Chrome 34. Multiple windows with the same id is no longer supported. + * By default if you specify an id for the window, + * the window will only be created if another window with the same id doesn't already exist. + * If a window with the same id already exists that window is activated instead. + * If you do want to create multiple windows with the same id, you can set this property to false. + */ singleton?: boolean; + /** + * If true, the window will stay above most other windows. + * If there are multiple windows of this kind, the currently focused window will be in the foreground. + * @requires alwaysOnTopWindows-permission. + * Defaults to false. + * Call setAlwaysOnTop() on the window to change this property after creation. + */ alwaysOnTop?: boolean; + /** If true, the window will be focused when created. Defaults to true. */ focused?: boolean; + /** + * If true, and supported by the platform, the window will be visible on all workspaces. + * @since Since Chrome 39. + */ visibleOnAllWorkspaces?: boolean; } - interface AppWindow { + /** Focus the window. */ focus: () => void; + /** + * Fullscreens the window. + * The user will be able to restore the window by pressing ESC. + * An application can prevent the fullscreen state to be left when ESC is pressed by requesting the + * app.window.fullscreen.overrideEsc permission and canceling the event by calling .preventDefault(), + * in the keydown and keyup handlers, like this: + * @example window.onkeydown = window.onkeyup = function(e) { if (e.keyCode == 27 <<--``ESC``) { e.preventDefault(); } + * Note window.fullscreen() will cause the entire window to become fullscreen and does not require a user gesture. + * The HTML5 fullscreen API can also be used to enter fullscreen mode(see Web APIs for more details). + **/ fullscreen: () => void; + /** Is the window fullscreen? This will be true if the window has been created fullscreen or was made fullscreen via the AppWindow or HTML5 fullscreen APIs. */ isFullscreen: () => boolean; + /** Minimize the window. */ minimize: () => void; + /** Is the window minimized? */ isMinimized: () => boolean; + /** Maximize the window. */ maximize: () => void; + /** Is the window maximized? */ isMaximized: () => boolean; + /** Restore the window, exiting a maximized, minimized, or fullscreen state. */ restore: () => void; + /** + * Move the window to the position (|left|, |top|). + * @deprecated Deprecated since Chrome 43. Use outerBounds. + */ moveTo: (left: number, top: number) => void; + /** + * Resize the window to |width|x|height| pixels in size. + * @deprecated Deprecated since Chrome 43. Use outerBounds. + */ resizeTo: (width: number, height: number) => void; + /** Draw attention to the window. */ drawAttention: () => void; + /** Clear attention to the window. */ clearAttention: () => void; + /** Close the window. */ close: () => void; - show: () => void; + /** Show the window. Does nothing if the window is already visible. Focus the window if |focused| is set to true or omitted. */ + show: (focused?: boolean) => void; + /** Hide the window. Does nothing if the window is already hidden. */ hide: () => void; + /** + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + * Get the window's inner bounds as a ContentBounds object. + */ getBounds: () => ContentBounds; + /** + * Set the window's inner bounds. + * @deprecated Deprecated since Chrome 36. Use innerBounds or outerBounds. + */ setBounds: (bounds: ContentBounds) => void; + /** Is the window always on top? */ isAlwaysOnTop: () => boolean; + /** Set whether the window should stay above most other windows. Requires the alwaysOnTopWindows permission. */ setAlwaysOnTop: (alwaysOnTop: boolean) => void; + /** Set whether the window is visible on all workspaces. (Only for platforms that support this). */ setVisibleOnAllWorkspaces: (alwaysVisible: boolean) => void; + /** The JavaScript 'window' object for the created child. */ contentWindow: Window; + /** The id the window was created with. */ id: string; + /** + * The position, size and constraints of the window's content, which does not include window decorations. + * @since This property is new in Chrome 36. + * */ innerBounds: Bounds; + /** + * The position, size and constraints of the window, which includes window decorations, such as the title bar and frame. + * @since This property is new in Chrome 36. + */ outerBounds: Bounds; + + + /** Fired when the window is resized. */ onBoundsChanged: WindowEvent; + /** + * Fired when the window is closed. + * Note, this should be listened to from a window other than the window being closed, for example from the background page. + * This is because the window being closed will be in the process of being torn down when the event is fired, + * which means not all APIs in the window's script context will be functional. + */ onClosed: WindowEvent; + /** Fired when the window is fullscreened (either via the AppWindow or HTML5 APIs). */ onFullscreened: WindowEvent; + /** Fired when the window is maximized. */ onMaximized: WindowEvent; + /** Fired when the window is minimized. */ onMinimized: WindowEvent; + /** Fired when the window is restored from being minimized or maximized. */ onRestored: WindowEvent; } - - export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void; - export function current(): AppWindow; - export function get(id: string): AppWindow; - export function getAll(): AppWindow[]; - export function canSetVisibleOnAllWorkspaces(): boolean; - interface WindowEvent extends chrome.events.Event<() => void> { } - export var onBoundsChanged: WindowEvent; - export var onClosed: WindowEvent; - export var onFullscreened: WindowEvent; - export var onMaximized: WindowEvent; - export var onMinimized: WindowEvent; - export var onRestored: WindowEvent; - } + interface WindowParams extends AppWindow { + id: string; + frameId?: integer; + existingWindow?: boolean; + [key: string]: any; + } + interface ChromeAppWindow extends AppWindow { + /** + * The size and position of a window can be specified in a number of different ways. The most simple option is not specifying anything at all, in which case a default size and platform dependent position will be used. + * To set the position, size and constraints of the window, use the innerBounds or outerBounds properties. Inner bounds do not include window decorations. Outer bounds include the window's title bar and frame. Note that the padding between the inner and outer bounds is determined by the OS. Therefore setting the same property for both inner and outer bounds is considered an error (for example, setting both innerBounds.left and outerBounds.left). + * To automatically remember the positions of windows you can give them ids. If a window has an id, This id is used to remember the size and position of the window whenever it is moved or resized. This size and position is then used instead of the specified bounds on subsequent opening of a window with the same id. If you need to open a window with an id at a location other than the remembered default, you can create it hidden, move it to the desired location, then show it. + * + * @param url + * @param [options] + * @param [callback] Called in the creating window (parent) before the load event is called in the created window (child). The parent can set fields or functions on the child usable from onload. E.g. background.js: function(createdWindow) { createdWindow.contentWindow.foo = function () { }; }; window.js: window.onload = function () { foo(); } If you specify the callback parameter, it should be a function that looks like this: function(AppWindow createdWindow) {...}; + */ + create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void; + /** + * Returns an AppWindow object for the current script context (ie JavaScript 'window' object). This can also be called on a handle to a script context for another page, for example: otherWindow.chrome.app.window.current(). + */ + current(): AppWindow; + /** + * Gets an AppWindow with the given id. If no window with the given id exists null is returned. This method is new in Chrome 33. + */ + get(id: string): AppWindow; + /** + * Gets an array of all currently created app windows. This method is new in Chrome 33. + */ + getAll(): AppWindow[]; + /** + * Whether the current platform supports windows being visible on all workspaces. + */ + canSetVisibleOnAllWorkspaces(): boolean; + + + /** + * Undocumented + * @todo TODO Find info + * definition app.window.initializeAppWindow(state: object) + * @internal + */ + initializeAppWindow(state: WindowParams): void; + } + const window: ChromeAppWindow; + } //////////////////// // Audio //////////////////// /** - * The chrome.audio API is provided to allow users to get information about and control the audio devices attached to the system. This API is currently only implemented for ChromeOS. - * @since Chrome 59 + * @since Since Chrome 59. + * @requires Permissions: 'audio' + * @description + * The chrome.audio API is provided to allow users to get information + * about and control the audio devices attached to the system. + * This API is currently only implemented for ChromeOS. */ namespace audio { - export type StreamType = 'INPUT' | 'OUTPUT'; + type StreamType = 'INPUT' | 'OUTPUT'; + type DeviceType = + 'HEADPHONE' | 'MIC' | 'USB' | + 'BLUETOOTH' | 'HDMI' | 'INTERNAL_SPEAKER' | + 'INTERNAL_MIC' | 'FRONT_MIC' | 'REAR_MIC' | + 'KEYBOARD_MIC' | 'HOTWORD' | 'LINEOUT' | + 'POST_MIX_LOOPBACK' | 'POST_DSP_LOOPBACK' | 'OTHER'; + interface AudioDeviceInfo { /** The unique identifier of the audio device. */ id: string; /** Stream type associated with this device. */ streamType: StreamType; /** Type of the device. */ - deviceType: "HEADPHONE" | "MIC" | "USB" | "BLUETOOTH" | "HDMI" | "INTERNAL_SPEAKER" | "INTERNAL_MIC" | "FRONT_MIC" | "REAR_MIC" | "KEYBOARD_MIC" | "HOTWORD" | "LINEOUT" | "POST_MIX_LOOPBACK" | "POST_DSP_LOOPBACK" | "OTHER"; - /** The user-friendly name (e.g. "USB Microphone"). */ + deviceType: DeviceType; + /** The user-friendly name (e.g. 'USB Microphone'). */ displayName: string; /** Device name. */ deviceName: string; @@ -405,35 +844,24 @@ declare namespace chrome { * The audio device's desired sound level. Defaults to the device's current sound level. * If used with audio input device, represents audio device gain. * If used with audio output device, represents audio device volume. - * - * Type: integer */ - level?: number; + level?: integer; } + /** @todo TODO INTEGRATE */ interface OnLevelChangedEvent { - /** - * The callback parameter should be a function that looks like this: - * function(object event) {...}; - * @param {(event: { - * deviceId: string, - * level: number - * }) => void} callback - */ addListener(callback: (event: { deviceId: string, level: number }) => void): void; } + /** @todo TODO INTEGRATE */ interface OnMuteChangedEvent { - /** - * The callback parameter should be a function that looks like this: - * function(object event) {...}; - */ addListener(callback: (event: { streamType: StreamType[], isMuted: boolean }) => void): void; } + /** @todo TODO INTEGRATE */ interface OnDeviceListChangedEvent { /** * The callback parameter should be a function that looks like this: @@ -443,89 +871,125 @@ declare namespace chrome { addListener(callback: (devices: AudioDeviceInfo[]) => void): void; } /** - * @description Device properties by which to filter the list of returned audio devices. If the filter is not set or set to {}, returned device list will contain all available audio devices. + * Device properties by which to filter the list of returned audio devices. If the filter is not set or set to {}, returned device list will contain all available audio devices. */ interface Filter { /** - * @description If set, only audio devices whose stream type is included in this list will satisfy the filter. + * If set, only audio devices whose stream type is included in this list will satisfy the filter. */ streamTypes?: StreamType[]; /** - * @description If set, only audio devices whose active state matches this value will satisfy the filter. + * If set, only audio devices whose active state matches this value will satisfy the filter. */ isActive?: boolean; } /** - * @description Gets a list of audio devices filtered based on |filter|. + * Gets a list of audio devices filtered based on |filter|. */ - export function getDevices(filter: Filter, callback: (devices: AudioDeviceInfo[]) => void): void; - export function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void; + function getDevices(filter: Filter, callback: (devices: AudioDeviceInfo[]) => void): void; + function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void; /** Sets lists of active input and/or output devices. */ - export function setDevices(ids: DeviceIdLists[] | string[], callback: () => void): void; + function setDevices(ids: DeviceIdLists[] | string[], callback: () => void): void; /** Sets the properties for the input or output device. */ - export function setProperties(id: string, properties: SetDeviceProperties, callback: () => void): void; + function setProperties(id: string, properties: SetDeviceProperties, callback: () => void): void; /** - * @description Gets the system-wide mute state for the specified stream type. + * Gets the system-wide mute state for the specified stream type. * @param {StreamType} streamType Stream type for which mute state should be fetched. - * @param {(value: boolean) => {}} callback Callback reporting whether mute is set or not for specified stream type. + * @param {(value: boolean)=> void} callback Callback reporting whether mute is set or not for specified stream type. */ - export function getMute(streamType: StreamType, callback: (value: boolean) => void): void; + function getMute(streamType: StreamType, callback: (value: boolean) => void): void; /** - * @description Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type. + * Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type. * @param {StreamType} streamType Stream type for which mute state should be set. * @param {boolean} isMuted New mute value. - * @param {() => {}} [callback] If you specify the callback parameter, it should be a function that looks like this: function() {...}; + * @param {()=> void} [callback] If you specify the callback parameter, it should be a function that looks like this: function() {...}; */ - export function setMute(streamType: StreamType, isMuted: boolean, callback?: () => void): void; + function setMute(streamType: StreamType, isMuted: boolean, callback?: () => void): void; /** Fired when sound level changes for an active audio device. */ - export var onLevelChanged: OnLevelChangedEvent; + const onLevelChanged: OnLevelChangedEvent; /** Fired when the mute state of the audio input or output changes. Note that mute state is system-wide and the new value applies to every audio device with specified stream type. */ - export var onMuteChanged: OnMuteChangedEvent; + const onMuteChanged: OnMuteChangedEvent; /** Fired when audio devices change, either new devices being added, or existing devices being removed. */ - export var onDeviceListChanged: OnDeviceListChangedEvent; + const onDeviceListChanged: OnDeviceListChangedEvent; } - //////////////////// - // Bluetooth - //////////////////// + /////////////// + // Bluetooth // + /////////////// /** - * Use the chrome.bluetooth API to connect to a Bluetooth device. All functions report failures via chrome.runtime.lastError. - * Manifest: "bluetooth": {...} * @since Chrome 37 + * @requires Manifest: 'bluetooth': {...} + * @description + * Use the chrome.bluetooth API to connect to a Bluetooth device. + * All functions report failures via chrome.runtime.lastError. */ namespace bluetooth { interface AdapterState { + /** The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'. */ address: string; + /** The human-readable name of the adapter. */ name: string; + /** Indicates whether or not the adapter has power. */ powered: boolean; + /** Indicates whether or not the adapter is available (i.e. enabled). */ available: boolean; + /** Indicates whether or not the adapter is currently discovering. */ discovering: boolean; } + type DeviceType = + 'computer' | 'phone' | 'modem' | + 'audio' | 'carAudio' | 'video' | + 'peripheral' | 'joystick' | 'gamepad' | + 'keyboard' | 'mouse' | 'tablet' | 'keyboardMouseCombo'; + + type DeviceVendorIdSource = 'bluetooth' | 'usb'; + interface Device { + /** The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. */ address: string; + /** The human-readable name of the device. */ name?: string; + /** The class of the device, a bit-field defined by http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband. */ deviceClass?: number; - vendorIdSource?: 'bluetooth' | 'usb'; + /** The Device ID record of the device, where available. */ + vendorIdSource?: DeviceVendorIdSource; vendorId?: number; productId?: number; deviceId?: number; - type?: "computer" | "phone" | "modem" | "audio" | "carAudio" | "video" | "peripheral" | "joystick" | "gamepad" | "keyboard" | "mouse" | "tablet" | "keyboardMouseCombo"; + /** + * The type of the device, if recognized by Chrome. + * This is obtained from the |deviceClass| field and only represents a small fraction of the possible device types. + * When in doubt you should use the |deviceClass| field directly. + */ + type?: DeviceType; + /** Indicates whether or not the device is paired with the system. */ paired?: boolean; + /** Indicates whether the device is currently connected to the system. */ connected?: boolean; /** + * Indicates whether the device is currently connecting to the system. * @since Chrome 48 */ connecting?: boolean; /** + * Indicates whether the device is connectable. * @since Chrome 48 */ connectable?: boolean; + /** + * UUIDs of protocols, profiles and services advertised by the device. + * For classic Bluetooth devices, this list is obtained from EIR data and SDP tables. + * For Low Energy devices, this list is obtained from AD and GATT primary services. + * For dual mode devices this may be obtained from both. + */ uuids?: string[]; /** + * The received signal strength, in dBm. This field is avaliable and valid only during discovery. Outside of discovery it's value is not specified. * @since Chrome 44 */ inquiryRssi: number; /** + * The transmitted power level. This field is avaliable only for LE devices that include this field in AD. It is avaliable and valid only during discovery. * @since Chrome 44 */ inquiryTxPower: number; @@ -535,68 +999,817 @@ declare namespace chrome { addListener(callback: (event: T) => void): void; } + type DeviceFilterType = 'all' | 'known'; + /** * Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. */ interface DeviceFilter { /** Type of filter to apply to the device list. Default is all. */ - filterType?: 'all' | 'known'; + filterType?: DeviceFilterType; /** Maximum number of bluetoth devices to return. Default is 0 (no limit) if unspecified. */ limit?: number; } /** Get information about the Bluetooth adapter. */ - export function getAdapterState(callback: (adapterInfo: AdapterState) => void): void; + function getAdapterState(callback: (adapterInfo: AdapterState) => void): void; + /** Get information about a Bluetooth device known to the system. */ - export function getDevice(deviceAddress: string, callback: (deviceInfo: Device) => void): void; + function getDevice(deviceAddress: string, callback: (deviceInfo: Device) => void): void; + + /** + * Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. + * @param callback Called when the search is completed. + */ + function getDevices(callback: (devices: Device[]) => void): void; + /** * Get a list of Bluetooth devices known to the system, including paired and recently discovered devices. * @param filter Since Chrome 67. Some criteria to filter the list of returned bluetooth devices. If the filter is not set or set to {}, returned device list will contain all bluetooth devices. Right now this is only supported in ChromeOS, for other platforms, a full list is returned. * @param callback Called when the search is completed. */ - export function getDevices(filter: DeviceFilter, callback: (deviceInfo: Device) => void): void; + function getDevices(filter: DeviceFilter, callback: (devices: Device[]) => void): void; + /** * Start discovery. Newly discovered devices will be returned via the onDeviceAdded event. Previously discovered devices already known to the adapter must be obtained using getDevices and will only be updated using the |onDeviceChanged| event if information about them changes. * Discovery will fail to start if this application has already called startDiscovery. Discovery can be resource intensive: stopDiscovery should be called as soon as possible. */ - export function startDiscovery(callback: () => void): void; + function startDiscovery(callback: () => void): void; + /** Stop discovery. */ - export function stopDiscovery(callback: () => void): void; + function stopDiscovery(callback: () => void): void; + /** Fired when the state of the Bluetooth adapter changes. */ - export var onAdapterStateChanged: BluetoothEvent; + const onAdapterStateChanged: BluetoothEvent; + /** Fired when information about a new Bluetooth device is available. */ - export var onDeviceAdded: BluetoothEvent; + const onDeviceAdded: BluetoothEvent; + /** Fired when information about a known Bluetooth device has changed. */ - export var onDeviceChanged: BluetoothEvent; + const onDeviceChanged: BluetoothEvent; + /** Fired when a Bluetooth device that was previously discovered has been out of range for long enough to be considered unavailable again, and when a paired device is removed. */ - export var onDeviceRemoved: BluetoothEvent; - } - /** - * The chrome.bluetoothLowEnergy API is used to communicate with Bluetooth Smart (Low Energy) devices using the Generic Attribute Profile (GATT). - * Manifest: "bluetooth": {...} - * @since Chrome 37 - * Important: This API works only on Chrome OS. - * Note: With Chrome 56, users can select nearby Bluetooth Low Energy devices to provide to web sites that use the Web Bluetooth API. - */ - namespace bluetoothLowEnergy { - /** - * NOT IMPLEMENTED YET - * @see https://developer.chrome.com/apps/bluetoothLowEnergy - * */ - } - /** - * Use the chrome.bluetoothSocket API to send and receive data to Bluetooth devices using RFCOMM and L2CAP connections. - * @since Chrome 37 - * Manifest: "bluetooth": {...} - * Important: This API works only on OS X, Windows and Chrome OS. - */ - namespace bluetoothSocket { - /** NOT IMPLEMENTED YET */ + const onDeviceRemoved: BluetoothEvent; } - //////////////////// - // Browser - //////////////////// /** + * @since Chrome 37 + * @requires Manifest: 'bluetooth': {...} + * @requires Important: This API works only on Chrome OS. + * @requires Note: With Chrome 56, users can select nearby Bluetooth Low Energy devices to provide to web sites that use the Web Bluetooth API. + * @description + * The chrome.bluetoothLowEnergy API is used to communicate + * with Bluetooth Smart (Low Energy) devices using the + * Generic Attribute Profile (GATT). + */ + namespace bluetoothLowEnergy { + interface Service { + /** The UUID of the service, e.g. 0000180d-0000-1000-8000-00805f9b34fb. */ + uuid: string; + /** Indicates whether the type of this service is primary or secondary. */ + isPrimary: boolean; + /** + * Returns the identifier assigned to this service. + * Use the instance ID to distinguish between services from a peripheral with the same UUID and to make function calls that take in a service identifier. + * Present, if this instance represents a remote service. + **/ + instanceId?: string; + /** + * The device address of the remote peripheral that the GATT service belongs to. + * Present, if this instance represents a remote service. + */ + deviceAddress?: string; + } + type CharacteristicProperties = + 'broadcast' | + 'read' | + 'writeWithoutResponse' | + 'write' | + 'notify' | + 'indicate' | + 'authenticatedSignedWrites' | + 'extendedProperties' | + 'reliableWrite' | + 'writableAuxiliaries' | + 'encryptRead' | + 'encryptWrite' | + 'encryptAuthenticatedRead' | + 'encryptAuthenticatedWrite'; + interface Characteristic { + /** The UUID of the characteristic, e.g. 00002a37-0000-1000-8000-00805f9b34fb. */ + uuid: string; + /** The GATT service this characteristic belongs to. */ + service?: Service; + /** The properties of this characteristic. */ + properties: CharacteristicProperties[]; + /** Returns the identifier assigned to this characteristic. Use the instance ID to distinguish between characteristics from a peripheral with the same UUID and to make function calls that take in a characteristic identifier. Present, if this instance represents a remote characteristic. */ + instanceId?: string; + /** The currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication. */ + value?: ArrayBuffer; + } + type DescriptorPermissions = + 'read' | + 'write' | + 'encryptedRead' | + 'encryptedWrite' | + 'encryptedAuthenticatedRead' | + 'encryptedAuthenticatedWrite'; + + interface Descriptor { + /** The UUID of the characteristic descriptor, e.g. 00002902-0000-1000-8000-00805f9b34fb. */ + uuid: string; + /** The GATT characteristic this descriptor belongs to. */ + characteristic?: Characteristic; + /** + * The permissions of this descriptor. + * @since Since Chrome 52. + */ + permissions: DescriptorPermissions[]; + /** Returns the identifier assigned to this descriptor. Use the instance ID to distinguish between descriptors from a peripheral with the same UUID and to make function calls that take in a descriptor identifier. Present, if this instance represents a remote characteristic. */ + instanceId?: string; + /** The currently cached descriptor value. This value gets updated when the value of the descriptor is read. */ + value?: ArrayBuffer; + } + interface RequestDevice { + /** The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. */ + address: string; + /** The human-readable name of the device. */ + name?: string; + /** The class of the device, a bit - field defined by: + * @see [Specs]{@link http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband} + **/ + deviceClass?: number; + } + interface Request { + /** Unique ID for this request. Use this ID when responding to this request. */ + requestId: number; + /** Device that send this request. */ + device: RequestDevice; + /** Value to write (if this is a write request). */ + value?: ArrayBuffer; + } + interface IProperties { + /** + * Flag indicating whether a connection to the device is left open when the event page of the application is unloaded. The default value is false. + * @see [HowToManageAppLifecycle]{@link https://developer.chrome.com/apps/app_lifecycle} + * @default false + */ + persistent: boolean; + } + interface INotification { + /** New value of the characteristic. */ + value: ArrayBuffer; + /** Optional flag for sending an indication instead of a notification. */ + shouldIndicate: boolean; + } + type AdvertisementType = 'broadcast' | 'peripheral'; + interface Advertisement { + /** Type of advertisement. */ + type: AdvertisementType; + /** List of UUIDs to include in the 'Service UUIDs' field of the Advertising Data. These UUIDs can be of the 16bit, 32bit or 128 formats. */ + serviceUuids?: string[]; + /** List of manufacturer specific data to be included in 'Manufacturer Specific Data' fields of the advertising data. */ + manufacturerData?: { id: number, data: number[] }; + /** List of UUIDs to include in the 'Solicit UUIDs' field of the Advertising Data. These UUIDs can be of the 16bit, 32bit or 128 formats. */ + solicitUuids?: string[]; + /** List of service data to be included in 'Service Data' fields of the advertising data. */ + serviceData: { uuid: string, data: number[] }; + } + interface IResponse { + /** Id of the request this is a response to. */ + requestId: number; + /** If this is an error response, this should be true. */ + isError: boolean; + /** Response value. Write requests and error responses will ignore this parameter. */ + value?: ArrayBuffer; + } + /** + * Establishes a connection between the application and the device with the given address. A device may be already connected and its GATT services available without calling connect, however, an app that wants to access GATT services of a device should call this function to make sure that a connection to the device is maintained. If the device is not connected, all GATT services of the device will be discovered after a successful call to connect. + * @param deviceAddress The Bluetooth address of the remote device to which a GATT connection should be opened. + * @param callback Called when the connect request has completed. + */ + function connect(deviceAddress: string, callback: () => void): void; + /** + * Establishes a connection between the application and the device with the given address. A device may be already connected and its GATT services available without calling connect, however, an app that wants to access GATT services of a device should call this function to make sure that a connection to the device is maintained. If the device is not connected, all GATT services of the device will be discovered after a successful call to connect. + * @param deviceAddress The Bluetooth address of the remote device to which a GATT connection should be opened. + * @param properties Connection properties (optional). + * @param callback Called when the connect request has completed. + */ + function connect(deviceAddress: string, properties: IProperties, callback: () => void): void; + /** + * Closes the app's connection to the device with the given address. Note that this will not always destroy the physical link itself, since there may be other apps with open connections. + * @param deviceAddress The Bluetooth address of the remote device. + * @param [callback] Called when the disconnect request has completed. + */ + function disconnect(deviceAddress: string, callback?: () => void): void; + /** + * Get the GATT service with the given instance ID. + * @param serviceId The instance ID of the requested GATT service. + * @param callback Called with the requested Service object. + */ + function getService(serviceId: string, callback: (result: Service) => void): void; + /** + * Create a locally hosted GATT service. This service can be registered to be available on a local GATT server. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param service The service to create. + * @param callback Called with the created services's unique ID. + */ + function createService(service: Service, callback: () => void): void; + /** + * Get all the GATT services that were discovered on the remote device with the given device address. + * Note: If service discovery is not yet complete on the device, this API will return a subset (possibly empty) of services. A work around is to add a time based delay and/or call repeatedly until the expected number of services is returned. + * @param deviceAddress The Bluetooth address of the remote device whose GATT services should be returned. + * @param callback Called with the list of requested Service objects. + */ + function getServices(deviceAddress: string, callback: (result: Service[]) => void): void; + /** + * Get the GATT characteristic with the given instance ID that belongs to the given GATT service, if the characteristic exists. + * @param characteristicId The instance ID of the requested GATT characteristic. + * @param callback Called with the requested Characteristic object. + */ + function getCharacteristic(characteristicId: string, callback: (result: Characteristic) => void): void; + /** + * Create a locally hosted GATT characteristic. This characteristic must be hosted under a valid service. If the service ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param characteristic The characteristic to create. + * @param serviceId ID of the service to create this characteristic for. + * @param callback Called with the created characteristic's unique ID. + */ + function createCharacteristic(characteristic: Characteristic, serviceId: string, callback: (characteristicId: string) => void): void; + /** + * Get a list of all discovered GATT characteristics that belong to the given service. + * @param serviceId The instance ID of the GATT service whose characteristics should be returned. + * @param callback Called with the list of characteristics that belong to the given service. + */ + function getCharacteristics(serviceId: string, callback: (result: Characteristic[]) => void): void; + /** + * Get a list of GATT services that are included by the given service. + * @param serviceId The instance ID of the GATT service whose included services should be returned. + * @param callback Called with the list of GATT services included from the given service. + */ + function getIncludedServices(serviceId: string, callback: (result: Service[]) => void): void; + /** + * Get the GATT characteristic descriptor with the given instance ID. + * @param descriptorId The instance ID of the requested GATT characteristic descriptor. + * @param callback Called with the requested Descriptor object. + */ + function getDescriptor(descriptorId: string, callback: (result: Descriptor) => void): void; + /** + * Create a locally hosted GATT descriptor. This descriptor must be hosted under a valid characteristic. If the characteristic ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param descriptor The descriptor to create. + * @param characteristicId ID of the characteristic to create this descriptor for. + * @param callback Called with the created desciptor's unique ID. + */ + function createDescriptor(descriptor: Descriptor, characteristicId: string, callback: (descriptorId: string) => void): void; + /** + * Get a list of GATT characteristic descriptors that belong to the given characteristic. + * @param characteristicId The instance ID of the GATT characteristic whose descriptors should be returned. + * @param callback Called with the list of descriptors that belong to the given characteristic. + */ + function getDescriptors(characteristicId: string, callback: (result: Descriptor[]) => void): void; + /** + * Retrieve the value of a specified characteristic from a remote peripheral. + * @param characteristicId The instance ID of the GATT characteristic whose value should be read from the remote device. + * @param callback Called with the Characteristic object whose value was requested. The value field of the returned Characteristic object contains the result of the read request. + */ + function readCharacteristicValue(characteristicId: string, callback: (result: Characteristic) => void): void; + /** + * Write the value of a specified characteristic from a remote peripheral. + * @param characteristicId The instance ID of the GATT characteristic whose value should be written to. + * @param value The value that should be sent to the remote characteristic as part of the write request. + * @param callback Called when the write request has completed. + */ + function writeCharacteristicValue(characteristicId: string, value: ArrayBuffer, callback: () => void): void; + /** + * Enable value notifications/indications from the specified characteristic. Once enabled, an application can listen to notifications using the onCharacteristicValueChanged event. + * @see onCharacteristicValueChanged + * @param characteristicId The instance ID of the GATT characteristic that notifications should be enabled on. + * @param callback Called when the request has completed. + */ + function startCharacteristicNotifications(characteristicId: string, callback: () => void): void; + /** + * Enable value notifications/indications from the specified characteristic. Once enabled, an application can listen to notifications using the onCharacteristicValueChanged event. + * @see onCharacteristicValueChanged + * @param characteristicId The instance ID of the GATT characteristic that notifications should be enabled on. + * @param properties Notification session properties (optional). + * @param callback Called when the request has completed. + */ + function startCharacteristicNotifications(characteristicId: string, properties: IProperties, callback: () => void): void; + /** + * Disable value notifications/indications from the specified characteristic. After a successful call, the application will stop receiving notifications/indications from this characteristic. + * @param characteristicId The instance ID of the GATT characteristic on which this app's notification session should be stopped. + * @param [callback] Called when the request has completed (optional). + */ + function stopCharacteristicNotifications(characteristicId: string, callback?: () => void): void; + /** + * Notify a remote device of a new value for a characteristic. + * If the shouldIndicate flag in the notification object is true, an indication will be sent instead of a notification. + * Note, the characteristic needs to correctly set the 'notify' or 'indicate' property during creation for this call to succeed. + * This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param characteristicId The characteristic to send the notication for. + * @param notification Notification object + * @param callback Callback called once the notification or indication has been sent successfully. + */ + function notifyCharacteristicValueChanged(characteristicId: string, notification: INotification, callback: () => void): void; + /** + * Retrieve the value of a specified characteristic descriptor from a remote peripheral. + * @param descriptorId The instance ID of the GATT characteristic descriptor whose value should be read from the remote device. + * @param callback Called with the Descriptor object whose value was requested. The value field of the returned Descriptor object contains the result of the read request. + */ + function readDescriptorValue(descriptorId: string, callback: (result: Descriptor) => void): void; + /** + * Write the value of a specified characteristic descriptor from a remote peripheral. + * @param descriptorId The instance ID of the GATT characteristic descriptor whose value should be written to. + * @param value The value that should be sent to the remote descriptor as part of the write request. + * @param callback Called when the write request has completed. + */ + function writeDescriptorValue(descriptorId: string, value: ArrayBuffer, callback: () => void): void; + /** + * Register the given service with the local GATT server. + * If the service ID is invalid, the lastError will be set. + * This function is only available if the app has both + * the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param serviceId Unique ID of a created service. + * @param callback Callback with the result of the register operation. + */ + function registerService(serviceId: string, callback: (result: any) => void): void; + /** + * Unregister the given service with the local GATT server. + * If the service ID is invalid, the lastError will be set. + * This function is only available if the app has both + * the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param serviceId Unique ID of a current registered service. + * @param callback Callback with the result of the register operation. + */ + function unregisterService(serviceId: string, callback: (result: any) => void): void; + /** + * Remove the specified service, unregistering it if it was registered. + * If the service ID is invalid, the lastError will be set. + * This function is only available if the app has both + * the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param serviceId Unique ID of a current registered service. + * @param [callback] Callback called once the service is removed. + */ + function removeService(serviceId: string, callback?: () => void): void; + /** + * Create an advertisement and register it for advertising. + * To call this function, the app must have + * the bluetooth:low_energy and bluetooth:peripheral permissions set to true. + * Additionally this API is only available to auto launched apps in Kiosk Mode + * of by setting the 'enable-ble-advertising-in-apps' flag. + * See https://developer.chrome.com/apps/manifest/bluetooth + * Note: On some hardware, central and peripheral modes at the same time + * is supported but on hardware that doesn't support this, + * making this call will switch the device to peripheral mode. + * In the case of hardware which does not support both central and peripheral mode, + * attempting to use the device in both modes will lead to undefined behavior + * or prevent other central-role applications from behaving correctly + * (including the discovery of Bluetooth Low Energy devices). + * @since Since Chrome 47. + * @param advertisement The advertisement to advertise. + * @param callback Called once the registeration is done and we've started advertising. Returns the id of the created advertisement. + */ + function registerAdvertisement(advertisement: Advertisement, callback: (advertisementId: number) => void): void; + /** + * Unregisters an advertisement and stops its advertising. + * If the advertisement fails to unregister the only way + * to stop advertising might be to restart the device. + * @since Since Chrome 47. + * @param advertisementId Id of the advertisement to unregister. + * @param callback Called once the advertisement is unregistered and is no longer being advertised. + */ + function unregisterAdvertisement(advertisementId: number, callback: () => void): void; + /** + * Resets advertising on the current device. It will unregister and stop all existing advertisements. + * @since Since Chrome 61. + * @param callback Called once the advertisements are reset. + */ + function resetAdvertising(callback: () => void): void; + /** + * Set's the interval betweeen two consecutive advertisements. + * Note: This is a best effort. + * The actual interval may consty non-trivially from the requested intervals. + * On some hardware, there is a minimum interval of 100ms. + * The minimum and maximum values cannot exceed the the range allowed by the Bluetooth 4.2 specification. + * @since Since Chrome 55. + * @param minInterval Minimum interval between advertisments (in milliseconds). This cannot be lower than 20ms (as per the spec). + * @param maxInterval Maximum interval between advertisments (in milliseconds). This cannot be more than 10240ms (as per the spec). + * @param callback Called once the interval has been set. + */ + function setAdvertisingInterval(minInterval: number, maxInterval: number, callback: () => void): void; + /** + * Sends a response for a characteristic or descriptor read/write request. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + * @param response The response to the request. + */ + function sendRequestResponse(response: IResponse): void; + /** Fired whan a new GATT service has been discovered on a remote device. */ + const onServiceAdded: chrome.events.Event<(service: Service) => void>; + /** + * Fired when the state of a remote GATT service changes. + * This involves any characteristics and/or descriptors + * that get added or removed from the service, as well as + * 'ServiceChanged' notifications from the remote device. + */ + const onServiceChanged: chrome.events.Event<(service: Service) => void>; + /** Fired when a GATT service that was previously discovered on a remote device has been removed. */ + const onServiceRemoved: chrome.events.Event<(service: Service) => void>; + /** + * Fired when the value of a remote GATT characteristic changes, + * either as a result of a read request, + * or a value change notification/indication. + * This event will only be sent if the app has enabled notifications + * by calling startCharacteristicNotifications. + */ + const onCharacteristicValueChanged: chrome.events.Event<(characteristic: Characteristic) => void>; + /** + * Fired when the value of a remote GATT characteristic descriptor changes, + * usually as a result of a read request. + * This event exists mostly for convenience and will always be sent after + * a successful call to readDescriptorValue. + */ + const onDescriptorValueChanged: chrome.events.Event<(descriptor: Descriptor) => void>; + /** + * Fired when a connected central device requests to read the value of + * a characteristic registered on the local GATT server. + * Not responding to this request for a long time may lead to a disconnection. + * This event is only available if the app has both the bluetooth:low_energy + * and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + */ + const onCharacteristicReadRequest: chrome.events.Event<(characteristic: Characteristic) => void>; + /** + * Fired when a connected central device requests to write the value of + * a characteristic registered on the local GATT server. + * Not responding to this request for a long time may lead to a disconnection. + * This event is only available if the app has both the bluetooth:low_energy + * and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + */ + const onCharacteristicWriteRequest: chrome.events.Event<(characteristic: Characteristic) => void>; + /** + * Fired when a connected central device requests to read the value of + * a descriptor registered on the local GATT server. + * Not responding to this request for a long time may lead to a disconnection. + * This event is only available if the app has both the bluetooth:low_energy + * and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + * @since Since Chrome 52. + */ + const onDescriptorReadRequest: chrome.events.Event<(descriptor: Descriptor) => void>; + /** + * Fired when a connected central device requests to write the value of + * a descriptor registered on the local GATT server. + * Not responding to this request for a long time may lead to a disconnection. + * This event is only available if the app has both the bluetooth:low_energy + * and the bluetooth:peripheral permissions set to true. + * The peripheral permission may not be available to all apps. + */ + const onDescriptorWriteRequest: chrome.events.Event<(descriptor: Descriptor) => void>; + } + + /** + * @since Chrome 37 + * @requires Manifest: 'bluetooth': {...} + * @requires Important: This API works only on OS X, Windows and Chrome OS. + * Use the chrome.bluetoothSocket API to send and receive data to Bluetooth devices using RFCOMM and L2CAP connections. + */ + namespace bluetoothSocket { + interface SocketProperties { + /** + * Flag indicating whether the socket is left open when + * the event page of the application is unloaded + * (see Manage App Lifecycle). The default value is false. + * When the application is loaded, any sockets previously + * opened with persistent=true can be fetched with $ref:getSockets. + */ + persistent?: boolean; + /** An application-defined string associated with the socket. */ + name?: string; + /** + * @default 4096 + * @description + * The size of the buffer used to receive data. + * */ + bufferSize?: integer; + } + interface ListenOptions { + /** + * The RFCOMM Channel used by listenUsingRfcomm. + * If specified, this channel must not be previously + * in use or the method call will fail. When not specified, + * an unused channel will be automatically allocated. + */ + channel?: integer; + /** + * The L2CAP PSM used by listenUsingL2cap. + * If specified, this PSM must not be previously + * in use or the method call with fail. When not specified, + * an unused PSM will be automatically allocated. + * */ + psm?: integer; + /** + * Length of the socket's listen queue. + * The default value depends on the operating system's host subsystem. + * */ + backlog?: number; + } + interface SocketInfo { + /** + * The socket identifier. + * */ + socketId: integer; + /** + * Flag indicating if the socket remains + * open when the event page of the application + * is unloaded (see SocketProperties.persistent). + * The default value is 'false'. + */ + persistent: boolean; + /** + * Application-defined string associated with the socket. + */ + name?: string; + /** + * The size of the buffer used to receive data. + * If no buffer size has been specified explictly, + * the value is not provided. + */ + bufferSize?: integer; + /** + * Flag indicating whether a connected socket + * blocks its peer from sending more data, or + * whether connection requests on a listening + * socket are dispatched through the onAccept + * event or queued up in the listen queue backlog. + * See setPaused. The default value is 'false'. + */ + paused: boolean; + /** + * Flag indicating whether the socket is connected to a remote peer. + */ + connected: boolean; + /** + * If the underlying socket is connected, + * contains the Bluetooth address of the device it is connected to. + */ + address?: string; + /** + * If the underlying socket is connected, + * contains information about the service + * UUID it is connected to, otherwise if + * the underlying socket is listening, + * contains information about the service + * UUID it is listening on. + */ + uuid?: string; + } + + interface CreateInfo { + /** + * The ID of the newly created socket. + * Note that socket IDs created from this + * API are not compatible with socket IDs + * created from other APIs, such as the + * sockets.tcp API. + */ + socketId: integer; + } + interface OnAcceptInfoData { + /** The server socket identifier. */ + socketId: integer; + /** + * The client socket identifier, i.e. the socket + * identifier of the newly established connection. + * This socket identifier should be used only with + * functions from the chrome.bluetoothSocket namespace. + * Note the client socket is initially paused and must + * be explictly un-paused by the application to start + * receiving data. + */ + clientSocketId: integer; + } + type OnAcceptErrorCode = + 'system_error' | + 'not_listening'; + interface OnAcceptErrorEventData { + /** The server socket identifier. */ + socketId: integer; + /** The error message */ + errorMessage: string; + /** + * An error code indicating what went wrong. + * + * system_error + * > A system error occurred and the connection may be unrecoverable. + * not_listening + * > The socket is not listening. + */ + error: OnAcceptErrorCode; + } + interface OnReceiveEventData { + /** The socket identifier. */ + socketId: integer; + /** The data received, with a maxium size of bufferSize. */ + data: ArrayBuffer; + } + type OnReceiveErrorCode = + 'disconnected' | + 'system_error' | + 'not_connected'; + interface OnReceiveErrorEventData { + /** The server socket identifier. */ + socketId: integer; + /** The error message */ + errorMessage: string; + /** + * An error code indicating what went wrong. + * + * disconnected + * > The connection was disconnected. + * system_error + * > A system error occurred and the connection may be unrecoverable. + * not_connected + * > The socket has not been connected. + */ + error: OnAcceptErrorCode; + } + interface OnAcceptEvent extends chrome.events.Event<(info: OnAcceptInfoData) => void> { } + interface OnAcceptErrorEvent extends chrome.events.Event<(info: OnAcceptErrorEventData) => void> { } + interface OnReceiveEvent extends chrome.events.Event<(info: OnReceiveEventData) => void> { } + interface OnReceiveErrorEvent extends chrome.events.Event<(info: OnReceiveErrorEventData) => void> { } + /** + * Creates a Bluetooth socket. + * @param callback Called when the socket has been created + * */ + function create(callback: (createInfo: CreateInfo) => void): void; + /** + * Creates a Bluetooth socket. + * @param properties The socket properties (optional) + * @param callback Called when the socket has been created + */ + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + /** + * Updates the socket properties. + * @param socketId The socket identifier. + * @param properties The properties to update. + * @param [callback] Called when the properties are updated. + */ + function update(socketId: integer, properties: SocketProperties, callback?: () => void): void; + /** + * Enables or disables a connected socket from + * receiving messages from its peer, or a listening + * socket from accepting new connections. The default + * value is 'false'. Pausing a connected socket is + * typically used by an application to throttle data + * sent by its peer. When a connected socket is paused, + * no onReceiveevent is raised. When a socket is connected + * and un-paused, onReceive events are raised again when + * messages are received. When a listening socket is paused, + * new connections are accepted until its backlog is full + * then additional connection requests are refused. + * onAccept events are raised only when the socket is un-paused. + * + * @param socketId The socket identifier. + * @param paused Flag indicating whether a connected socket + * blocks its peer from sending more data, or + * whether connection requests on a listening + * socket are dispatched through the onAccept + * event or queued up in the listen queue backlog. + * See setPaused. The default value is 'false'. + * @param [callback] Callback from the setPaused method. + */ + function setPaused(socketId: integer, paused: boolean, callback?: () => void): void; + /** + * Listen for connections using the RFCOMM protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param callback Called when listen operation completes. + */ + function listenUsingRfcomm(socketId: integer, uuid: string, callback: () => void): void; + /** + * Listen for connections using the RFCOMM protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param options Optional additional options for the service. + * @param callback Called when listen operation completes. + */ + function listenUsingRfcomm(socketId: integer, uuid: string, options: ListenOptions, callback: () => void): void; + /** + * Listen for connections using the L2CAP protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param callback Called when listen operation completes. + */ + function listenUsingL2cap(socketId: integer, uuid: string, callback: () => void): void; + /** + * Listen for connections using the L2CAP protocol. + * + * @param socketId The socket identifier. + * @param uuid Service UUID to listen on. + * @param options Optional additional options for the service. + * @param callback Called when listen operation completes. + */ + function listenUsingL2cap(socketId: integer, uuid: string, options: ListenOptions, callback: () => void): void; + /** + * Connects the socket to a remote Bluetooth device. + * When the connect operation completes successfully, + * onReceive events are raised when data is received + * from the peer. If a network error occur while the + * runtime is receiving packets, a onReceiveError + * event is raised, at which point no more onReceive + * event will be raised for this socket until the + * setPaused(false) method is called. + * + * @param socketId The socket identifier. + * @param address The address of the Bluetooth device. + * @param uuid The UUID of the service to connect to. + * @param callback Called when the connect attempt is complete. + */ + function connect(socketId: integer, address: string, uuid: string, callback: () => void): void; + /** + * Disconnects the socket. The socket identifier remains valid. + * @param socketId The socket identifier. + * @param [callback] Called when the disconnect attempt is complete. + */ + function disconnect(socketId: integer, callback?: () => void): void; + /** + * Disconnects and destroys the socket. + * Each socket created should be closed after use. + * The socket id is no longer valid as soon at the + * function is called. However, the socket is guaranteed + * to be closed only when the callback is invoked. + * + * @param socketId The socket identifier. + * @param callback Called when the `close` operation completes + */ + function close(socketId: integer, callback: () => void): void; + /** + * Sends data on the given Bluetooth socket. + * @param socketId The socket identifier. + * @param data The data to send. + * @param [callback] Called with the number of bytes sent. + */ + function send(socketId: integer, data: ArrayBuffer, callback?: (bytesSent: number) => void): void; + /** + * Retrieves the state of the given socket. + * @param socketId The socket identifier. + * @param callback Called when the socket state is available. + * Callback returning object containing the socket information. + */ + function getInfo(socketId: integer, callback: (socketInfo: SocketInfo) => void): void; + /** + * Retrieves the list of currently opened sockets owned by the application. + * @param callback Called when the list of sockets is available. + * Returns an array of socket info. + */ + function getSockets(callback: (sockets: SocketInfo[]) => void): void; + /** + * Event raised when a connection has been established + * for a given socket. + */ + const onAccept: OnAcceptEvent; + /** + * Event raised when a network error occurred while the + * runtime was waiting for new connections on the given + * socket. Once this event is raised, the socket is set + * to paused and no more onAccept events are raised for + * this socket. + */ + const onAcceptError: OnAcceptErrorEvent; + /** + * Event raised when data has been received for a given socket. + */ + const onReceive: OnReceiveEvent; + /** + * Event raised when a network error occured while the runtime + * was waiting for data on the socket. Once this event is raised, + * the socket is set to paused and no more onReceive events are + * raised for this socket. + */ + const onReceiveError: OnReceiveErrorEvent; + } + + ///////////// + // Browser // + ///////////// + /** + * @since Availability: Since Chrome 42. + * @requires Permissions: 'browser' + * @description * Use the chrome.browser API to interact with the Chrome browser associated with * the current application and Chrome profile. */ @@ -614,7 +1827,7 @@ declare namespace chrome { * @param callback Called when the tab was successfully * created, or failed to be created. If failed, runtime.lastError will be set. */ - export function openTab(options: Options, callback: () => void): void; + function openTab(options: Options, callback: () => void): void; /** * Opens a new tab in a browser window associated with the current application @@ -622,24 +1835,77 @@ declare namespace chrome { * a new one is opened prior to creating the new tab. Since Chrome 42 only. * @param options Configures how the tab should be opened. */ - export function openTab(options: Options): void; + function openTab(options: Options): void; } - //////////////////// - // Commands - //////////////////// + /////////////// + // Clipboard // + /////////////// /** - * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension. - * Availability: Since Chrome 25. - * Manifest: "commands": {...} + * @requires(dev) **Dev** channel only. + * @requires Permissions: "clipboard" + * @description + * *This API is* **experimental**. *It is* **only** *available to Chrome users on the* **dev** *channel.* + * The chrome.clipboard API is provided to allow users to access data of the clipboard. + * This is a temporary solution for chromeos platform apps until open-web alternative is available. + * It will be deprecated once open-web solution is available. + * @see[Docs]{@link https://developer.chrome.com/apps/clipboard} + */ + namespace clipboard { + interface AdditionalItems { + /** Type of the additional data item. */ + type: 'textPlain' | 'textHtml'; + /** + * Content of the additional data item. + * Either the plain text string if *type* is "textPlain" or + * markup string if *type* is "textHtml". + * The data can not exceed 2MB. + */ + data: string; + } + /** + * **Dev channel only.** + * Sets image data to clipboard + * @param imageData The encoded image data. *Since Chrome 69. Warning: this is the current Beta channel.* + * @param type The type of image being passed. *Since Chrome 69. Warning: this is the current Beta channel.* + * @param [additionalItems] Additional data items for describing image data. + * The callback is called with chrome.runtime.lastError set to error code if there is an error. + * Requires clipboard and clipboardWrite permissions. + * *Since Chrome 69. Warning: this is the current Beta channel.* + * @param [callback] + */ + function setImageData(imageData: ArrayBuffer, type: 'png' | 'jpeg', additionalItems?: AdditionalItems, callback?: () => void): void; + + /** + * **Dev channel only.** + * Fired when clipboard data changes. + * Requires clipboard and clipboardRead permissions for adding listener to + * chrome.clipboard.onClipboardDataChanged event. After this event fires, the + * clipboard data is available by calling document.execCommand('paste'). + */ + const onClipboardDataChanged: chrome.events.Event<() => void>; + } + + ////////////// + // Commands // + ////////////// + /** + * @since Availability: Since Chrome 35. + * @requires Manifest: 'commands': {...} + * @description + * Use the commands API to add keyboard shortcuts that + * trigger actions in your app, for example, an + * action to open the browser action or send a command + * to the app. + * @see[Usage]{@link https://developer.chrome.com/apps/commands} */ namespace commands { interface Command { - /** Optional. The name of the Extension Command */ + /** The name of the Extension Command */ name?: string; - /** Optional. The Extension Command description */ + /** The Extension Command description */ description?: string; - /** Optional. The shortcut active for this command, or blank if not active. */ + /** The shortcut active for this command, or blank if not active. */ shortcut?: string; } @@ -648,244 +1914,343 @@ declare namespace chrome { /** * Returns all the registered extension commands for this extension and their shortcut (if active). * @param callback Called to return the registered commands. - * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Command commands) {...}; */ - export function getAll(callback: (commands: Command[]) => void): void; + function getAll(callback: (commands: Command[]) => void): void; /** Fired when a registered command is activated using a keyboard shortcut. */ - export var onCommand: CommandEvent; + const onCommand: CommandEvent; } - //////////////////// - // Context Menus - //////////////////// + /////////////////// + // Context Menus // + /////////////////// /** - * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. - * Availability: Since Chrome 6. - * Permissions: "contextMenus" + * @since Availability: Since Chrome 24. + * @requires Permissions: 'contextMenus' + * @description + * Use the chrome.contextMenus API to add items to Google Chrome's context menu. + * You can choose what types of objects your context menu additions apply to, + * such as images, hyperlinks, and pages. + * + * Context menu items can appear in any document (or frame within a document), + * even those with file:// or chrome:// URLs. To control which documents your + * items can appear in, specify the documentUrlPatterns field when you call the + * create() or update() method. + * + * You can create as many context menu items as you need, + * but if more than one from your app is visible at once, + * Google Chrome automatically collapses them into a single parent menu. */ namespace contextMenus { + /** + * @since Chrome 38. + * @default 6 + * @description + * The maximum number of top level extension items that + * can be added to an extension action context menu. + * Any items beyond this limit will be ignored. + */ + const ACTION_MENU_TOP_LEVEL_LIMIT: number; /** * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu. **/ - export type ContextType = "all" | "page" | "frame" | "selection" | "link" | "editable" | "image" | "video" | "audio" | "launcher" | "browser_action" | "page_action"; + type ContextType = + 'all' | + 'page' | + 'frame' | + 'selection' | + 'link' | + 'editable' | + 'image' | + 'video' | + 'audio' | + 'launcher' | + 'browser_action' | + 'page_action'; /** * The type of menu item. **/ - export type ItemType = "normal" | "checkbox" | "radio" | "separator"; + type ItemType = + 'normal' | + 'checkbox' | + 'radio' | + 'separator'; + type MediaType = + 'image' | + 'video' | + 'audio'; interface OnClickData { /** - * Optional. - * @since Since Chrome 35. - * The text for the context selection, if any. - */ - selectionText?: string; - /** - * Optional. - * @since Since Chrome 35. - * A flag indicating the state of a checkbox or radio item after it is clicked. - */ - checked?: boolean; - /** - * @since Since Chrome 35. * The ID of the menu item that was clicked. - */ - menuItemId: any; - /** - * Optional. * @since Since Chrome 35. - * The URL of the frame of the element where the context menu was clicked, if it was in a frame. */ - frameUrl?: string; + menuItemId: integer | string; + /** + * The parent ID, if any, for the item clicked. * @since Since Chrome 35. - * A flag indicating whether the element is editable (text input, textarea, etc.). */ - editable: boolean; + parentMenuItemId?: integer | string; + /** - * Optional. + * One of 'image', 'video', or 'audio' if the context menu was + * activated on one of these types of elements. * @since Since Chrome 35. - * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. */ - mediaType?: string; + mediaType?: MediaType; + /** - * Optional. - * @since Since Chrome 35. - * A flag indicating the state of a checkbox or radio item before it was clicked. - */ - wasChecked?: boolean; - /** - * @since Since Chrome 35. - * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu. - */ - pageUrl: string; - /** - * Optional. - * @since Since Chrome 35. * If the element is a link, the URL it points to. + * @since Since Chrome 35. */ linkUrl?: string; + /** - * Optional. - * @since Since Chrome 35. - * The parent ID, if any, for the item clicked. - */ - parentMenuItemId?: any; - /** - * Optional. - * @since Since Chrome 35. * Will be present for elements with a 'src' URL. + * @since Since Chrome 35. */ srcUrl?: string; + + /** + * The URL of the page where the menu item was clicked. + * This property is not set if the click occured in a + * context where there is no current page, such as in + * a launcher context menu. + * @since Since Chrome 35. + */ + pageUrl: string; + + /** + * The URL of the frame of the element where the context menu was clicked, + * if it was in a frame. + * @since Since Chrome 35. + */ + frameUrl?: string; + + /** + * The ID of the frame of the element where the context menu was clicked, + * if it was in a frame. + * @since Since Chrome 35. + */ + frameId?: integer; + + /** + * The text for the context selection, if any. + * @since Since Chrome 35. + */ + selectionText?: string; + + /** + * A flag indicating whether the element is editable (text input, textarea, etc.). + * @since Since Chrome 35. + */ + editable: boolean; + + /** + * A flag indicating the state of a checkbox or radio item before it was clicked. + * @since Since Chrome 35. + */ + wasChecked?: boolean; + + /** + * A flag indicating the state of a checkbox or radio item after it is clicked. + * @since Since Chrome 35. + */ + checked?: boolean; } interface CreateProperties { - /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ - documentUrlPatterns?: string[]; - /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */ - checked?: boolean; - /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */ - title?: string; - /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ - contexts?: string[]; + /** The type of menu item. Defaults to 'normal' if not specified. */ + type?: ItemType; + /** - * Optional. - * Whether this context menu item is enabled or disabled. Defaults to true. - * @since Since Chrome 20. + * The unique ID to assign to this item. + * Mandatory for event pages. + * Cannot be the same as another ID for this extension. */ - enabled?: boolean; - /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: string[]; + id?: string; + + /** + * The text to be displayed in the item; + * this is required unless type is 'separator'. + * When the context is 'selection', you can use + * %s within the string to show the selected text. + * For example, if this parameter's value is + * 'Translate '%s' to Pig Latin' and the user + * selects the word 'cool', the context menu + * item for the selection is 'Translate 'cool' + * to Pig Latin'. + **/ + title?: string; + + /** + * The initial state of a checkbox or radio item: + * true for selected and false for unselected. + * Only one radio item can be selected at a time + * in a given group of radio items. + **/ + checked?: boolean; + + /** + * List of contexts this menu item will appear in. + * Defaults to ['page'] if not specified. + **/ + contexts?: ContextType[]; + + /** + * Whether the item is visible in the menu. + * @since Since Chrome 62. + */ + visible?: boolean; + /** - * Optional. * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked. * @param info Information sent when a context menu item is clicked. */ onclick?: (info: OnClickData) => void; - /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */ - parentId?: any; - /** Optional. The type of menu item. Defaults to 'normal' if not specified. */ - type?: string; + + /** The ID of a parent menu item; this makes the item a child of a previously added item. */ + parentId?: integer | string; + /** - * Optional. - * @since Since Chrome 21. - * @description The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. - */ - id?: string; + * Lets you restrict the item to apply only to documents whose URL + * matches one of the given patterns. (This applies to frames as well.) + * For details on the format of a pattern, see Match Patterns. + **/ + documentUrlPatterns?: string[]; + /** - * @description Whether the item is visible in the menu. - * @since Since Chrome 62 + * Similar to documentUrlPatterns, + * but lets you filter based on the src attribute + * of img/audio/video tags and the href of anchor tags. + **/ + targetUrlPatterns?: string[]; + + /** + * Whether this context menu item is enabled or disabled. + * @default true */ - visible?: boolean; + enabled?: boolean; } interface UpdateProperties { - documentUrlPatterns?: string[]; - checked?: boolean; + type?: ItemType; title?: string; - contexts?: string[]; + checked?: boolean; + contexts?: ContextType[]; /** - * @since Chrome 20 - **/ - enabled?: boolean; - targetUrlPatterns?: string[]; - onclick?: (info: OnClickData) => void; - /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */ - parentId?: any; - type?: string; - /** - * @description Whether the item is visible or not. - * @since Since Chrome 62 + * Whether the item is visible in the menu. + * @since Chrome 62. */ visible?: boolean; + /** + * Information sent when a context menu item is clicked. + * @since Chrome 44 + */ + onclick?: (info: OnClickData) => void; + /** Note: You cannot change an item to be a child of one of its own descendants. */ + parentId?: integer | string; + documentUrlPatterns?: string[]; + targetUrlPatterns?: string[]; + enabled?: boolean; } interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData) => void> { } /** - * Since Chrome 38. - * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored. + * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). + * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. */ - export var ACTION_MENU_TOP_LEVEL_LIMIT: number; + function create(createProperties: CreateProperties, callback?: () => void): void; + + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + */ + function update(id: integer | string, updateProperties: UpdateProperties, callback?: () => void): void; + + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + */ + function remove(menuItemId: integer | string, callback?: () => void): void; /** * Removes all context menu items added by this extension. * @param callback Called when removal is complete. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function removeAll(callback?: () => void): void; - /** - * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). - * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function create(createProperties: CreateProperties, callback?: () => void): void; - /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void; - /** - * Updates a previously created context menu item. - * @param id The ID of the item to update. - * @param updateProperties The properties to update. Accepts the same values as the create function. - * @param callback Called when the context menu has been updated. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void; - /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function remove(menuItemId: string, callback?: () => void): void; - /** - * Removes a context menu item. - * @param menuItemId The ID of the context menu item to remove. - * @param callback Called when the context menu has been removed. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; - */ - export function remove(menuItemId: number, callback?: () => void): void; + function removeAll(callback?: () => void): void; - /** - * Since Chrome 21. - * Fired when a context menu item is clicked. - */ - export var onClicked: MenuClickedEvent; + /** Fired when a context menu item is clicked. */ + const onClicked: MenuClickedEvent; } //////////////////// - // Document Scan + // DesktopCapture // //////////////////// /** - * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. - * Availability: Since Chrome 44. - * Permissions: "documentScan" - * Important: This API works only on Chrome OS. + * Desktop Capture API that can be used to capture content of screen, + * individual windows or tabs. + * @since Availability: Since Chrome 34. + * @requires Permissions: "desktopCapture" + */ + namespace desktopCapture { + const DesktopCaptureSourceType: { + SCREEN: "screen", + WINDOW: "window", + TAB: "tab", + AUDIO: "audio" + } + + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + function chooseDesktopMedia + (sources: Array, callback: (streamId: string) => void): number; + /** + * Hides desktop media picker dialog shown by chooseDesktopMedia(). + * @param desktopMediaRequestId Id returned by chooseDesktopMedia() + */ + function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; + } + + /////////////////// + // Document Scan // + /////////////////// + /** + * Use the chrome.documentScan API to discover and retrieve + * images from attached paper document scanners. + * + * The Document Scan API is designed to allow apps to view + * the content of paper documents on an attached document scanner. + * + * *Note: This API depends on OS features that may not be available* + * *depending on the underlying operating system. As of this writing only* + * *Chrome OS for certain USB-attached devices is known to successfully work.* + * + * @since Availability: Since Chrome 44. + * @requires Permissions: 'documentScan' + * @requires Important: This API works only on Chrome OS. */ namespace documentScan { interface DocumentScanOptions { - /** Optional. The MIME types that are accepted by the caller. */ + /** The MIME types that are accepted by the caller. */ mimeTypes?: string[]; - /** Optional. The number of scanned images allowed (defaults to 1). */ + /** The number of scanned images allowed (defaults to 1). */ maxImages?: number; } interface DocumentScanCallbackArg { - /** The data image URLs in a form that can be passed as the "src" value to an image tag. */ + /** The data image URLs in a form that can be passed as the 'src' value to an image tag. */ dataUrls: string[]; /** The MIME type of dataUrls. */ mimeType: string; @@ -895,72 +2260,101 @@ declare namespace chrome { * Performs a document scan. On success, the PNG data will be sent to the callback. * @param options Object containing scan parameters. * @param callback Called with the result and data from the scan. - * The callback parameter should be a function that looks like this: - * function(object result) {...}; */ - export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; + function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; } - //////////////////// - // Events - //////////////////// + //////////// + // Events // + //////////// /** - * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. - * Availability: Since Chrome 21. + * The chrome.events namespace contains common types used by APIs + * dispatching events to notify you when something interesting happens. + * + * An Event is an object that allows you to be notified when something interesting happens. + * Here's an example of using the chrome.alarms.onAlarm event to be notified whenever an alarm has elapsed: + * @example + * chrome.alarms.onAlarm.addListener(function(alarm) { + * appendToLog('alarms.onAlarm --' + * + ' name: ' + alarm.name + * + ' scheduledTime: ' + alarm.scheduledTime); + * }); + * @description + * As the example shows, you register for notification using addListener(). + * The argument to addListener() is always a function that you define to + * handle the event, but the parameters to the function depend on which + * event you're handling. Checking the documentation for alarms.onAlarm, + * you can see that the function has a single parameter: an alarms.Alarm + * object that has details about the elapsed alarm. + * @since Availability: Since Chrome 25. */ namespace events { - /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + /** Filters URLs for constious criteria. See event filtering. All criteria are case sensitive. */ interface UrlFilter { - /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ - schemes?: string[]; /** - * Optional. - * Since Chrome 23. - * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Matches if the host name of the URL contains a specified string. + * To test whether a host name component has a prefix 'foo', + * use hostContains: '.foo'. This matches 'www.foobar.com' and + * 'foo.com', because an implicit dot is added at the beginning of + * the host name. Similarly, hostContains can be used to match + * against component suffix ('foo.') and to exactly match against + * components ('.foo.'). Suffix- and exact-matching for the last + * components need to be done separately using hostSuffix, because + * no implicit dot is added at the end of the host name. + **/ + hostContains?: string; + /** Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Matches if the path segment of the URL starts with a specified string. */ + pathEquals?: string; + /** Matches if the path segment of the URL ends with a specified string. */ + pathPrefix?: string; + /** Matches if the path segment of the URL is equal to a specified string. */ + pathSuffix?: string; + /** Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Matches if the URL (without fragment identifier) matches a specified regular expression. + * Port numbers are stripped from the URL if they match the default port number. + * The regular expressions use the RE2 syntax. + * @see[RE2 syntax docs]{@link https://github.com/google/re2/blob/master/doc/syntax.txt} */ urlMatches?: string; - /** Optional. Matches if the path segment of the URL contains a specified string. */ - pathContains?: string; - /** Optional. Matches if the host name of the URL ends with a specified string. */ - hostSuffix?: string; - /** Optional. Matches if the host name of the URL starts with a specified string. */ - hostPrefix?: string; - /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ - hostContains?: string; - /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlContains?: string; - /** Optional. Matches if the query segment of the URL ends with a specified string. */ - querySuffix?: string; - /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlPrefix?: string; - /** Optional. Matches if the host name of the URL is equal to a specified string. */ - hostEquals?: string; - /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlEquals?: string; - /** Optional. Matches if the query segment of the URL contains a specified string. */ - queryContains?: string; - /** Optional. Matches if the path segment of the URL starts with a specified string. */ - pathPrefix?: string; - /** Optional. Matches if the path segment of the URL is equal to a specified string. */ - pathEquals?: string; - /** Optional. Matches if the path segment of the URL ends with a specified string. */ - pathSuffix?: string; - /** Optional. Matches if the query segment of the URL is equal to a specified string. */ - queryEquals?: string; - /** Optional. Matches if the query segment of the URL starts with a specified string. */ - queryPrefix?: string; - /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ - urlSuffix?: string; - /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ - ports?: any[]; /** - * Optional. - * Since Chrome 28. - * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + * Matches if the URL without query segment and fragment identifier matches a specified regular expression. + * Port numbers are stripped from the URL if they match the default port number. + * The regular expressions use the RE2 syntax. + * @see[RE2 syntax docs]{@link https://github.com/google/re2/blob/master/doc/syntax.txt} + * @since Since Chrome 28. */ originAndPathMatches?: string; + /** Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** + * Matches if the port of the URL is contained in any of the specified port lists. + * For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. + */ + ports?: Array; } - /** An object which allows the addition and removal of listeners for a Chrome event. */ interface Event { /** @@ -988,9 +2382,11 @@ declare namespace chrome { */ getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; /** - * @param callback Listener whose registration status shall be tested. + * Has this event this provided listener? + * @param listener Listener whose registration status shall be tested. + * @return If it has the provided listener */ - hasListener(callback: T): boolean; + hasListener(callback: T | Function): boolean; /** * Unregisters currently registered rules. * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. @@ -1002,169 +2398,313 @@ declare namespace chrome { /** * Unregisters currently registered rules. * @param callback Called when rules were unregistered. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ removeRules(callback?: () => void): void; /** * Registers rules to handle events. * @param rules Rules to be registered. These do not replace previously registered rules. * @param callback Called with registered rules. - * If you specify the callback parameter, it should be a function that looks like this: - * function(array of Rule rules) {...}; * Parameter rules: Rules that were registered, the optional parameters are filled with values. */ addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void; /** * Deregisters an event listener callback from an event. * @param callback Listener that shall be unregistered. - * The callback parameter should be a function that looks like this: - * function() {...}; */ removeListener(callback: T): void; + /** + * Has this event listeners? + */ hasListeners(): boolean; } /** Description of a declarative rule for handling events. */ interface Rule { - /** Optional. Optional priority of this rule. Defaults to 100. */ - priority?: number; - /** List of conditions that can trigger the actions. */ - conditions: any[]; - /** Optional. Optional identifier that allows referencing this rule. */ + /** Identifier that allows referencing this rule. */ id?: string; - /** List of actions that are triggered if one of the condtions is fulfilled. */ - actions: any[]; + /** - * Optional. - * Since Chrome 28. * Tags can be used to annotate rules and perform operations on sets of rules. + * @since Since Chrome 28. */ tags?: string[]; + + /** List of conditions that can trigger the actions. */ + conditions: any[]; + + /** List of actions that are triggered if one of the condtions is fulfilled. */ + actions: any[]; + + /** + * Optional priority of this rule. + * @default 100 + */ + priority?: integer; } } - //////////////////// - // Extension Types - //////////////////// + ///////////////////// + // Extension Types // + ///////////////////// /** * Primary for extensions, but also used in apps. * https://developer.chrome.com/extensions/extensionTypes#type-ImageDetails + * @since Chrome 39. **/ namespace extensionTypes { /** * The format of an image. **/ - export type ImageFormat = 'jpeg' | 'png'; + type ImageFormat = + 'jpeg' | + 'png'; /** * Details about the format and quality of an image. */ interface ImageDetails { - /** - * @description The format of the resulting image. Default is "jpeg". - * @type {ImageFormat} - * @memberof ImageDetails - */ + /** The format of the resulting image. Default is 'jpeg'. */ format?: ImageFormat; + /** - * @description When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. - * @type {number} - * @memberof ImageDetails + * When format is 'jpeg', controls the quality of the resulting image. + * This value is ignored for PNG images. As quality is decreased, + * the resulting image will have more visual artifacts, + * and the number of bytes needed to store it will decrease. */ quality?: number; } /** * The soonest that the JavaScript or CSS will be injected into the tab. **/ - export type RunAt = 'document_start' | 'document_end' | 'document_idle'; + type RunAt = + 'document_start' | + 'document_end' | + 'document_idle'; /** * The origin of injected CSS. **/ - export type CSSOrigin = 'author' | 'user'; + type CSSOrigin = + 'author' | + 'user'; /** - * @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. - * @interface InjectDetails + * Internal interfaces, not to be used directly + * @private + * @internal */ - interface InjectDetails { + namespace _internal_ { + /** + * Partial, use these interfaces instead: + * @see InjectCodeDetails + * @see InjectFileDetails + */ + interface InjectDetailsBase { + /** + * If allFrames is true, implies that the JavaScript or CSS should be + * injected into all frames of current page. By default, it's false + * and is only injected into the top frame. If true and frameId is set, + * then the code is inserted in the selected frame and all of its child frames. + */ + allFrames?: boolean; + /** + * The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame). + * @see[frame ref]{@link https://developer.chrome.com/apps/webNavigation#frame_ids} + * @since Since Chrome 50. + */ + frameId?: number; + /** + * If matchAboutBlank is true, then the code is also injected in about:blank + * and about:srcdoc frames if your extension has access to its parent document. + * Code cannot be inserted in top-level about:-frames. By default it is false. + */ + matchAboutBlank?: boolean; + /** + * The soonest that the JavaScript or CSS will be injected into the tab. + * @default 'document_idle' + */ + runAt: RunAt; + /** + * The origin of the CSS to inject. + * This may only be specified for CSS, not JavaScript. + * @default 'author' + * @since Since Chrome 66. + */ + cssOrigin: CSSOrigin; + } + } + + interface InjectFileDetails extends _internal_.InjectDetailsBase { + /** JavaScript or CSS file to inject. */ + file: string; + } + + interface InjectCodeDetails extends _internal_.InjectDetailsBase { /** * JavaScript or CSS code to inject. - * Warning: - * Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. - * @type {string} - * @memberof InjectDetails + * **Warning** + * Be careful using the code parameter. + * Incorrect use of it may open your app + * to cross site scripting attacks. + * @see[More information]{https://en.wikipedia.org/wiki/Cross-site_scripting} */ - code?: string; - /** - * @description JavaScript or CSS file to inject. - * @type {string} - * @memberof InjectDetails - */ - file?: string; - /** - * @description If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. If true and frameId is set, then the code is inserted in the selected frame and all of its child frames. - * @type {boolean} - * @memberof InjectDetails - */ - allFrames?: boolean; - /** - * @description The frame where the script or CSS should be injected. Defaults to 0 (the top-level frame). - * @since Since Chrome 50. - * @type {number} - * @memberof InjectDetails - */ - frameId?: number; - /** - * @description If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. - * @type {boolean} - * @memberof InjectDetails - */ - matchAboutBlank?: boolean; - /** - * @description The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". - * @type {RunAt} - * @memberof InjectDetails - */ - runAt: RunAt; - /** - * @description The origin of the CSS to inject. This may only be specified for CSS, not JavaScript. Defaults to "author". - * @since Since Chrome 66. - * @type {CSSOrigin} - * @memberof InjectDetails - */ - cssOrigin: CSSOrigin; + code: string; } } - //////////////////// - // FileSystem - //////////////////// + //////////////// + // FileSystem // + //////////////// + /** + * Use the chrome.fileSystem API to create, read, navigate, and write to the user's local file system. + * With this API, Chrome Apps can read and write to a user-selected location. + * For example, a text editor app can use the API to read and write local documents. + * All failures are notified via chrome.runtime.lastError. + * @since Availability: Since Chrome 24. + * @requires Permissions: + * 'fileSystem' + * {'fileSystem': ['write']} + * {'fileSystem': ['write', 'retainEntries', 'directory']} + */ namespace fileSystem { - + type ChildChangeType = + 'created' | + 'removed' | + 'changed'; + type ChooseEntryOptionsTypes = + 'openFile' | + 'openWritableFile' | + 'saveFile' | + 'openDirectory'; interface AcceptOptions { + /** + * This is the optional text description for this option. + * If not present, a description will be automatically generated; + * typically containing an expanded list of valid extensions (e.g. 'text/html' may expand to '*.html, *.htm'). + */ description?: string; + /** + * Mime-types to accept, e.g. 'image/jpeg' or 'audio/*'. One of mimeTypes or extensions must contain at least one valid element. + */ mimeTypes?: string[]; + /** + * Extensions to accept, e.g. 'jpg', 'gif', 'crx'. + */ extensions?: string[]; } interface ChooseEntryOptions { - type?: string; + /** + * Type of the prompt to show. The default is 'openFile'. + * openFile + * - Prompts the user to open an existing file and returns a FileEntry on success. + * From Chrome 31 onwards, the FileEntry will be writable if the application has + * the 'write' permission under 'fileSystem'; otherwise, the FileEntry will be read-only. + * openWritableFile + * - Prompts the user to open an existing file and returns a writable FileEntry on success. + * Calls using this type will fail with a runtime error if the application doesn't have the + * 'write' permission under 'fileSystem'. + * saveFile + * - Prompts the user to open an existing file or a new file and returns a writable FileEntry + * on success. Calls using this type will fail with a runtime error if the application doesn't + * have the 'write' permission under 'fileSystem'. + * openDirectory + * - Prompts the user to open a directory and returns a DirectoryEntry on success. Calls using + * this type will fail with a runtime error if the application doesn't have the 'directory' + * permission under 'fileSystem'. If the application has the 'write' permission under + * 'fileSystem', the returned DirectoryEntry will be writable; otherwise it will be read-only. + * New in Chrome 31. + */ + type?: ChooseEntryOptionsTypes; + /** The suggested file name that will be presented to the user as the default name to read or write. */ suggestedName?: string; + /** The optional list of accept options for this file opener. Each option will be presented as a unique group to the end-user. */ accepts?: AcceptOptions[]; + /** + * Whether to accept all file types, in addition to the options specified in the accepts argument. + * The default is true. If the accepts field is unset or contains no valid entries, this will always be reset to true. + */ acceptsAllTypes?: boolean; + /** + * Whether to accept multiple files. This is only supported for openFile and openWritableFile. + * The callback to chooseEntry will be called with a list of entries if this is set to true. + * Otherwise it will be called with a single Entry. + * @since Chrome 30. + */ acceptsMultiple?: boolean; } - export function getDisplayPath(entry: Entry, callback: (displayPath: string) => void): void; - export function getWritableEntry(entry: Entry, callback: (entry: Entry) => void): void; - export function isWritableEntry(entry: Entry, callback: (isWritable: boolean) => void): void; - export function chooseEntry(callback: (entry: Entry) => void): void; - export function chooseEntry(callback: (fileEntries: FileEntry[]) => void): void; - export function chooseEntry(options: ChooseEntryOptions, callback: (entry: Entry) => void): void; - export function chooseEntry(options: ChooseEntryOptions, callback: (fileEntries: FileEntry[]) => void): void; - export function restoreEntry(id: string, callback: (entry: Entry) => void): void; - export function isRestorable(id: string, callback: (isRestorable: boolean) => void): void; - export function retainEntry(entry: Entry): string; + /** + * @since Chrome 44. + */ + interface Volume { + /** The ID of the requested volume. */ + volumeId: string; + /** + * Whether the requested file system should be writable. The default is read-only. + * @default false + **/ + writable?: boolean; + } + + /** + * Get the display path of an Entry object. + * The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes. + */ + function getDisplayPath(entry: Entry, callback: (displayPath: string) => void): void; + /** + * Get a writable Entry from another Entry. This call will fail with a runtime error if the application does not have the 'write' permission under 'fileSystem'. + * If entry is a DirectoryEntry, this call will fail if the application does not have the 'directory' permission under 'fileSystem'. + */ + function getWritableEntry(entry: Entry, callback: (entry: Entry) => void): void; + /** Gets whether this Entry is writable or not. */ + function isWritableEntry(entry: Entry, callback: (isWritable: boolean) => void): void; + /** Ask the user to choose a file or directory. */ + function chooseEntry(callback: (entry: Entry) => void): void; + /** Ask the user to choose a file or directory. */ + function chooseEntry(callback: (fileEntries: FileEntry[]) => void): void; + /** Ask the user to choose a file or directory. */ + function chooseEntry(options: ChooseEntryOptions, callback: (entry: Entry) => void): void; + /** Ask the user to choose a file or directory. */ + function chooseEntry(options: ChooseEntryOptions, callback: (fileEntries: FileEntry[]) => void): void; + /** Returns the file entry with the given id if it can be restored. This call will fail with a runtime error otherwise. */ + function restoreEntry(id: string, callback: (entry: Entry) => void): void; + /** + * Returns whether the app has permission to restore the entry with the given id. + * @since Chrome 29. + **/ + function isRestorable(id: string, callback: (isRestorable: boolean) => void): void; + /** + * Returns an id that can be passed to restoreEntry to regain access to a given file entry. + * Only the 500 most recently used entries are retained, where calls to retainEntry and restoreEntry count as use. + * If the app has the 'retainEntries' permission under 'fileSystem', entries are retained indefinitely. + * Otherwise, entries are retained only while the app is running and across restarts. + * @since Chrome 29. + * */ + function retainEntry(entry: Entry): string; + /** + * Requests access to a file system for a volume represented by options.volumeId. + * If options.writable is set to true, then the file system will be writable. + * Otherwise, it will be read-only. + * The writable option requires the 'fileSystem': {'write'} permission in the manifest. + * Available to kiosk apps running in kiosk session only. + * For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. + * In case of an error, fileSystem will be undefined, and chrome.runtime.lastError will be set. + * @since Chrome 44. + */ + function requestFileSystem(options: Volume, callback: (fileSystem: FileSystem) => void): void; + /** + * Returns a list of volumes available for requestFileSystem(). + * The 'fileSystem': {'requestFileSystem'} manifest permission is required. + * Available to kiosk apps running in the kiosk session only. + * In case of an error, volumes will be undefined, and chrome.runtime.lastError will be set. + * @since Chrome 44. + */ + function getVolumeList(callback: (volumes: Volume[]) => void): void; + /** + * Called when a list of available volumes is changed. + * @since Chrome 44. + */ + const onVolumeListChanged: chrome.events.Event<(object: Volume[]) => void>; } @@ -1172,76 +2712,161 @@ declare namespace chrome { // File System Provider //////////////////// /** - * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. - * Availability: Since Chrome 40. - * Permissions: "fileSystemProvider" - * Important: This API works only on Chrome OS. + * Use the chrome.fileSystemProvider API to create file systems, + * that can be accessible from the file manager on Chrome OS. + * @since Availability: Since Chrome 40. + * @requires Permissions: 'fileSystemProvider' + * @requires Important: This API works only on Chrome OS. + * @requires Manifest: + * Requires an section in addition to the permission. + * The file_system_provider section must be declared as follows: + * **configurable (boolean)** - optional + * Whether configuring via onConfigureRequested is supported. By default: false. + * **multiple_mounts (boolean)** - optional + * Whether multiple (more than one) mounted file systems are supported. By default: false. + * **watchable (boolean)** - optional + * Whether setting watchers and notifying about changes is supported. By default: false. + * **source (type of 'file', 'device', or 'network') - required** + * Source of data for mounted file systems. + * @description + * Files app uses above information in order to render related UI elements approprietly. + * For example, if configurable is set to true, then a menu item for configuring volumes + * will be rendered. Similarly, if multiple_mounts is set to true, then Files app will + * allow to add more than one mount points from the UI. If watchable is false, then a + * refresh button will be rendered. Note, that if possible you should add support for + * watchers, so changes on the file system can be reflected immediately and automatically. + * @see[More information]{@link https://developer.chrome.com/apps/fileSystemProvider} */ namespace fileSystemProvider { - interface OpenedFileInfo { - /** A request ID to be be used by consecutive read/write and close requests. */ - openRequestId: number; - /** The path of the opened file. */ - filePath: string; - /** Whether the file was opened for reading or writing. */ - mode: string; - } - - interface FileWatchersInfo { - /** The path of the entry being observed. */ - entryPath: string; - /** Whether watching should include all child entries recursively. It can be true for directories only. */ - recursive: boolean; - /** Optional. Tag used by the last notification for the watcher. */ - lastTag?: string; - } + /** + * Error codes used by providing extensions in response to requests + * as well as in case of errors when calling methods of the API. + * For success, 'OK' must be used. + * */ + type ProviderError = + 'OK' | + 'FAILED' | + 'IN_USE' | + 'EXISTS' | + 'NOT_FOUND' | + 'ACCESS_DENIED' | + 'TOO_MANY_OPENED' | + 'NO_MEMORY' | + 'NO_SPACE' | + 'NOT_A_DIRECTORY' | + 'INVALID_OPERATION' | + 'SECURITY' | + 'ABORT' | + 'NOT_A_FILE' | + 'NOT_EMPTY' | + 'INVALID_URL' | + 'IO'; + /** Mode of opening a file. Used by onOpenFileRequested. */ + type OpenFileMode = + 'READ' | + 'WRITE'; + /** Type of a change detected on the observed directory. */ + type ChangeType = + 'CHANGED' | + 'DELETED'; + /** + * List of common actions. 'SHARE' is for sharing files with others. + * 'SAVE_FOR_OFFLINE' for pinning (saving for offline access). + * 'OFFLINE_NOT_NECESSARY' for notifying that the file doesn't + * need to be stored for offline access anymore. + * Used by onGetActionsRequested and onExecuteActionRequested. + */ + type CommonActionId = + 'SAVE_FOR_OFFLINE' | + 'OFFLINE_NOT_NECESSARY' | + 'SHARE'; interface EntryMetadata { - /** True if it is a directory. */ - isDirectory: boolean; - /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */ - name: string; - /** File size in bytes. */ - size: number; + /** True if it is a directory. Must be provided if requested in options */ + isDirectory?: boolean; + /** + * Name of this entry (not full path name). + * Must not contain '/'. + * For root it must be empty. + * Must be provided if requested in options. + **/ + name?: string; + /** File size in bytes. Must be provided if requested in options. */ + size?: double; /** The last modified time of this entry. */ - modificationTime: Date; - /** Optional. Mime type for the entry. */ + modificationTime?: Date; + /** Mime type for the entry. */ mimeType?: string; - /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */ + /** + * Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. + * Optional, but can be provided only when explicitly requested + * by the onGetMetadataRequested event. + */ thumbnail?: string; } interface FileSystemInfo { /** The identifier of the file system. */ fileSystemId: string; + /** A human-readable name for the file system. */ displayName: string; - /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + + /** + * Whether the file system supports operations which may + * change contents of the file system (such as creating, deleting or writing to files). + */ writable: boolean; + /** * The maximum number of files that can be opened at once. If 0, then not limited. * @since Since Chrome 42. */ - openedFilesLimit: number; + openedFilesLimit: integer; + /** * List of currently opened files. * @since Since Chrome 42. */ openedFiles: OpenedFileInfo[]; + /** - * Optional. - * Whether the file system supports the tag field for observing directories. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Whether the file system supports the tag field for observing directories. + * @since Since Chrome 45. */ supportsNotifyTag?: boolean; + /** * List of watchers. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * @since Since Chrome 45. */ watchers: FileWatchersInfo[]; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface OpenedFileInfo { + /** A request ID to be be used by consecutive read/write and close requests. */ + openRequestId: integer; + /** The path of the opened file. */ + filePath: string; + /** Whether the file was opened for reading or writing. */ + mode: OpenFileMode; + } + + interface FileWatchersInfo { + /** The path of the entry being observed. */ + entryPath: string; + + /** + * Whether watching should include all child entries recursively. + * It can be true for directories only. + */ + recursive: boolean; + + /** Tag used by the last notification for the watcher. */ + lastTag?: string; + } + + /** @since Since Chrome 45. */ interface GetActionsRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; @@ -1251,15 +2876,14 @@ declare namespace chrome { entryPath: string; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ interface Action { /** The identifier of the action. Any string or CommonActionId for common actions. */ - id: string; - /** Optional. The title of the action. It may be ignored for common actions. */ + id: CommonActionId | string; + /** The title of the action. It may be ignored for common actions. */ title?: string; } - /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + /** @since Since Chrome 45. */ interface ExecuteActionRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; @@ -1276,20 +2900,27 @@ declare namespace chrome { fileSystemId: string; /** A human-readable name for the file system. */ displayName: string; - /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + /** + * Whether the file system supports operations which may change contents + * of the file system (such as creating, deleting or writing to files). + */ writable?: boolean; /** - * Optional. - * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. + * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. * @since Since Chrome 41. */ - openedFilesLimit?: number; + openedFilesLimit?: integer; /** - * Optional. - * Whether the file system supports the tag field for observed directories. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Whether the file system supports the tag field for observed directories. + * @since Since Chrome 45. */ supportsNotifyTag?: boolean; + /** + * Whether the framework should resume the file system at the next sign-in session. + * @default true + * @since Since Chrome 64. + */ + persistent?: boolean; } interface UnmountOptions { @@ -1301,7 +2932,7 @@ declare namespace chrome { /** The path of the changed entry. */ entryPath: string; /** The type of the change which happened to the entry. */ - changeType: string; + changeType: ChangeType; } interface NotificationOptions { @@ -1311,238 +2942,550 @@ declare namespace chrome { observedPath: string; /** Mode of the observed entry. */ recursive: boolean; - /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */ - changeType: string; - /** Optional. List of changes to entries within the observed directory (including the entry itself) */ + /** + * The type of the change which happened to the observed entry. + * If it is DELETED, then the observed entry will be automatically + * removed from the list of observed entries. + */ + changeType: ChangeType; + /** List of changes to entries within the observed directory (including the entry itself) */ changes?: NotificationChange[]; - /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */ + /** + * Tag for the notification. + * Required if the file system was mounted with the supportsNotifyTag option. + * Note, that this flag is necessary to provide notifications about changes + * which changed even when the system was shutdown. + */ tag?: string; } + /** + * Internal interfaces, not for use + * @private + * @internal + */ + namespace _internal_ { + /** + * @private + * @internal + */ + interface RequestedEventOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: integer; + } - interface RequestedEventOptions { - /** The identifier of the file system related to this operation. */ - fileSystemId: string; - /** The unique identifier of this request. */ - requestId: number; + /** + * @private + * @internal + */ + interface EntryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPath: string; + } + + /** + * @private + * @internal + */ + interface FilePathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry for the operation */ + filePath: string; + } } - - interface EntryPathRequestedEventOptions extends RequestedEventOptions { - /** The path of the entry to which this operation is related to. */ - entryPath: string; + interface UnmountRequestedEventOptions extends _internal_.RequestedEventOptions { } - - interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { - /** Set to true if the thumbnail is requested. */ + interface MetadataRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { + /** + * Set to true if is_directory value is requested + * @since Chrome 49. + */ + isDirectory: boolean; + /** + * Set to true if is_directory value is requested. + * @since Chrome 49. + */ + name: boolean; + /** + * Set to true if size value is requested. + * @since Chrome 49. + */ + size: boolean; + /** + * Set to true if modificationTime value is requested + * @since Chrome 49. + */ + modificationTime: boolean; + /** + * Set to true if mimeType value is requested. + * @since Chrome 49. + */ + mimeType: boolean; + /** + * Set to true if the thumbnail is requested. + */ thumbnail: boolean; } - - interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + interface GetActionsRequestedEventOptions extends _internal_.RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPaths: string[]; + } + interface ReadDirectoryRequestedEventOptions extends _internal_.RequestedEventOptions { /** The path of the directory which is to be operated on. */ directoryPath: string; + /** + * Set to true if is_directory value is requested + * @since Chrome 49. + */ + isDirectory: boolean; + /** + * Set to true if is_directory value is requested. + * @since Chrome 49. + */ + name: boolean; + /** + * Set to true if size value is requested. + * @since Chrome 49. + */ + size: boolean; + /** + * Set to true if modificationTime value is requested + * @since Chrome 49. + */ + modificationTime: boolean; + /** + * Set to true if mimeType value is requested. + * @since Chrome 49. + */ + mimeType: boolean; + /** + * Set to true if the thumbnail is requested. + */ + thumbnail: boolean; } - - interface FilePathRequestedEventOptions extends RequestedEventOptions { - /** The path of the entry for the operation */ - filePath: string; - } - - interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + interface OpenFileRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { /** Whether the file will be used for reading or writing. */ - mode: string; + mode: OpenFileMode; } - - interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + interface CloseFileRequestedEventOptions extends _internal_.RequestedEventOptions { /** A request ID used to open the file. */ - openRequestId: number; + openRequestId: integer; } - - interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + interface ReadFileRequestedEventOptions extends _internal_.RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: integer; /** Position in the file (in bytes) to start reading from. */ - offset: number; + offset: double; /** Number of bytes to be returned. */ - length: number; + length: double; } - - interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + interface CreateDirectoryRequestedEventOptions extends _internal_.RequestedEventOptions { + /** The path of the directory which is to be operated on. */ + directoryPath: string; /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - - interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + interface DeleteEntryRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - - interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { + interface CreateFileRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { + } + interface CopyEntryRequestedEventOptions extends _internal_.RequestedEventOptions { /** The source path for the operation. */ sourcePath: string; /** The destination path for the operation. */ targetPath: string; } - - interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { - /** Number of bytes to be retained after the operation completes. */ - length: number; + interface MoveEntryRequestedEventOptions extends CopyEntryRequestedEventOptions { } - - interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + interface TruncateRequestedEventOptions extends _internal_.FilePathRequestedEventOptions { + /** Number of bytes to be retained after the operation completes. */ + length: double; + } + interface WriteFileRequestedEventOptions extends _internal_.RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: integer; /** Position in the file (in bytes) to start operating from. */ offset: number; /** Buffer of bytes to be operated on the file. */ data: ArrayBuffer; } - - interface OperationRequestedEventOptions extends RequestedEventOptions { + interface AbortRequestedEventOptions extends _internal_.RequestedEventOptions { /** An ID of the request to which this operation is related. */ - operationRequestId: number; + operationRequestId: integer; + } + interface ConfigureRequestedEventOptions extends _internal_.RequestedEventOptions { + } + interface WatcherRequestedEventOptions extends _internal_.EntryPathRequestedEventOptions { + /** + * Mode of the watcher. + * Whether observing should include all child entries recursively. + * It can be true for directories only. + */ + recursive: boolean; + } + interface ExecuteActionRequestedEventOptions extends GetActionsRequestedEventOptions { + /** The identifier of the action to be executed. */ + actionId: string; } - interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> { } - - interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - - interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - - interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - - interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { } + ///\/\/|\/\/\\\ + /// METHODS \\\ + ///\/\/|\/\/\\\ /** - * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. + * Mounts a file system with the given fileSystemId and displayName. + * displayName will be shown in the left panel of the Files app. + * displayName can contain any characters including '/', but cannot be an empty string. + * displayName must be descriptive but doesn't have to be unique. + * The fileSystemId must not be an empty string. + * * Depending on the type of the file system being mounted, the source option must be set appropriately. + * * In case of an error, runtime.lastError will be set with a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function mount(options: MountOptions, callback?: () => void): void; + function mount(options: MountOptions, callback?: () => void): void; + /** - * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error). + * Unmounts a file system with the given fileSystemId. + * It must be called after onUnmountRequested is invoked. + * Also, the providing extension can decide to perform unmounting if not requested + * (eg. in case of lost connection, or a file error). + * * In case of an error, runtime.lastError will be set with a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function unmount(options: UnmountOptions, callback?: () => void): void; + function unmount(options: UnmountOptions, callback?: () => void): void; + /** * Returns all file systems mounted by the extension. * @param callback Callback to receive the result of getAll function. - * The callback parameter should be a function that looks like this: - * function(array of FileSystemInfo fileSystems) {...}; */ - export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + /** * Returns information about a file system with the passed fileSystemId. * @since Since Chrome 42. * @param callback Callback to receive the result of get function. - * The callback parameter should be a function that looks like this: - * function(FileSystemInfo fileSystem) {...}; */ - export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + /** - * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll. + * Notifies about changes in the watched directory at observedPath in recursive mode. + * If the file system is mounted with supportsNofityTag, then tag must be provided, + * and all changes since the last notification always reported, even if the system was shutdown. + * The last tag can be obtained with getAll. + * * To use, the file_system_provider.notify manifest option must be set to true. - * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string. - * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number. - * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore. + * + * Value of tag can be any string which is unique per call, + * so it's possible to identify the last registered notification. + * Eg. if the providing extension starts after a reboot, + * and the last registered notification's tag is equal to '123', + * then it should call notify for all changes which happened since + * the change tagged as '123'. It cannot be an empty string. + * + * Not all providers are able to provide a tag, but if the file system has a changelog, + * then the tag can be eg. a change number, or a revision number. + * + * Note that if a parent directory is removed, then all descendant entries are also removed, + * and if they are watched, then the API must be notified about the fact. + * Also, if a directory is renamed, then all descendant entries are in fact removed, + * as there is no entry under their original paths anymore. + * * In case of an error, runtime.lastError will be set will a corresponding error code. + * * @param callback A generic result callback to indicate success or failure. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; + * @since Since Chrome 45. */ - export function notify(options: NotificationOptions, callback: () => void): void; + function notify(options: NotificationOptions, callback: () => void): void; + + ///\/\/\/\/\\\ + /// EVENTS \\\ + ///\/\/\/\/\\\ + + /** + * Raised when unmounting for the file system with the fileSystemId identifier is requested. + * In the response, the unmount API method must be called together with successCallback. + * If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. + */ + const onUnmountRequested: chrome.events.Event<( + options: UnmountRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when metadata of a file or a directory at entryPath is requested. + * The metadata must be returned with the successCallback call. + * In case of an error, errorCallback must be called. + */ + const onGetMetadataRequested: chrome.events.Event<( + options: MetadataRequestedEventOptions, + successCallback: (metadata: EntryMetadata) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when a list of actions for a set of files or directories at entryPaths is requested. + * All of the returned actions must be applicable to each entry. + * If there are no such actions, an empty array should be returned. + * The actions must be returned with the successCallback call. + * In case of an error, errorCallback must be called. + * @since Since Chrome 48. + **/ + const onGetActionsRequested: chrome.events.Event<( + options: GetActionsRequestedEventOptions, + successCallback: (actions: Action[]) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when contents of a directory at directoryPath are requested. + * The results must be returned in chunks by calling the successCallback several times. + * In case of an error, errorCallback must be called. + */ + const onReadDirectoryRequested: chrome.events.Event<( + options: ReadDirectoryRequestedEventOptions, + successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when opening a file at filePath is requested. + * If the file does not exist, then the operation must fail. + * Maximum number of files opened at once can be specified with MountOptions. + */ + const onOpenFileRequested: chrome.events.Event<( + options: OpenFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when opening a file previously opened + * with openRequestId is requested to be closed. + */ + const onCloseFileRequested: chrome.events.Event<( + options: CloseFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void> + + /** + * Raised when reading contents of a file opened previously with openRequestId is requested. + * The results must be returned in chunks by calling successCallback several times. + * In case of an error, errorCallback must be called. + */ + const onReadFileRequested: chrome.events.Event<( + options: ReadFileRequestedEventOptions, + successCallback: (data: ArrayBuffer, hasMore: boolean) => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when creating a directory is requested. + * The operation must fail with the EXISTS error if the target directory already exists. + * If recursive is true, then all of the missing directories on the directory path must be created. + */ + const onCreateDirectoryRequested: chrome.events.Event<( + options: CreateDirectoryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when deleting an entry is requested. + * If recursive is true, and the entry is a directory, + * then all of the entries inside must be recursively deleted as well. + */ + const onDeleteEntryRequested: chrome.events.Event<( + options: DeleteEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when creating a file is requested. + * If the file already exists, then errorCallback must be called with the 'EXISTS' error code. + */ + const onCreateFileRequested: chrome.events.Event<( + options: CreateFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when copying an entry (recursively if a directory) is requested. + * If an error occurs, then errorCallback must be called. + */ + const onCopyEntryRequested: chrome.events.Event<( + options: CopyEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when moving an entry (recursively if a directory) is requested. + * If an error occurs, then errorCallback must be called. + */ + const onMoveEntryRequested: chrome.events.Event<( + options: MoveEntryRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when truncating a file to a desired length is requested. + * If an error occurs, then errorCallback must be called. + */ + const onTruncateRequested: chrome.events.Event<( + options: TruncateRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; - /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ - export var onUnmountRequested: RequestedEvent; - /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ - export var onGetMetadataRequested: MetadataRequestedEvent; - /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */ - export var onReadDirectoryRequested: DirectoryPathRequestedEvent; - /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */ - export var onOpenFileRequested: OpenFileRequestedEvent; - /** Raised when opening a file previously opened with openRequestId is requested to be closed. */ - export var onCloseFileRequested: OpenedFileRequestedEvent; - /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */ - export var onReadFileRequested: OpenedFileOffsetRequestedEvent; - /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */ - export var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; - /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */ - export var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; - /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */ - export var onCreateFileRequested: FilePathRequestedEvent; - /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - export var onCopyEntryRequested: SourceTargetPathRequestedEvent; - /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - export var onMoveEntryRequested: SourceTargetPathRequestedEvent; - /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */ - export var onTruncateRequested: FilePathLengthRequestedEvent; /** Raised when writing contents to a file opened previously with openRequestId is requested. */ - export var onWriteFileRequested: OpenedFileIoRequestedEvent; - /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ - export var onAbortRequested: OperationRequestedEvent; + const onWriteFileRequested: chrome.events.Event<( + options: WriteFileRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. + * Raised when aborting an operation with operationRequestId is requested. + * The operation executed with operationRequestId must be immediately stopped + * and successCallback of this abort request executed. If aborting fails, + * then errorCallback must be called. Note, that callbacks of the aborted + * operation must not be called, as they will be ignored. Despite calling + * errorCallback, the request may be forcibly aborted. + */ + const onAbortRequested: chrome.events.Event<( + options: AbortRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when showing a configuration dialog for fileSystemId is requested. + * If it's handled, the file_system_provider.configurable manfiest option must be set to true. * @since Since Chrome 44. */ - export var onConfigureRequested: RequestedEvent; + const onConfigureRequested: chrome.events.Event<( + options: ConfigureRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. + * Raised when showing a dialog for mounting a new file system is requested. + * If the extension/app is a file handler, then this event shouldn't be handled. + * Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. + * For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. * @since Since Chrome 44. */ - export var onMountRequested: OptionlessRequestedEvent; + const onMountRequested: chrome.events.Event<( + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Raised when setting a new directory watcher is requested. + * If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. */ - export var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + const onAddWatcherRequested: chrome.events.Event<( + options: WatcherRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + /** - * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. - * @since Since Chrome 45. Warning: this is the current Beta channel. + * Raised when the watcher should be removed. + * If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. */ - export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; + const onRemoveWatcherRequested: chrome.events.Event<( + options: WatcherRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; + + /** + * Raised when executing an action for a set of files or directories is\ requested. + * After the action is completed, successCallback must be called. + * On error, errorCallback must be called. + * @since Since Chrome 48. + */ + const onExecuteActionRequested: chrome.events.Event<( + options: ExecuteActionRequestedEventOptions, + successCallback: () => void, + errorCallback: (error: ProviderError) => void + ) => void>; } - //////////////////// - // Google Cloud Messaging - //////////////////// + //////////////////////////// + // Google Cloud Messaging // + //////////////////////////// /** - * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. - * Availability: Since Chrome 35. - * Permissions: "gcm" + * Use chrome.gcm to enable apps and extensions to send and receive + * messages through the Google Cloud Messaging Service. + * @deprecated + * As of April 10, 2018, Google has deprecated GCM. + * The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. + * Migrate GCM apps to Firebase Cloud Messaging (FCM), + * which inherits the reliable and scalable GCM infrastructure, + * plus many new features. See the migration guide to learn more. + * @see[Migration guide]{@link https://developers.google.com/cloud-messaging/android/android-migrate-fcm} + * @see[GCM Imlementation guide]{@link https://developers.google.com/cloud-messaging/chrome/client} + * @since Availability: Since Chrome 35. + * @requires Permissions: 'gcm' */ namespace gcm { + /** + * The maximum size (in bytes) of all key/value pairs in a message. + * @default 4096 + */ + const MAX_MESSAGE_SIZE: integer; + + interface IGCMData { + 'collapse_key'?: never; + 'goog'?: never; + 'goog.'?: never; + 'GOOG'?: never; + 'GOOG.'?: never; + 'google'?: never; + 'GOOGLE'?: never; + [key: string]: any; + } + interface OutgoingMessage { /** The ID of the server to send the message to as assigned by Google API Console. */ destinationId: string; /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */ messageId: string; - /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ - timeToLive?: number; - /** Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. */ - data: Object; + /** Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ + timeToLive?: integer; + /** + * Message data to send to the server. + * + * Case-insensitive goog. and google, + * as well as case-sensitive collapse_key + * are disallowed as key prefixes. + * + * Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. + **/ + data: IGCMData; } interface IncomingMessage { /** The message data. */ - data: Object; + data: IGCMData; /** * Optional. * The sender who issued the message. @@ -1559,21 +3502,12 @@ declare namespace chrome { interface GcmError { /** The error message describing the problem. */ errorMessage: string; - /** Optional. The ID of the message with this error, if error is related to a specific message. */ + /** The ID of the message with this error, if error is related to a specific message. */ messageId?: string; /** Additional details related to the error, when available. */ detail: Object; } - interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> { } - - interface MessageDeletionEvent extends chrome.events.Event<() => void> { } - - interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> { } - - /** The maximum size (in bytes) of all key/value pairs in a message. */ - export var MAX_MESSAGE_SIZE: number; - /** * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. @@ -1582,14 +3516,14 @@ declare namespace chrome { * function(string registrationId) {...}; * Parameter registrationId: A registration ID assigned to the application by the GCM. */ - export function register(senderIds: string[], callback: (registrationId: string) => void): void; + function register(senderIds: string[], callback: (registrationId: string) => void): void; /** * Unregisters the application from GCM. * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. * The callback parameter should be a function that looks like this: * function() {...}; */ - export function unregister(callback: () => void): void; + function unregister(callback: () => void): void; /** * Sends a message according to its contents. * @param message A message to send to the other party via GCM. @@ -1598,44 +3532,440 @@ declare namespace chrome { * function(string messageId) {...}; * Parameter messageId: The ID of the message that the callback was issued for. */ - export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; + function send(message: OutgoingMessage, callback: (messageId: string) => void): void; /** Fired when a message is received through GCM. */ - export var onMessage: MessageReceptionEvent; + const onMessage: chrome.events.Event<(message: IncomingMessage) => void>; /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ - export var onMessagesDeleted: MessageDeletionEvent; + const onMessagesDeleted: chrome.events.Event<() => void>; /** Fired when it was not possible to send a message to the GCM server. */ - export var onSendError: GcmErrorEvent; + const onSendError: chrome.events.Event<(error: GcmError) => void>; } - //////////////////// - // HID - //////////////////// + ///////// + // HID // + ///////// /** - * Use the chrome.hid API to interact with connected HID devices. This API provides access to HID operations from within the context of an app. Using this API, apps can function as drivers for hardware devices. Errors generated by this API are reported by setting runtime.lastError and executing the function's regular callback. The callback's regular parameters will be undefined in this case. - * @since Chrome 38 + * Use the chrome.hid API to interact with connected HID devices. + * This API provides access to HID operations from within the context of an app. + * Using this API, apps can function as drivers for hardware devices. + * Errors generated by this API are reported by setting runtime.lastError + * and executing the function's regular callback. The callback's regular + * parameters will be undefined in this case. + * + * @requires Permissions: 'hid' + * @since Available since Chrome 38. */ namespace hid { - /** NOT YET IMPLEMENTED */ + interface Collection { + /** HID usage page identifier. */ + usagePage: integer; + /** Page-defined usage identifier. */ + usage: integer; + /** Report IDs which belong to the collection and to its children. */ + reportIds: integer[]; + } + interface HidDeviceInfo { + /** Opaque device ID. */ + deviceId: integer; + /** Vendor ID. */ + vendorId: integer; + /** Product ID. */ + productId: integer; + /** + * The product name read from the device, if available. + * @since Chrome 46 + * */ + productName: string; + /** + * The serial number read from the device, if available. + * @since Chrome 46 + */ + serialNumber: string; + /** + * Top-level collections from this device's report descriptors. + */ + collections: Collection[]; + /** Top-level collection's maximum input report size. */ + maxInputReportSize: integer; + /** Top-level collection's maximum output report size. */ + maxOutputReportSize: integer; + /** Top-level collection's maximum feature report size. */ + maxFeatureReportSize: integer; + /** + * Raw device report descriptor (not available on Windows). + * @since Chrome 42 + * */ + reportDescriptor: ArrayBuffer; + } + /** @since Chrome 39. */ + interface DeviceFilter { + /** Device vendor ID. */ + vendorId?: integer; + /** Device product ID, only checked only if the vendor ID matches. */ + productId?: integer; + /** HID usage page identifier. */ + usagePage?: integer; + /** HID usage identifier, checked only if the HID usage page matches. */ + usage?: integer; + } + interface DeviceOptions { + /** + * Equivalent to setting DeviceFilter.vendorId. + * @deprecated Deprecated since Chrome 39 + */ + vendorId?: chrome.deprecated; + /** + * Equivalent to setting DeviceFilter.productId. + * @deprecated Deprecated since Chrome 39. + */ + productId?: chrome.deprecated; + /** + * A device matching any given filter will be returned. + * An empty filter list will return all devices the app has permission for. + * @since Chrome 39 + */ + filters?: DeviceFilter[]; + } + interface UserSelectedDevicePickerOptions { + /** + * Allow the user to select multiple devices. + */ + multiple?: boolean; + /** + * Filter the list of devices presented to the user. + * If multiple filters are provided devices matching any filter will be displayed. + */ + filters?: DeviceFilter[]; + } + + /** + * Enumerate connected HID devices. + * @param options The properties to search for on target devices. + * @param callback + */ + function getDevices(options: DeviceOptions, callback: (devices: HidDeviceInfo[]) => void): void; + + /** + * @requires(dev) **Dev channel only!** + * @see[Learn more]{@link https://developer.chrome.com/apps/api_index#dev_apis} + * @description + * Presents a device picker to the user and returns + * HidDeviceInfo objects for the devices selected. If the user + * cancels the picker devices will be empty. A user gesture is + * required for the dialog to display. Without a user gesture, + * the callback will run as though the user cancelled. If multiple + * filters are provided devices matching any filter will be displayed. + * @param callback Invoked with a list of chosen Devices. + */ + function getUserSelectedDevices(callback: (devices: HidDeviceInfo) => void): void; + + /** + * @since Since Chrome 45. + * @requires(dev) **Dev channel only!** + * @see[Learn more]{@link https://developer.chrome.com/apps/api_index#dev_apis} + * Presents a device picker to the user and returns + * HidDeviceInfo objects for the devices selected. If the user + * cancels the picker devices will be empty. A user gesture is + * required for the dialog to display. Without a user gesture, + * the callback will run as though the user cancelled. If multiple + * filters are provided devices matching any filter will be displayed. + * @param options Configuration of the device picker dialog box. + * @param callback Invoked with a list of chosen Devices. + */ + function getUserSelectedDevices(options: UserSelectedDevicePickerOptions, callback: (devices: HidDeviceInfo) => void): void; + + /** + * Open a connection to an HID device for communication. + * @param deviceId The HidDeviceInfo.deviceId of the device to open. + * @param callback The callback function returns an object, containing the connectionId. + * The connectionId is the opaque ID used to identify this connection in all other functions. + */ + function connect(deviceId: number, callback: (connection: { connectionId: number }) => void): void; + + /** + * Disconnect from a device. + * Invoking operations on a device after calling this is safe but has no effect. + * @param connectionId The connectionId returned by connect. + * @param [callback] + */ + function disconnect(connectionId: integer, callback?: () => void): void; + + /** + * Receive the next input report from the device. + * @param connectionId The connectionId returned by connect. + * @param callback The callback will return these parameters: + * * reportId - The report ID or 0 if none. + * * data - The report data, the report ID prefix (if present) is removed. + */ + function receive(connectionId: integer, callback: (reportId: integer, data: ArrayBuffer) => void): void; + + /** + * Send an output report to the device. + * Note: Do not include a report ID prefix in data. It will be added if necessary. + * @param connectionId The connectionId returned by connect. + * @param reportId reportId - The report ID or 0 if none. + * @param data The report data. + * @param callback + */ + function send(connectionId: integer, reportId: integer, data: ArrayBuffer, callback: () => void): void; + + /** + * Request a feature report from the device. + * @param connectionId The connectionId returned by connect. + * @param reportId The report ID, or 0 if none. + * @param callback Will provide `data` which contain the report data, including a report ID prefix if one is sent by the device. + */ + function receiveFeatureReport(connectionId: integer, reportId: integer, callback: (data: ArrayBuffer) => void): void; + + /** + * Send a feature report to the device. + * Note: Do not include a report ID prefix in data. It will be added if necessary. + * @param connectionId The connectionId returned by connect. + * @param reportId The report ID to use, or 0 if none. + * @param data The report data. + * @param callback + */ + function sendFeatureReport(connectionId: integer, reportId: integer, data: ArrayBuffer, callback: () => void): void; + + /** + * Event generated when a device is added to the system. + * Events are only broadcast to apps and extensions that + * have permission to access the device. Permission may + * have been granted at install time or when the user + * accepted an optional permission. + * @since Chrome 41. + * @see[permissions.request]{@link https://developer.chrome.com/apps/permissions#method-request} + */ + const onDeviceAdded: chrome.events.Event<(device: HidDeviceInfo) => void>; + + /** + * Event generated when a device is removed from the system. + * The callback will contain the deviceId property of the device passed to onDeviceAdded. + * @since Chrome 41. + * @see[See onDeviceAdded for which events are delivered]{@link https://developer.chrome.com/apps/hid#event-onDeviceAdded}. + */ + const onDeviceRemoved: chrome.events.Event<(deviceId: integer) => void>; } - //////////////////// - // i18n - //////////////////// + ///////////////////////////////// + // i18n - Internationalization // + ///////////////////////////////// /** - * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. - * @since Chrome 5. + * Use the chrome.i18n infrastructure to implement internationalization across your whole app. + * Content scripts: Fully supported. + * @see[Docs]{@link https://developer.chrome.com/apps/i18n} + * @since Chrome 25. */ namespace i18n { + /** + * An ISO language code such as en or fr. + * For a complete list of languages supported by this method, see kLanguageInfoTable. + * For an unknown language, und will be returned, + * which means that [percentage] of the text is unknown to CLD + * @since Chrome 47. + */ + type LanguageCode = kLanguageInfoTable | 'und'; + /** + * @see[Source]{@link https://github.com/chromium/chromium/blob/master/ui/base/l10n/l10n_util.cc} + */ + type kLanguageInfoTable = + 'af' | // Afrikaans + 'am' | // Amharic + 'an' | // Aragonese + 'ar' | // Arabic + 'ast' | // Asturian + 'az' | // Azerbaijani + 'be' | // Belarusian + 'bg' | // Bulgarian + 'bh' | // Bihari + 'bn' | // Bengali + 'br' | // Breton + 'bs' | // Bosnian + 'ca' | // Catalan + 'ceb' | // Cebuano + 'ckb' | // Kurdish (Arabci), Sorani + 'co' | // Corsican + 'cs' | // Czech + 'cy' | // Welsh + 'da' | // Danish + 'de' | // German + 'de-AT' | // German (Austria) + 'de-CH' | // German (Switzerland) + 'de-DE' | // German (Germany) + 'de-LI' | // German (Liechtenstein) + 'el' | // Greek + 'en' | // English + 'en-AU' | // English (Australia) + 'en-CA' | // English (Canada) + 'en-GB' | // English (UK) + 'en-IN' | // English (India) + 'en-NZ' | // English (New Zealand) + 'en-US' | // English (US) + 'en-ZA' | // English (South Africa) + 'eo' | // Esperanto + // TODO(jungshik) : Do we want to list all es-Foo for Latin-American + // Spanish speaking countries? + 'es' | // Spanish + 'es-419' | // Spanish (Latin America) + 'es-AR' | // Spanish (Argentina) + 'es-CL' | // Spanish (Chile) + 'es-CO' | // Spanish (Colombia) + 'es-CR' | // Spanish (Costa Rica) + 'es-ES' | // Spanish (Spain) + 'es-HN' | // Spanish (Honduras) + 'es-MX' | // Spanish (Mexico) + 'es-PE' | // Spanish (Peru) + 'es-US' | // Spanish (US) + 'es-UY' | // Spanish (Uruguay) + 'es-VE' | // Spanish (Venezuela) + 'et' | // Estonian + 'eu' | // Basque + 'fa' | // Persian + 'fi' | // Finnish + 'fil' | // Filipino + 'fo' | // Faroese + 'fr' | // French + 'fr-CA' | // French (Canada) + 'fr-CH' | // French (Switzerland) + 'fr-FR' | // French (France) + 'fy' | // Frisian + 'ga' | // Irish + 'gd' | // Scots Gaelic + 'gl' | // Galician + 'gn' | // Guarani + 'gu' | // Gujarati + 'ha' | // Hausa + 'haw' | // Hawaiian + 'he' | // Hebrew + 'hi' | // Hindi + 'hmn' | // Hmong + 'hr' | // Croatian + 'ht' | // Haitian Creole + 'hu' | // Hungarian + 'hy' | // Armenian + 'ia' | // Interlingua + 'id' | // Indonesian + 'ig' | // Igbo + 'is' | // Icelandic + 'it' | // Italian + 'it-CH' | // Italian (Switzerland) + 'it-IT' | // Italian (Italy) + 'ja' | // Japanese + 'jv' | // Javanese + 'ka' | // Georgian + 'kk' | // Kazakh + 'km' | // Cambodian + 'kn' | // Kannada + 'ko' | // Korean + 'ku' | // Kurdish + 'ky' | // Kyrgyz + 'la' | // Latin + 'lb' | // Luxembourgish + 'ln' | // Lingala + 'lo' | // Laothian + 'lt' | // Lithuanian + 'lv' | // Latvian + 'mg' | // Malagasy + 'mi' | // Maori + 'mk' | // Macedonian + 'ml' | // Malayalam + 'mn' | // Mongolian + 'mo' | // Moldavian + 'mr' | // Marathi + 'ms' | // Malay + 'mt' | // Maltese + 'my' | // Burmese + 'nb' | // Norwegian (Bokmal) + 'ne' | // Nepali + 'nl' | // Dutch + 'nn' | // Norwegian (Nynorsk) + 'no' | // Norwegian + 'ny' | // Nyanja + 'oc' | // Occitan + 'om' | // Oromo + 'or' | // Oriya + 'pa' | // Punjabi + 'pl' | // Polish + 'ps' | // Pashto + 'pt' | // Portuguese (pt-BR and pt-PT are used) + 'pt-BR' | // Portuguese (Brazil) + 'pt-PT' | // Portuguese (Portugal) + 'qu' | // Quechua + 'rm' | // Romansh + 'ro' | // Romanian + 'ru' | // Russian + 'sd' | // Sindhi + 'sh' | // Serbo-Croatian + 'si' | // Sinhalese + 'sk' | // Slovak + 'sl' | // Slovenian + 'sm' | // Samoan + 'sn' | // Shona + 'so' | // Somali + 'sq' | // Albanian + 'sr' | // Serbian + 'st' | // Sesotho + 'su' | // Sundanese + 'sv' | // Swedish + 'sw' | // Swahili + 'ta' | // Tamil + 'te' | // Telugu + 'tg' | // Tajik + 'th' | // Thai + 'ti' | // Tigrinya + 'tk' | // Turkmen + 'to' | // Tonga + 'tr' | // Turkish + 'tt' | // Tatar + 'tw' | // Twi + 'ug' | // Uighur + 'uk' | // Ukrainian + 'ur' | // Urdu + 'uz' | // Uzbek + 'vi' | // Vietnamese + 'wa' | // Walloon + 'xh' | // Xhosa + 'yi' | // Yiddish + 'yo' | // Yoruba + 'zh' | // Chinese + 'zh-CN' | // Chinese (China) + 'zh-HK' | // Chinese (Hong Kong) + 'zh-TW' | // Chinese (Taiwan) + 'zu' | // Zulu + // Aliases: + 'ar_001' | + 'en_001' | + 'en_150' | + 'zh_hans_cn' | + 'zh_hant_hk' | + 'zh_hant_mo' | + 'zh_hans_sg' | + 'zh_hant_tw'; + + /** Allow array of strings with length 1 to 9 */ + type StringSubstitutions = + [string] | + [string, string] | + [string, string, string] | + [string, string, string, string] | + [string, string, string, string, string] | + [string, string, string, string, string, string] | + [string, string, string, string, string, string, string] | + [string, string, string, string, string, string, string, string] | + [string, string, string, string, string, string, string, string, string]; + /** Holds detected ISO language code and its percentage in the input string */ interface DetectedLanguage { - /** An ISO language code such as 'en' or 'fr'. - * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. - * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ - language: string; + /** + * An ISO language code such as 'en' or 'fr'. + * For a complete list of languages supported by this method: + * @see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. + * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ + language: kLanguageInfoTable; /** The percentage of the detected language */ - percentage: number; + percentage: integer; } /** Holds detected language reliability and array of DetectedLanguage */ @@ -1643,61 +3973,76 @@ declare namespace chrome { /** CLD detected language reliability */ isReliable: boolean; - /** Array of detectedLanguage */ + /** Array of DetectedLanguage */ languages: DetectedLanguage[]; } /** - * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. - * @param callback The callback parameter should be a function that looks like this: - * function(array of string languages) {...}; - * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN + * Gets the accept-languages of the browser. + * This is different from the locale used by the browser; + * to get the locale, use i18n.getUILanguage. */ - export function getAcceptLanguages(callback: (languages: string[]) => void): void; + function getAcceptLanguages(callback: (languages: LanguageCode[]) => void): void; /** - * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined. + * Gets the localized string for the specified message. + * If the message is missing, this method returns an empty string (''). + * If the format of the getMessage() call is wrong — for example, + * messageName is not a string or the substitutions array has + * more than 9 elements — this method returns undefined. + * * @param messageName The name of the message, as specified in the messages.json file. - * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. + * @param substitutions Up to 9 substitution strings, if the message requires any. */ - export function getMessage(messageName: string, substitutions?: any): string; + function getMessage(messageName: string, substitutions?: StringSubstitutions): string | undefined; /** - * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. + * Gets the browser UI language of the browser. + * This is different from i18n.getAcceptLanguages which returns the preferred user languages. * @since Chrome 35. */ - export function getUILanguage(): string; + function getUILanguage(): string; - /** Detects the language of the provided text using CLD. + /** + * Detects the language of the provided text using CLD. * @param text User input string to be translated. - * @param callback The callback parameter should be a function that looks like this: function(object result) {...}; + * @param callback + * @since Chrome 47. */ - export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; + function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; } - //////////////////// - // Identity - //////////////////// + ////////////// + // Identity // + ////////////// /** * Use the chrome.identity API to get OAuth2 access tokens. - * Permissions: "identity" + * @requires Permissions: 'identity' + * @see[Identity User]{@link https://developer.chrome.com/apps/app_identity} * @since Chrome 29. */ namespace identity { /** @since Chrome 32. */ interface AccountInfo { - /** A unique identifier for the account. This ID will not change for the lifetime of the account. */ + /** + * A unique identifier for the account. + * This ID will not change for the lifetime of the account. + */ id: string; } interface TokenDetails { /** - * Optional. - * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. + * Fetching a token may require the user to sign-in to Chrome, + * or approve the application's requested scopes. + * If the interactive flag is true, getAuthToken will prompt the user as necessary. + * When the flag is false or omitted, getAuthToken will return failure any time + * a prompt would be required. */ interactive?: boolean; /** * Optional. - * The account ID whose token should be returned. If not specified, the primary account for the profile will be used. - * account is only supported when the "enable-new-profile-management" flag is set. + * The account ID whose token should be returned. + * If not specified, the primary account for the profile will be used. + * account is only supported when the 'enable-new-profile-management' flag is set. * @since Chrome 37. */ account?: AccountInfo; @@ -1711,9 +4056,17 @@ declare namespace chrome { } interface UserInfo { - /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */ + /** + * An email address for the user account signed into the current profile. + * Empty if the user is not signed in or the identity.email manifest permission is not specified. + */ email: string; - /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */ + /** + * A unique identifier for the account. + * This ID will not change for the lifetime of the account. + * Empty if the user is not signed in or (in M41+) the identity.email + * manifest permission is not specified. + */ id: string; } @@ -1723,7 +4076,9 @@ declare namespace chrome { } interface WebAuthFlowOptions { - /** The URL that initiates the auth flow. */ + /** + * The URL that initiates the auth flow. + */ url: string; /** * Optional. @@ -1734,164 +4089,579 @@ declare namespace chrome { interactive?: boolean; } - interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { } - /** + * @requires(dev) **Dev channel only.** + * @description * Retrieves a list of AccountInfo objects describing the accounts present on the profile. * getAccounts is only supported on dev channel. - * Dev channel only. */ - export function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + /** - * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json. - * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration. - * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched. + * Gets an OAuth2 access token using the client ID and + * scopes specified in the oauth2 section of manifest.json. + * + * The Identity API caches access tokens in memory, + * so it's ok to call getAuthToken non-interactively any time a token is required. + * The token cache automatically handles expiration. + * + * For a good user experience it is important interactive token requests are initiated by + * UI in your app explaining what the authorization is for. Failing to do this will cause + * your users to get authorization requests, or Chrome sign in screens if they are not + * signed in, with with no context. In particular, do not use getAuthToken interactively + * when your app is first launched. + * * @param details Token options. - * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. - * If you specify the callback parameter, it should be a function that looks like this: - * function(string token) {...}; + * @param [callback] Called with an OAuth2 access token as specified by the manifest, + * or undefined if there was an error. */ - export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + /** * Retrieves email address and obfuscated gaia id of the user signed into a profile. - * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile. + * This API is different from identity.getAccounts in two ways. + * The information returned is available offline, and it only applies to the primary account for the profile. * @since Chrome 37. */ - export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + /** * Removes an OAuth2 access token from the Identity API's token cache. - * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken. + * If an access token is discovered to be invalid, + * it should be passed to removeCachedAuthToken to remove it from the cache. + * The app may then retrieve a fresh token with getAuthToken. * @param details Token information. * @param callback Called when the token has been removed from the cache. - * If you specify the callback parameter, it should be a function that looks like this: - * function() {...}; */ - export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + /** * Starts an auth flow at the specified URL. - * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function. - * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched. + * This method enables auth flows with non-Google identity providers by launching + * a web view and navigating it to the first URL in the provider's auth flow. + * When the provider redirects to a URL matching the pattern https://.chromiumapp.org/*, + * the window will close, and the final redirect URL will be passed to the callback function. + * For a good user experience it is important interactive auth flows are initiated by UI in + * your app explaining what the authorization is for. Failing to do this will cause your + * users to get authorization requests with no context. + * In particular, do not launch an interactive auth flow when your app is first launched. * @param details WebAuth flow options. * @param callback Called with the URL redirected back to your application. * The callback parameter should be a function that looks like this: * function(string responseUrl) {...}; */ - export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + /** * Generates a redirect URL to be used in launchWebAuthFlow. * The generated URLs match the pattern https://.chromiumapp.org/*. * @since Chrome 33. - * @param path Optional. The path appended to the end of the generated URL. + * @param path The path appended to the end of the generated URL. */ - export function getRedirectURL(path?: string): string; + function getRedirectURL(path?: string): string; /** * Fired when signin state changes for an account on the user's profile. * @since Chrome 33. */ - export var onSignInChanged: SignInChangeEvent; + const onSignInChanged: chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void>; } - //////////////////// - // Idle - //////////////////// + ////////// + // Idle // + ////////// /** * Use the chrome.idle API to detect when the machine's idle state changes. - * Permissions: "idle" - * @since Chrome 6. + * @requires Permissions: 'idle' + * @since Chrome 25. */ namespace idle { - interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { } - + type IdleState = + 'active' | + 'idle' | + 'locked'; /** - * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. + * Returns 'locked' if the system is locked, 'idle' if the user has not generated any input for a specified number of seconds, or 'active' otherwise. * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. * Since Chrome 25. * @param callback The callback parameter should be a function that looks like this: * function( IdleState newState) {...}; */ - export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void; + function queryState(detectionIntervalInSeconds: integer, callback: (newState: IdleState) => void): void; /** - * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. + * Sets the interval, in seconds, used to determine when the system is in an idle state for + * onStateChanged events. + * The default interval is 60 seconds. * @since Chrome 25. * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. */ - export function setDetectionInterval(intervalInSeconds: number): void; + function setDetectionInterval(intervalInSeconds: integer): void; - /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */ - export var onStateChanged: IdleStateChangedEvent; + /** + * Fired when the system changes to an active, idle or locked state. + * The event fires with 'locked' if the screen is locked or the screensaver activates, + * 'idle' if the system is unlocked and the user has not generated any input for a + * specified number of seconds, and 'active' when the user generates input on an idle system. + */ + const onStateChanged: chrome.events.Event<(newState: IdleState) => void>; } - //////////////////// - // InstanceID - //////////////////// + //////////////// + // InstanceID // + //////////////// /** * Use chrome.instanceID to access the Instance ID service. + * @requires Permissions: 'gcm' * @since Chrome 46 */ namespace instanceID { - /** NOT YET IMPLEMENTED */ + interface TokenParams { + /** + * Identifies the entity that is authorized to access resources associated with this Instance ID. + * It can be a project ID from Google developer console. + */ + authorizedEntity: string; + /** + * Identifies authorized actions that the authorized entity can take. + * E.g. for sending GCM messages, GCM scope should be used. + */ + scope: string; + /** + * Allows including a small number of string key/value pairs that will + * be associated with the token and may be used in processing the request. + */ + options?: { [key: string]: string }; + } + interface DeleteTokenParams { + /** + * The authorized entity that is used to obtain the token. + */ + authorizedEntity: string; + /** + * The scope that is used to obtain the token. + */ + scope: string; + } + /** + * Retrieves an identifier for the app instance. + * The instance ID will be returned by the callback. + * The same ID will be returned as long as the application + * identity has not been revoked or expired. + * @param callback Function called when the retrieval completes. + * It should check runtime.lastError for error when instanceID is empty. + * Will be provided with instanceID: An Instance ID assigned to the app instance. + */ + function getID(callback: (instanceId: string) => void): void; + /** + * Retrieves the time when the InstanceID has been generated. + * The creation time will be returned by the callback. + * @param callback Function called when the retrieval completes. + * It should check runtime.lastError for error when creationTime is zero. + * Provides `creationTime` (double) + * > The time when the Instance ID has been generated, represented in milliseconds since the epoch. + */ + function getCreationTime(callback: (creationTime: number) => void): void; + /** + * Return a token that allows the authorized entity to access the service defined by scope. + * @param getTokenParams Parameters for getToken. + * @param callback Function called when the retrieval completes. It should check runtime.lastError for error when token is empty. + */ + function getToken(getTokenParams: TokenParams, callback: (token: string) => void): void; + /** + * Revokes a granted token. + * @param deleteTokenParams Parameters for deleteToken. + * @param callback Function called when the token deletion completes. + * The token was revoked successfully if runtime.lastError is not set. + */ + function deleteToken(deleteTokenParams: DeleteTokenParams, callback: () => void): void; + /** + * Fired when all the granted tokens need to be refreshed. + * @param callback Function called when the deletion completes. + * The instance identifier was revoked successfully if runtime.lastError is not set. + */ + function deleteID(callback: () => void): void; + /** Fired when all the granted tokens need to be refreshed. */ + const onTokenRefresh: chrome.events.Event<() => void>; + } + + //////////////// + // Management // + //////////////// + /** + * The chrome.management API provides ways to manage the list of extensions/apps + * that are installed and running. It is particularly useful for extensions that + * override the built-in New Tab page. + * @requires Permissions: "management" + */ + namespace management { + /** Information about an installed extension, app, or theme. */ + interface ExtensionInfo { + /** + * Optional. + * A reason the item is disabled. + * @since Chrome 17. + */ + disabledReason?: string; + /** Optional. The launch url (only present for apps). */ + appLaunchUrl?: string; + /** + * The description of this extension, app, or theme. + * @since Chrome 9. + */ + description: string; + /** + * Returns a list of API based permissions. + * @since Chrome 9. + */ + permissions: string[]; + /** + * Optional. + * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. + */ + icons?: IconInfo[]; + /** + * Returns a list of host based permissions. + * @since Chrome 9. + */ + hostPermissions: string[]; + /** Whether it is currently enabled or disabled. */ + enabled: boolean; + /** + * Optional. + * The URL of the homepage of this extension, app, or theme. + * @since Chrome 11. + */ + homepageUrl?: string; + /** + * Whether this extension can be disabled or uninstalled by the user. + * @since Chrome 12. + */ + mayDisable: boolean; + /** + * How the extension was installed. + * @since Chrome 22. + */ + installType: string; + /** The version of this extension, app, or theme. */ + version: string; + /** The extension's unique identifier. */ + id: string; + /** + * Whether the extension, app, or theme declares that it supports offline. + * @since Chrome 15. + */ + offlineEnabled: boolean; + /** + * Optional. + * The update URL of this extension, app, or theme. + * @since Chrome 16. + */ + updateUrl?: string; + /** + * The type of this extension, app, or theme. + * @since Chrome 23. + */ + type: 'packaged_app' | string; + /** The url for the item's options page, if it has one. */ + optionsUrl: string; + /** The name of this extension, app, or theme. */ + name: string; + /** + * A short version of the name of this extension, app, or theme. + * @since Chrome 31. + */ + shortName: string; + /** + * True if this is an app. + * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. + */ + isApp: boolean; + /** + * Optional. + * The app launch type (only present for apps). + * @since Chrome 37. + */ + launchType?: string; + /** + * Optional. + * The currently available launch types (only present for apps). + * @since Chrome 37. + */ + availableLaunchTypes?: string[]; + } + + /** Information about an icon belonging to an extension, app, or theme. */ + interface IconInfo { + /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */ + url: string; + /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */ + size: number; + } + + interface UninstallOptions { + /** + * Optional. + * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. + */ + showConfirmDialog?: boolean; + } + + interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> { } + + interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } + + /** + * Enables or disables an app or extension. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param enabled Whether this item should be enabled or disabled. + * @param [callback] + */ + function setEnabled(id: string, enabled: boolean, callback?: () => void): void; + /** + * Returns a list of permission warnings for the given extension id. + * @since Chrome 15. + * @param id The ID of an already installed extension. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Returns information about the installed extension, app, or theme that has the given ID. + * @param id The ID from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function get(id: string, callback?: (result: ExtensionInfo) => void): void; + /** + * Returns a list of information about installed extensions and apps. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of ExtensionInfo result) {...}; + */ + function getAll(callback?: (result: ExtensionInfo[]) => void): void; + /** + * Returns a list of permission warnings for the given extension manifest string. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @param manifestStr Extension manifest JSON string. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Launches an application. + * @param id The extension id of the application. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function launchApp(id: string, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @since Chrome 21. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @deprecated since Chrome 21. The options parameter was added to this function. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstall(id: string, callback?: () => void): void; + /** + * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 39. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function getSelf(callback?: (result: ExtensionInfo) => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstallSelf(options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function uninstallSelf(callback?: () => void): void; + /** + * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. + * @since Chrome 37. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function createAppShortcut(id: string, callback?: () => void): void; + /** + * Set the launch type of an app. + * @since Chrome 37. + * @param id This should be the id from an app item of management.ExtensionInfo. + * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + function setLaunchType(id: string, launchType: string, callback?: () => void): void; + /** + * Generate an app for a URL. Returns the generated bookmark app. + * @since Chrome 37. + * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". + * @param title The title of the generated app. + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; + + /** Fired when an app or extension has been disabled. */ + var onDisabled: ManagementDisabledEvent; + /** Fired when an app or extension has been uninstalled. */ + var onUninstalled: ManagementUninstalledEvent; + /** Fired when an app or extension has been installed. */ + var onInstalled: ManagementInstalledEvent; + /** Fired when an app or extension has been enabled. */ + var onEnabled: ManagementEnabledEvent; } //////////////////// // mDNS //////////////////// /** - * Use the chrome.mdns API to discover services over mDNS. This comprises a subset of the features of the NSD spec: http://www.w3.org/TR/discovery-api/ + * Use the chrome.mdns API to discover services over mDNS. + * This comprises a subset of the features of the NSD spec: + * @see[NSD Spec]{@link http://www.w3.org/TR/discovery-api/} + * @requires Permissions: 'mdns' * @since Chrome 31 */ namespace mdns { - /** NOT YET IMPLEMENTED */ + interface Service { + /** The service name of an mDNS advertised service, .. */ + serviceName: string; + /** The host:port pair of an mDNS advertised service. */ + serviceHostPort: string; + /** The IP address of an mDNS advertised service. */ + ipAddress: string; + /** Metadata for an mDNS advertised service. */ + serviceData: string[]; + } + /** + * The maximum number of service instances that will be + * included in onServiceList events. If more instances + * are available, they may be truncated from the + * onServiceList event. + * @default 2048 + * @since Chrome 44. + */ + const MAX_SERVICE_INSTANCES_PER_EVENT: number; + /** + * Immediately issues a multicast DNS query for all service types. + * |callback| is invoked immediately. + * At a later time, queries will be sent, + * and any service events will be fired. + * @since Chrome 45. + * @param callback Callback invoked after ForceDiscovery() has started. + */ + function forceDiscovery(callback: () => void): void; + /** + * Event fired to inform clients of the current complete + * set of known available services. Clients should only + * need to store the list from the most recent event. + * The service type that the extension is interested in + * discovering should be specified as the event filter + * with the 'serviceType' key. Not specifying an event + * filter will not start any discovery listeners. + */ + const onServiceList: chrome.events.Event<(services: Service[]) => void>; + } //////////////////// // Media Galleries //////////////////// + /** + * Use the chrome.mediaGalleries API to access media files (audio, images, video) + * from the user's local disks (with the user's consent). + * @since Available since Chrome 24. + * @requires Permissions: {'mediaGalleries': ['accessType1' | 'accessType2', ...]} + * {'mediaGalleries': ['accessType1' | 'accessType2', ..., 'allAutoDetected']} + * @see[More information]{@link https://developer.chrome.com/apps/mediaGalleries} + */ namespace mediaGalleries { + type Interactive = + 'no' | + 'yes' | + 'if_needed'; interface MediaFileSystemsOptions { - interactive?: 'no' | 'yes' | 'if_needed'; + /** + * Whether to prompt the user for permission to additional media galleries before returning + * the permitted set. Default is silent. If the value 'yes' is passed, or if the application + * has not been granted access to any media galleries and the value 'if_needed' is passed, + * then the media gallery configuration dialog will be displayed. + * + * **no** + * Do not act interactively. + * **yes** + * Ask the user to manage permitted media galleries. + * **if_needed** + * Ask the user to manage permitted galleries only if the return set would otherwise be empty. + */ + interactive?: Interactive; } - interface MediaFileSystemMetadata { + /** The name of the file system. */ name: string; + /** A unique and persistent id for the media gallery. */ galleryId: string; + /** If the media gallery is on a removable device, a unique id for the device while the device is online. */ deviceId?: string; + /** True if the media gallery is on a removable device. */ isRemovable: boolean; + /** True if the device the media gallery is on was detected as a media device. i.e. a PTP or MTP device, or a DCIM directory is present. */ isMediaDevice: boolean; + /** True if the device is currently available. */ isAvailable: boolean; } + type MetadataOptionsType = + 'all' | + 'mimeTypeAndTags' | + 'mimeTypeOnly'; + interface MetadataOptions { - metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly'; + metadataType: MetadataOptionsType; } interface RawTag { + /** + * Describes format of container or codec of stream, i.e. 'mp3' | 'h264'. + */ type: string; + /** + * An unfiltered string->string dictionary of tags for the stream. + */ tags: { [name: string]: string; }; } interface Metadata { - // The browser sniffed mime type. + /** The browser sniffed mime type. */ mimeType: string; - // Defined for images and video. In pixels. - height?: number; - width?: number; - // Defined for images only. - xResolution?: number; - yResolution?: number; - // Defined for audio and video. In seconds. - duration?: number; - // Defined for images and video. In degrees. - rotation?: number; - // Defined for images only. - cameraMake?: string; - cameraModel?: string; - exposureTimeSeconds?: number; - flashFired?: boolean; - fNumber?: number; - focalLengthMm?: number; - isoEquivalent?: number; - // Defined for audio and video only. + /** Defined for images and video. In pixels. */ + height?: integer; + width?: integer; + /** Defined for audio and video. In seconds. */ + duration?: integer; + /** Defined for images and video. In degrees. */ + rotation?: integer; + /** Defined for audio and video only. */ album?: string; artist?: string; comment?: string; @@ -1901,9 +4671,16 @@ declare namespace chrome { language?: string; title?: string; track?: number; - // All the metadata in the media file. For formats with multiple streams, stream order will be preserved. Container metadata is the first element. + /** + * All the metadata in the media file. + * For formats with multiple streams, stream order will be preserved. + * Container metadata is the first element. + */ rawTags: RawTag[]; - // The images embedded in the media file's metadata. This is most often used for album art or video thumbnails. + /** + * The images embedded in the media file's metadata. + * This is most often used for album art or video thumbnails. + */ attachedImages: Blob[]; } @@ -1912,167 +4689,793 @@ declare namespace chrome { success: boolean; } + type GalleryChangedType = + 'contents_changed' | + 'watch_dropped'; + interface GalleryChangedEventArgs { - type: 'contents_changed' | 'watch_dropped'; + type: GalleryChangedType; galleryId: string; } + type ScanProgressType = + 'start' | + 'cancel' | + 'finish' | + 'error'; + interface ScanProgressEventArgs { - // The type of progress event, i.e. start, finish, etc. - type: 'start' | 'cancel' | 'finish' | 'error'; - // The number of Galleries found. - galleryCount?: number; - // Appoximate number of media files found; some file types can be either audio or video and are included in both counts. - audioCount?: number; - imageCount?: number; - videoCount?: number; + /** The type of progress event, i.e. start, finish, etc. */ + type: ScanProgressType; + /** The number of Galleries found. */ + galleryCount?: integer; + /** + * Appoximate number of media files found; + * some file types can be either audio or video + * and are included in both counts. + */ + audioCount?: integer; + imageCount?: integer; + videoCount?: integer; } - export function getMediaFileSystems(callback: (mediaFileSystems: FileSystem[]) => void): void; - export function getMediaFileSystems(options: MediaFileSystemsOptions, callback: (mediaFileSystems: FileSystem[]) => void): void; - export function addUserSelectedFolder(callback: (mediaFileSystems: FileSystem[], selectedFileSystemName: string) => void): void; - export function dropPermissionForMediaFileSystem(galleryId: string, callback?: () => void): void; - export function startMediaScan(): void; - export function cancelMediaScan(): void; - export function addScanResults(callback: (mediaFileSystems: FileSystem[]) => void): void; - export function getMediaFileSystemMetadata(mediaFileSystem: FileSystem): MediaFileSystemMetadata; - export function getAllMediaFileSystemMetadata(callback: (metadatas: MediaFileSystemMetadata[]) => void): void; - export function getMetadata(mediaFile: Blob, callback: (metadata: Metadata) => void): void; - export function getMetadata(mediaFile: Blob, options: MetadataOptions, callback: (metadata: Metadata) => void): void; - export function addGalleryWatch(galleryId: string, callback: (result: GalleryWatchResult) => void): void; - export function removeGalleryWatch(galleryId: string): void; - export function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void; - export function removeAllGalleryWatch(): void; - - export var onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; - export var onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; + /** + * Get the media galleries configured in this user agent. + * If none are configured or available, the callback will receive an empty array. + */ + function getMediaFileSystems(callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Get the media galleries configured in this user agent. + * If none are configured or available, the callback will receive an empty array. + */ + function getMediaFileSystems(options: MediaFileSystemsOptions, callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Present a directory picker to the user and add the selected directory as a gallery. + * If the user cancels the picker, selectedFileSystemName will be empty. + * A user gesture is required for the dialog to display. + * Without a user gesture, the callback will run as though the user canceled. + * @since Since Chrome 34. + */ + function addUserSelectedFolder(callback: (mediaFileSystems: FileSystem[], selectedFileSystemName: string) => void): void; + /** + * @deprecated Deprecated since Chrome 51. The user can manually drop access to galleries via the permissions dialog. + * @description Give up access to a given media gallery. + */ + function dropPermissionForMediaFileSystem(galleryId: string, callback?: () => void): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Start a scan of the user's hard disks for directories containing media. + * The scan may take a long time so progress and completion is communicated by events. + * No permission is granted as a result of the scan, see addScanResults. + */ + function startMediaScan(): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Cancel any pending media scan. + * Well behaved apps should provide a way for the user to cancel scans they start. + */ + function cancelMediaScan(): void; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * @description + * Show the user the scan results and let them add any or all of them as galleries. + * This should be used after the 'finish' onScanProgress() event has happened. + * All galleries the app has access to are returned, not just the newly added galleries. + */ + function addScanResults(callback: (mediaFileSystems: FileSystem[]) => void): void; + /** + * Get metadata about a specific media file system + * @since Since Chrome 26. + */ + function getMediaFileSystemMetadata(mediaFileSystem: FileSystem): MediaFileSystemMetadata; + /** + * @deprecated Deprecated since Chrome 51. Use getMediaFileSystemMetadata instead + * Get metadata for all available media galleries. + */ + function getAllMediaFileSystemMetadata(callback: (metadatas: MediaFileSystemMetadata[]) => void): void; + /** + * Gets the media-specific metadata for a media file. + * This should work for files in media galleries as well as other DOM filesystems. + * @since Chrome 38. + */ + function getMetadata(mediaFile: Blob, callback: (metadata: Metadata) => void): void; + /** + * Gets the media-specific metadata for a media file. + * This should work for files in media galleries as well as other DOM filesystems. + * @since Chrome 38. + */ + function getMetadata(mediaFile: Blob, options: MetadataOptions, callback: (metadata: Metadata) => void): void; + /** + * Adds a gallery watch for the gallery with the specified gallery ID. + * The given callback is then fired with a success or failure result. + * @since Chrome 39. + */ + function addGalleryWatch(galleryId: string, callback: (result: GalleryWatchResult) => void): void; + /** + * Removes a gallery watch for the gallery with the specified gallery ID. + * @since Chrome 39. + */ + function removeGalleryWatch(galleryId: string): void; + /** + * @deprecated Deprecated since Chrome 51. Applications should store their own gallery watches as they are added. + * Notifies which galleries are being watched via the given callback. + */ + function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void; + /** + * @deprecated Deprecated since Chrome 51. Use removeGalleryWatch instead. + * Removes all gallery watches. + */ + function removeAllGalleryWatch(): void; + /** + * Fired when a media gallery is changed or a gallery watch is dropped + * @since Since Chrome 38. + */ + const onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; + /** + * @deprecated Deprecated since Chrome 51. The mediaGalleries API no longer supports scanning. + * The pending media scan has changed state. See details for more information. + */ + const onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; } //////////////////////////////////// // Open Network Configuration (ONC) //////////////////////////////////// /** - * The chrome.networking.onc API is used for configuring network connections (Cellular, Ethernet, VPN, WiFi or WiMAX). This API is available in Chrome OS kiosk sessions. - * Network connection configurations are specified following Open Network Configuration (ONC) specification. - * NOTE: Most dictionary properties and enum values use UpperCamelCase to match the ONC specification instead of the JavaScript lowerCamelCase convention. + * @requires(CrOS kiosk mode) This API is available in Chrome OS kiosk sessions. + * @requires Permissions: 'networking.onc' + * @since Since Chrome 59 + * @description + * The chrome.networking.onc API is used for configuring network connections + * (Cellular, Ethernet, VPN, WiFi or WiMAX). + * Network connection configurations are specified following + * @see[Open Network Configuration (ONC) specification.]{@link https://chromium.googlesource.com/chromium/src/+/master/components/onc/docs/onc_spec.md} + * @description + * **NOTE** + * Most dictionary properties and type values use UpperCamelCase to match + * the ONC specification instead of the JavaScript lowerCamelCase convention. */ namespace networking.onc { - export type ActivationStateType = 'Activated' | 'Activating' | 'NotActivated' | 'PartiallyActivated'; - export type CaptivePortalStatus = 'Unknown' | 'Offline' | 'Online' | 'Portal' | 'ProxyAuthRequired'; - export type ConnectionStateType = 'Connected' | 'Connecting' | 'NotConnected'; - export type IPConfigType = 'DHCP' | 'Static'; - export type NetworkType = 'All' | 'Cellular' | 'Ethernet' | 'VPN' | 'Wireless' | 'WiFi' | 'WiMAX'; - export type ProxySettingsType = 'Direct' | 'Manual' | 'PAC' | 'WPAD'; - interface ManagedBoolean { - /** - * @description The active value currently used by the network configuration manager (e.g. Shill). - * @type {boolean} - * @memberof ManagedBoolean - */ - Active?: boolean, - /** - * @description The source from which the effective property value was determined. - * @type {string} - * @memberof ManagedBoolean - */ - Effective?: string, - /** - * @description The property value provided by the user policy. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserPolicy?: boolean, - /** - * @description The property value provided by the device policy. - * @type {boolean} - * @memberof ManagedBoolean - */ - DevicePolicy?: boolean, - /** - * @description The property value set by the logged in user. Only provided if |UserEditable| is true. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserSettings?: boolean, - /** - * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. - * @type {boolean} - * @memberof ManagedBoolean - */ - SharedSettings?: boolean, - /** - * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedBoolean - */ - UserEditable?: boolean, - /** - * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedBoolean - */ - DeviceEditable?: boolean + type ActivationStateType = 'Activated' | 'Activating' | 'NotActivated' | 'PartiallyActivated'; + type CaptivePortalStatus = 'Unknown' | 'Offline' | 'Online' | 'Portal' | 'ProxyAuthRequired'; + type ConnectionStateType = 'Connected' | 'Connecting' | 'NotConnected' + type IPConfigType = 'DHCP' | 'Static' + type NetworkType = 'All' | 'Cellular' | 'Ethernet' | 'VPN' | 'Wireless' | 'WiFi' | 'WiMAX' + type ProxySettingsType = 'Direct' | 'Manual' | 'PAC' | 'WPAD'; + /** + * Partial classes for internal use + * @internal + * @private + */ + namespace _internal_ { + type ObjectFunction = 'unknown' | 'getter' | 'setter'; + interface NetworkConfigBase< + M extends ManagedObject = 'unmanaged', + IF extends InterfaceType = 'full', + OF extends ObjectFunction = 'unknown'> { + /** For cellular networks, cellular network properties. */ + Cellular?: IF extends 'partial' ? CellularBase : CellularProperties; + /** For Ethernet networks, the Ethernet network properties. */ + Ethernet?: IF extends 'partial' ? { Authentication: string; } : EthernetProperties; + /** The network GUID. */ + GUID?: string; + /** The network's IP address configuration type. */ + IPAddressConfigType?: M extends 'managed' ? ManagedIPConfigType : IPConfigType; + /** A user friendly network name. */ + Name?: M extends 'managed' ? ManagedDOMString : string; + /** The IP configuration type for the name servers used by the network. */ + NameServersConfigType?: M extends 'managed' ? ManagedIPConfigType : IPConfigType; + /** The network priority. */ + Priority?: M extends 'managed' ? ManagedLong : integer; + /** The network type. */ + Type?: NetworkType; + /** For VPN networks, the network VPN properties. */ + VPN?: IF extends 'partial' ? { Type: string; } : VPNProperties; + /** For WiFi networks, the network WiFi properties. */ + WiFi?: IF extends 'partial' ? WiFiPropertiesBase : WiFiProperties; + /** For WiMAX networks, the network WiMAX properties. */ + WiMAX?: IF extends 'partial' ? { SignalStrength?: integer } : WiMAXProperties; + } } - interface ManagedLong { + interface ManagedType { + /** The active value currently used by the network configuration manager (e.g. Shill). */ + Active?: T; + /** The source from which the effective property value was determined. */ + Effective?: string; + /** The property value provided by the user policy. */ + UserPolicy?: T; + /** The property value provided by the device policy. */ + DevicePolicy?: T; + /** The property value set by the logged in user. Only provided if *UserEditable* is true. */ + UserSetting?: T; + /** The value set for all users of the device. Only provided if *DeviceEditiable* is true. */ + SharedSetting?: T; /** - * @description The active value currently used by the network configuration manager (e.g. Shill). - * @type {number} - * @memberof ManagedLong + * Whether a UserPolicy for the property exists and allows the property + * to be edited (i.e. the policy set recommended property value). + * @default false */ - Active?: number, + UserEditable?: boolean; /** - * @description The source from which the effective property value was determined. - * @type {string} - * @memberof ManagedLong + * Whether a DevicePolicy for the property exists and allows the property + * to be edited (i.e. the policy set recommended property value). + * @default false */ - Effective?: string, - /** - * @description The property value provided by the user policy. - * @type {number} - * @memberof ManagedLong - */ - UserPolicy?: number, - /** - * @description The property value provided by the device policy. - * @type {number} - * @memberof ManagedLong - */ - DevicePolicy?: number, - /** - * @description The property value set by the logged in user. Only provided if |UserEditable| is true. - * @type {number} - * @memberof ManagedLong - */ - UserSettings?: number, - /** - * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. - * @type {number} - * @memberof ManagedLong - */ - SharedSettings?: number, - /** - * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedLong - */ - UserEditable?: boolean, - /** - * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. - * @type {boolean} - * @memberof ManagedLong - */ - DeviceEditable?: boolean + DeviceEditable?: boolean; } + interface ManagedBoolean extends ManagedType { } + interface ManagedLong extends ManagedType { } + interface ManagedDOMString extends ManagedType { } + interface ManagedDOMStringList extends ManagedType { } + interface ManagedIPConfigType extends ManagedType { } + + interface CellularProviderProperties { + /** The operator name. */ + Name: string; + /** Cellular network ID as a simple concatenation of the network's MCC (Mobile Country Code) and MNC (Mobile Network Code). */ + Code: string; + /** The two-letter country code. */ + Country?: string; + } + interface IssuerSubjectPattern { + /** If set, the value against which to match the certificate subject's common name. */ + CommonName?: string; + /** If set, the value against which to match the certificate subject's common location. */ + Locality?: string; + /** + * If set, the value against which to match the certificate subject's organizations. + * At least one organization should match the value. + */ + Organization?: string; + /** + * If set, the value against which to match the certificate subject's organizational units. + * At least one organizational unit should match the value. + */ + OrganizationalUnit?: string; + } + interface CertPattern { + /** + * List of URIs to which the user can be directed in case + * no certificates that match this pattern are found. + */ + EnrollmentURI?: string[]; + /** + * If set, pattern against which X.509 issuer settings should be matched. + */ + Issuer?: IssuerSubjectPattern; + /** + * List of certificate issuer CA certificates. + * A certificate must be signed by one of them in order to match this pattern. + */ + IssuerCARef?: string[]; + /** + * If set, pattern against which X.509 subject settings should be matched. + */ + IssuerSubjectPattern?: IssuerSubjectPattern; + } + type ClientCertType = 'Ref' | 'Pattern'; + interface EAPProperties { + AnonymousIdentity?: string; + ClientCertPattern?: CertPattern; + /** @since Chrome 60. */ + ClientCertPKCS11Id?: string; + ClientCertRef?: string; + ClientCertType?: ClientCertType; + Identity?: string; + Inner?: string; + /** The outer EAP type. Required by ONC, but may not be provided when translating from Shill. */ + Outer?: string; + Password?: string; + SaveCredentials?: boolean; + ServerCAPEMs?: string[]; + ServerCARefs?: string[]; + /** @since Chrome 60. */ + SubjectMatch?: ManagedDOMString; + UseProactiveKeyCaching?: boolean; + UseSytemCAs?: boolean; + } + interface FoundNetworkProperties { + /** Network availability. */ + Status: string; + /** Network ID. */ + NetworkId: string; + /** Access technology used by the network. */ + Technology: string; + /** The network operator's short-format name. */ + ShortName?: string; + /** The network operator's long-format name. */ + LongName?: string; + } + type IPConfigurationType = 'IPv4' | 'IPv6'; + interface IPConfigProperties { + /** Gateway address used for the IP configuration. */ + Gateway?: S; + /** The IP address for a connection. Can be IPv4 or IPv6 address, depending on value of Type. */ + IPAddress?: S; + /** Array of addresses used for name servers. */ + NameServers?: SL; + /** The routing prefix. */ + RoutingPrefix?: L; + /** The IP configuration type. Can be IPv4 or IPv6. */ + Type?: M extends 'managed' ? ManagedType : IPConfigurationType; + /** The URL for WEb Proxy Auto-Discovery, as reported over DHCP. */ + WebProxyAutoDiscoveryUrl?: S; + } + interface PaymentPortalPost { + /** The HTTP method to use for the payment portal. */ + Method: 'POST'; + /** The post data to send to the payment portal. */ + PostData?: string; + /** The payment portal URL. */ + Url?: string; + } + interface PaymentPortal { + /** The HTTP method to use for the payment portal. */ + Method: string; + /** The payment portal URL. */ + Url?: string; + } + interface ProxyLocation { + /** The proxy IP address host. */ + Host?: string; + /** The port to use for the proxy */ + Port?: integer; + } + interface ManagedProxyLocation { + /** The proxy IP address host. */ + Host?: ManagedDOMString; + /** The port to use for the proxy */ + Port?: ManagedLong; + } + interface ManualProxySettings { + /** Settings for HTTP proxy. */ + HTTPProxy?: P; + /** Settings for secure HTTP proxy. */ + SecureHTTPProxy?: P; + /** Settings for FTP proxy. */ + FTPProxy?: P; + /** Settings for SOCKS proxy. */ + SOCKS?: P; + } + interface ProxySettings { + /** The type of proxy settings. */ + Type: M extends 'managed' ? ManagedType : ProxySettingsType; + /** Manual proxy settings - used only for *Manual* proxy settings. */ + Manual?: ManualProxySettings; + /** Domains and hosts for which manual proxy settings are excluded. */ + ExcludeDomains?: SL; + /** URL for proxy auto-configuration file. */ + PAC?: S; + } + interface SIMLockStatus { + /** The status of SIM lock - possible values are 'sim-pin', 'sim-puk' and ''. */ + LockType: 'sim-pin' | 'sim-puk' | ''; + /** Whether SIM lock is enabled. */ + LockEnabled: boolean; + /** Number of PIN lock tries allowed before PUK is required to unlock the SIM. */ + RetriesLeft?: integer; + } + interface ThirdPartyVPNProperties { + /** ID of the third-party VPN provider extension. */ + ExtensionID: string; + /** The VPN provider name. */ + ProviderName?: string; + } + interface ManagedThirdPartyVPNProperties { + /** ID of the third-party VPN provider extension. */ + ExtensionID: ManagedDOMString; + /** The VPN provider name. */ + ProviderName?: string; + } + interface CellularBase { + /** Carrier account activation state. */ + ActivationState?: ActivationStateType; + /** If the modem is registered on a network, the network technology currently in use. */ + NetworkTechnology?: string; + /** The roaming state of the cellular modem on the current network. */ + RoamingState?: string; + /** Whether a SIM card is present. */ + SIMPresent?: boolean; + /** The current network signal strength. */ + SignalStrength?: integer; + } + interface CellularProperties extends CellularBase { + /** Whether the cellular network should be connected automatically (when in range). */ + AutoConnect?: M extends 'managed' ? ManagedBoolean : boolean; + /** The cellular network activation type. */ + ActivationType?: string; + /** Whether roaming is allowed for the network. */ + AllowRoaming?: boolean; + /** The name of the carrier for which the cellular device is configured. */ + Carrier?: M extends 'managed' ? ManagedDOMString : string; + /** Cellular device technology family - CDMA or GSM. */ + Family?: 'CDMA' | 'GSM'; + /** The firmware revision loaded in the cellular modem. */ + FirmwareRevision?: string; + /** The list of networks found during the most recent network scan. */ + FoundNetworks?: FoundNetworkProperties[]; + /** The cellular modem hardware revision. */ + HardwareRevision?: string; + /** Information about the operator that issued the SIM card currently installed in the modem. */ + HomeProvider?: CellularProviderProperties; + /** The cellular modem manufacturer. */ + MAnufacturer?: string; + /** The cellular modem model ID. */ + ModelID?: string; + /** Online payment portal a user can use to sign-up for or modify a mobile data plan. */ + PaymentPortal?: PaymentPortal | PaymentPortalPost; + /** The revision of the Preferred Roaming List loaded in the modem. */ + PRLVersion?: integer; + /** + * @since Chrome 63. + * True when a cellular network scan is in progress. + */ + Scanning?: boolean; + /** Information about the operator on whose network the modem is currently registered. */ + ServingOperator?: CellularProviderProperties; + /** The state of SIM lock for GSM family networks. */ + SIMLockStatus?: SIMLockStatus; + /** Whether the cellular network supports scanning. */ + SupportNetworkScan?: boolean; + /** A list of supported carriers. */ + SupportedCarriers?: string[]; + } + type EthernetAuthenticationType = 'None' | '8021X'; + interface EthernetProperties { + /** Whether the Ethernet network should be connected automatically. */ + AutoConnect?: M extends 'managed' ? ManagedBoolean : boolean; + /** The authentication used by the Ethernet network. Possible values are None and 8021X. */ + Authentication?: M extends 'managed' ? ManagedType : EthernetAuthenticationType; + /** Network's EAP settings. Required for 8021X authentication. */ + EAP?: EAPProperties; + } + interface VPNProperties { + /** Whether the VPN network should be connected automatically. */ + AutoConnect?: B; + /** The VPN host. */ + Host?: S; + /** + * The VPN type. + * This cannot be an enum because of 'L2TP-IPSec'. + * This is optional for NetworkConfigProperties which is passed to + * *setProperties* which may be used to set only specific properties. + */ + Type?: S; + } + interface WiFiPropertiesBase { + /** The BSSID of the associated access point.. */ + BSSID?: string; + /** + * The WiFi service operating frequency in MHz. + * For connected networks, the current frequency on which the network is connected. + * Otherwise, the frequency of the best available BSS. + */ + Frequency?: integer; + /** HEX-encoded copy of the network SSID. */ + HexSSID?: S; + /** The network security type. */ + Security?: S; + /** The network SSID. */ + SSID?: S; + /** The network signal strength. */ + SignalStrength?: integer; + } + interface WiFiProperties + extends WiFiPropertiesBase { + /** + * Whether ARP polling of default gateway is allowed. + * @default true + */ + AllowGatewayARPPolling?: B; + /** Whether the WiFi network should be connected automatically when in range. */ + AutoConnect?: B; + /** The network EAP properties. Required for WEP-8021X and WPA-EAP networks. */ + EAP?: EAPProperties; + /** Contains all operating frequency recently seen for the WiFi network. */ + FrequencyList?: integer[]; + /** Whether the network SSID will be broadcast. */ + HiddenSSID?: B; + /** Signal-to-noise value (in dB) below which roaming to a new network should be attempted. */ + RoamTreshold?: L; + /** + * @since Chrome 66. + * The passphrase for WEP/WPA/WPA2 connections. + * *This property can only be set!* + */ + Passphrase?: OF extends 'setter' ? string : never; + } + interface WiMAXProperties { + /** Whether the network should be connected automatically. */ + AutoConnect?: B; + /** The network EAP properties. */ + EAP?: EAPProperties; + /** The network signal strength. */ + SignalStrength?: integer; + } + type ManagedObject = 'managed' | 'unmanaged'; + type InterfaceType = 'partial' | 'full'; + + interface NetworkConfigProperties + extends _internal_.NetworkConfigBase<'unmanaged', 'full', OF> { } + + interface NetworkProperties< + M extends ManagedObject = 'unmanaged', + IF extends InterfaceType = 'full'> extends _internal_.NetworkConfigBase { + /** Whether the network is connectable. */ + Connectable?: boolean; + /** The network's current connection state. */ + ConnectionState?: ConnectionStateType; + /** The last recorded network error state. */ + ErrorState?: string; + /** The network's IP configuration. */ + IPConfigs?: IPConfigProperties[]; + /** The network's MAC address. */ + MacAddress?: string; + /** The network's proxy settings. */ + ProxySettings?: ProxySettings; + /** + * For a connected network, whether the network connectivity to the Internet is limited, + * e.g. if the network is behind a portal, or a cellular network is not activated. + */ + RestrictedConnectivity?: boolean; + /** The network's static IP configuration. */ + StaticIPConfig?: IPConfigProperties; + /** IP configuration that was received from the DHCP server before applying static IP configuration. */ + SavedIPConfig?: IPConfigProperties; + /** + * Indicates whether and how the network is configured. + * 'None' conflicts with extension code generation, + * so we must use a string for 'Source' instead of a SourceType enum. + */ + Source?: 'Device' | 'DevicePolicy' | 'User' | 'UserPolicy' | 'None'; + } + interface ManagedProperties extends NetworkProperties<'managed'> { } + interface NetworkStateProperties extends NetworkProperties<'unmanaged', 'partial'> { } + + /** Describes which networks to return. */ + interface Filter { + /** The type of networks to return. */ + networkType: NetworkType; + /** + * If true, only include visible (physically connected or in-range) networks. + * @default false + */ + visible?: boolean; + /** + * If true, only include configured (saved) networks. + * @default false + */ + configured?: boolean; + /** + * Maximum number of networks to return. + * Use 0 for no limit + * @default 1000 if unspecified. + * */ + limit?: integer; + } + + /* The current state of the device. */ + type DeviceState = 'Uninitialized' | 'Disabled' | 'Enabling' | 'Enabled' | 'Prohibited'; + + /** A list of devices and their state. */ + interface DeviceStates { + /** Set if the device is enabled. True if the device is currently scanning. */ + Scanning?: boolean; + /** The SIM lock status if Type = Cellular and SIMPresent = True. */ + SIMLockStatus?: SIMLockStatus; + /** Set to the SIM present state if the device type is Cellular. */ + SIMPresent?: boolean; + /** + * The current state of the device. + * + * **Uninitialized** + * - Device is available but not initialized. + * **Disabled** + * - Device is initialized but not enabled. + * **Enabling** + * - Enabled state has been requested but has not completed. + * **Enabled** + * - Device is enabled. + * **Prohibited** + * - Device is prohibited. + */ + State: DeviceState; + /** The network type associated with the device (Cellular, Ethernet, WiFi, or WiMAX). */ + Type: NetworkType; + } + + interface GlobalPolicy { + /** + * If true, only policy networks may auto connect. + * @default false + */ + AllowOnlyPolicyNetworksToAutoconnect?: boolean; + /** + * If true, only policy networks may be connected to + * and no new networks may be added or configured. + * @default false + */ + AllowOnlyPolicyNetworksToConnect?: boolean; + /** + * List of blacklisted networks. + * Connections to blacklisted networks are prohibited. + * Networks can be whitelisted again by specifying an explicit network configuration. + * @default [] + */ + BlacklistedHexSSIDs?: string[]; + } + + /** + * Gets all the properties of the network with id *networkGuid*. + * Includes all properties of the network (read-only and read/write values). + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called with the network properties when received. + */ + function getProperties(networkGuid: string, callback: (result: NetworkProperties) => void): void; + /** + * Gets the merged properties of the network with id networkGuid from the sources: + * User settings, shared settings, user policy, device policy and the currently active settings. + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called with the managed network properties when received. + */ + function getManagedProperties(networkGuid: string, callback: (result: ManagedProperties) => void): void; + /** + * Gets the cached read-only properties of the network with id *networkGuid*. + * This is meant to be a higher performance function than *getProperties*, + * which requires a round trip to query the networking subsystem. + * The following properties are returned for all networks: + * GUID, Type, Name, WiFi.Security. + * Additional properties are provided for visible networks: + * ConnectionState, ErrorState, WiFi.SignalStrength, + * Cellular.NetworkTechnology, Cellular.ActivationState, Cellular.RoamingState. + * @param networkGuid The GUID of the network to get properties for. + * @param callback Called immediately with the network state properties. + */ + function getState(networkGuid: string, callback: (result: NetworkStateProperties) => void): void; + /** + * Sets the properties of the network with id *networkGuid*. + * This is only valid for configured networks (Source != None). + * Unconfigured visible networks should use **createNetwork** instead. + * **In kiosk sessions, calling this method on a shared network will fail.** + * @param networkGuid The GUID of the network to set properties for. + * @param properties The properties to set. + * @param [callback] Called when the operation has completed. + */ + function setProperties(networkGuid: string, properties: NetworkConfigProperties<'setter'>, callback?: () => void): void; + /** + * Creates a new network configuration from properties. + * If a matching configured network already exists, this will fail. + * Otherwise returns the GUID of the new network. + * @param shared If true, share this network configuration with other users. + * Note: This option is exposed only to Chrome's Web UI. + * When called by apps, false is the only allowed value. + * @param properties The properties to configure the new network with. + * @param [callback] Called with the GUID for the new network configuration once the network has been created. + */ + function createNetwork(shared: false, properties: NetworkConfigProperties<'setter'>, callback?: () => void): void; + /** + * Forgets a network configuration by clearing any configured properties for the network with GUID networkGuid. + * This may also include any other networks with matching identifiers (e.g. WiFi SSID and Security). + * If no such configuration exists, an error will be set and the operation will fail. + * **In kiosk sessions, this method will not be able to forget shared network configurations.** + * @param networkGuid The GUID of the network to forget. + * @param [callback] Called when the operation has completed. + */ + function forgetNetwork(networkGuid: string, callback?: () => void): void; + /** + * Returns a list of network objects with the same properties provided by *getState*. + * A filter is provided to specify the type of networks returned and to limit the number of networks. + * Networks are ordered by the system based on their priority, with connected or connecting networks listed first. + * @param callback Called with a dictionary of networks and their state properties when received. + */ + function getNetworks(filter: Filter, callback: (result: NetworkStateProperties[]) => void): void; + /** + * Returns states of available networking devices. + * @param callback Called with a list of devices and their state. + */ + function getDeviceStates(callback: (result: DeviceStates[]) => void): void; + /** + * Enables any devices matching the specified network type. + * Note, the type might represent multiple network types (e.g. 'Wireless'). + * @param networkType The type of network to enable. + */ + function enableNetworkType(networkType: NetworkType): void; + /** + * Disables any devices matching the specified network type. + * Note, the type might represent multiple network types (e.g. 'Wireless'). + * @param networkType The type of network to disable. + */ + function disableNetworkType(networkType: NetworkType): void; + /** + * Requests that the networking subsystem scan for new networks and update the list returned by *getVisibleNetworks*. + * This is only a request: the network subsystem can choose to ignore it. + * If the list is updated, then the *onNetworkListChanged* event will be fired. + */ + function requestNetworkScan(): void; + /** + * Requests that the networking subsystem scan for new networks and update the list returned by *getVisibleNetworks*. + * This is only a request: the network subsystem can choose to ignore it. + * If the list is updated, then the *onNetworkListChanged* event will be fired. + * @param networkType If provided, requests a scan specific to the type. For Cellular a mobile network scan will be requested if supported. + * @since Chrome 63. + */ + function requestNetworkScan(networkType: NetworkType): void; + /** + * @description Starts a connection to the network with networkGuid. + * @param networkGuid The GUID of the network to connect to. + * @param [callback] Creates a new network configuration from properties. + * If a matching configured network already exists, this will fail. + * Otherwise returns the GUID of the new network. + */ + function startConnect(networkGuid: string, callback?: () => void): void; + /** + * @description Starts a disconnect from the network with networkGuid. + * @param networkGuid The GUID of the network to connect to. + * @param [callback] Called when the disconnect request has been sent. See note for *startConnect*. + */ + function startDisconnect(networkGuid: string, callback?: () => void): void; + /** + * Returns captive portal status for the network matching 'networkGuid'. + * @param networkGuid The GUID of the network to get captive portal status for. + * @param callback A callback function that returns the results of the query for network captive portal status. + */ + function getCaptivePortalStatus(networkGuid: string, callback: (result: CaptivePortalStatus) => void): void; + /** + * Gets the global policy properties. + * These properties are not expected to change during a session. + */ + function getGlobalPolicy(callback: (result: GlobalPolicy) => void): void; + + // + // EVENTS + // + + /** + * Fired when the properties change on any of the networks. + * Sends a list of GUIDs for networks whose properties have changed. + */ + const onNetworksChanged: chrome.events.Event<(changes: string[]) => void>; + /** + * Fired when the list of networks has changed. Sends a complete list of GUIDs for all the current networks. + */ + const onNetworkListChanged: chrome.events.Event<(changes: string[]) => void>; + /** + * Fired when the list of devices has changed or any device state properties have changed. + */ + const onDeviceStateListChanged: chrome.events.Event<() => void>; + /** + * Fired when a portal detection for a network completes. + * Sends the GUID of the network and the corresponding captive portal status. + */ + const onPortalDetectionCompleted: chrome.events.Event<(networkGuid: string, status: CaptivePortalStatus) => void>; } - //////////////////// - // Notifications - // https://developer.chrome.com/extensions/notifications - //////////////////// + /////////////////// + // Notifications // + /////////////////// /** - * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. - * Permissions: "notifications" + * Use the chrome.notifications API to create rich notifications using + * templates and show these notifications to users in the system tray. + * @requires Permissions: 'notifications' * @since Chrome 28. + * @see[Docs]{@link https://developer.chrome.com/extensions/notifications} */ namespace notifications { interface ButtonOptions { @@ -2088,7 +5491,7 @@ declare namespace chrome { } interface NotificationOptions { - /** Optional. Which type of notification to display. Required for notifications.create method. */ + /** Which type of notification to display. Required for notifications.create method. */ type?: string; /** * Optional. @@ -2096,9 +5499,9 @@ declare namespace chrome { * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. */ iconUrl?: string; - /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */ + /** Title of the notification (e.g. sender name for email). Required for notifications.create method. */ title?: string; - /** Optional. Main notification content. Required for notifications.create method. */ + /** Main notification content. Required for notifications.create method. */ message?: string; /** * Optional. @@ -2106,13 +5509,13 @@ declare namespace chrome { * @since Chrome 31. */ contextMessage?: string; - /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ + /** Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ priority?: number; - /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ + /** A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ eventTime?: number; - /** Optional. Text and icons for up to two notification action buttons. */ + /** Text and icons for up to two notification action buttons. */ buttons?: ButtonOptions[]; - /** Optional. Items for multi-item notifications. */ + /** Items for multi-item notifications. */ items?: ItemOptions[]; /** * Optional. @@ -2132,7 +5535,7 @@ declare namespace chrome { * @since Chrome 38. */ appIconMaskUrl?: string; - /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ + /** A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ imageUrl?: string; /** * Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. @@ -2153,21 +5556,21 @@ declare namespace chrome { interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { } /** The notification closed, either by the system or by user action. */ - export var onClosed: NotificationClosedEvent; + const onClosed: NotificationClosedEvent; /** The user clicked in a non-button area of the notification. */ - export var onClicked: NotificationClickedEvent; + const onClicked: NotificationClickedEvent; /** The user pressed a button in the notification. */ - export var onButtonClicked: NotificationButtonClickedEvent; + const onButtonClicked: NotificationButtonClickedEvent; /** * The user changes the permission level. * @since Chrome 32. */ - export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; + const onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; /** * The user clicked on a link for the app's notification settings. * @since Chrome 32. */ - export var onShowSettings: NotificationShowSettingsEvent; + const onShowSettings: NotificationShowSettingsEvent; /** * Creates and displays a notification. @@ -2179,7 +5582,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(string notificationId) {...}; */ - export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; + function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; /** * Creates and displays a notification. * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. @@ -2190,7 +5593,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(string notificationId) {...}; */ - export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; + function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; /** * Updates an existing notification. * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. @@ -2200,7 +5603,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(boolean wasUpdated) {...}; */ - export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; + function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; /** * Clears the specified notification. * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. @@ -2209,7 +5612,7 @@ declare namespace chrome { * If you specify the callback parameter, it should be a function that looks like this: * function(boolean wasCleared) {...}; */ - export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; + function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; /** * Retrieves all the notifications. * @since Chrome 29. @@ -2217,7 +5620,7 @@ declare namespace chrome { * The callback parameter should be a function that looks like this: * function(object notifications) {...}; */ - export function getAll(callback: (notifications: Object) => void): void; + function getAll(callback: (notifications: Object) => void): void; /** * Retrieves whether the user has enabled notifications from this app or extension. * @since Chrome 32. @@ -2225,7 +5628,7 @@ declare namespace chrome { * The callback parameter should be a function that looks like this: * function( PermissionLevel level) {...}; */ - export function getPermissionLevel(callback: (level: string) => void): void; + function getPermissionLevel(callback: (level: string) => void): void; } //////////////////// @@ -2273,33 +5676,33 @@ declare namespace chrome { * function(boolean result) {...}; * Parameter result: True if the extension has the specified permissions. */ - export function contains(permissions: Permissions, callback: (result: boolean) => void): void; + function contains(permissions: Permissions, callback: (result: boolean) => void): void; /** * Gets the extension's current set of permissions. * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; * Parameter permissions: The extension's active permissions. */ - export function getAll(callback: (permissions: Permissions) => void): void; + function getAll(callback: (permissions: Permissions) => void): void; /** * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * function(boolean granted) {...}; * Parameter granted: True if the user granted the specified permissions. */ - export function request(permissions: Permissions, callback?: (granted: boolean) => void): void; + function request(permissions: Permissions, callback?: (granted: boolean) => void): void; /** * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. - * @param callback If you specify the callback parameter, it should be a function that looks like this: + * @param [callback] If you specify the callback parameter, it should be a function that looks like this: * function(boolean removed) {...}; * Parameter removed: True if the permissions were removed. */ - export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; + function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; /** Fired when access to permissions has been removed from the extension. */ - export var onRemoved: PermissionsRemovedEvent; + const onRemoved: PermissionsRemovedEvent; /** Fired when the extension acquires new permissions. */ - export var onAdded: PermissionsAddedEvent; + const onAdded: PermissionsAddedEvent; } //////////////////// @@ -2307,14 +5710,14 @@ declare namespace chrome { //////////////////// /** * Use the chrome.power API to override the system's power management features. - * Permissions: "power" + * Permissions: 'power' * @since Chrome 27. */ namespace power { /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */ - export function requestKeepAwake(level: string): void; + function requestKeepAwake(level: string): void; /** Releases a request previously made via requestKeepAwake(). */ - export function releaseKeepAwake(): void; + function releaseKeepAwake(): void; } //////////////////// @@ -2322,7 +5725,7 @@ declare namespace chrome { //////////////////// /** * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. - * Permissions: "printerProvider" + * Permissions: 'printerProvider' * @since Chrome 44. */ namespace printerProvider { @@ -2331,7 +5734,7 @@ declare namespace chrome { id: string; /** Printer's human readable name. */ name: string; - /** Optional. Printer's human readable description. */ + /** Printer's human readable description. */ description?: string; } @@ -2347,32 +5750,24 @@ declare namespace chrome { title: string; /** Print ticket in CJT format. */ ticket: Object; - /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */ + /** The document content type. Supported formats are 'application/pdf' and 'image/pwg-raster'. */ contentType: string; /** Blob containing the document data to print. Format must match |contentType|. */ document: Blob; } - interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> { } - - interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> { } - - interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> { } - - interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> { } - /** Event fired when print manager requests printers provided by extensions. */ - export var onGetPrintersRequested: PrinterRequestedEvent; + const onGetPrintersRequested: chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void>; /** * Event fired when print manager requests information about a USB device that may be a printer. * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event. * @since Chrome 45. */ - export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent; + const onGetUsbPrinterInfoRequested: chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void>; /** Event fired when print manager requests printer capabilities. */ - export var onGetCapabilityRequested: CapabilityRequestedEvent; + const onGetCapabilityRequested: chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void>; /** Event fired when print manager requests printing. */ - export var onPrintRequested: PrintRequestedEvent; + const onPrintRequested: chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void>; } //////////////////// @@ -2384,12 +5779,12 @@ declare namespace chrome { */ namespace runtime { /** This will be defined during an API method callback if there was an error */ - export var lastError: LastError | undefined; + const lastError: LastError | undefined; /** The ID of the extension/app. */ - export var id: string; + const id: string; interface LastError { - /** Optional. Details about the error which occurred. */ + /** Details about the error which occurred. */ message?: string; } @@ -2400,7 +5795,7 @@ declare namespace chrome { interface InstalledDetails { /** * The reason that this event is being dispatched. - * One of: "install", "update", "chrome_update", or "shared_module_update" + * One of: 'install', 'update', 'chrome_update', or 'shared_module_update' */ reason: string; /** @@ -2452,17 +5847,17 @@ declare namespace chrome { interface PlatformInfo { /** * The operating system chrome is running on. - * One of: "mac", "win", "android", "cros", "linux", or "openbsd" + * One of: 'mac', 'win', 'android', 'cros', 'linux', or 'openbsd' */ os: string; /** * The machine's processor architecture. - * One of: "arm", "x86-32", or "x86-64" + * One of: 'arm', 'x86-32', or 'x86-64' */ arch: string; /** * The native client architecture. This may be different from arch on some platforms. - * One of: "arm", "x86-32", or "x86-64" + * One of: 'arm', 'x86-32', or 'x86-64' */ nacl_arch: string; } @@ -2480,9 +5875,9 @@ declare namespace chrome { */ sender?: MessageSender; /** An object which allows the addition and removal of listeners for a Chrome event. */ - onDisconnect: PortDisconnectEvent; + onDisconnect: chrome.events.Event<(port: Port) => void>; /** An object which allows the addition and removal of listeners for a Chrome event. */ - onMessage: PortMessageEvent; + onMessage: chrome.events.Event<(message: any, port: Port) => void>; name: string; } @@ -2496,22 +5891,6 @@ declare namespace chrome { version: string; } - interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { } - - interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { } - - interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } - - interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } - - interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> { } - - interface RuntimeEvent extends chrome.events.Event<() => void> { } - - interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> { } - - interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> { } - interface ManifestIcons { [size: number]: string; } @@ -2540,6 +5919,63 @@ declare namespace chrome { is_default?: boolean; } + type Permissions = + 'alarms' | + 'audio' | + 'audioCapture' | + 'background' | + 'browser' | + 'certificateProvider' | + 'clipboard' | + 'clipboardRead' | + 'clipboardWrite' | + 'contextMenus' | + 'desktopCapture' | + 'diagnostics' | + 'displaySource' | + 'dns' | + 'documentScan' | + 'enterprise.deviceAttributes' | + 'enterprise.platformKeys' | + 'experimental' | + 'fileBrowserHandler' | + 'fileSystem' | + 'gcm' | + 'geolocation' | + 'hid' | + 'identity' | + 'idle' | + 'mdns' | + 'mediaGalleries' | + 'nativeMessaging' | + 'networking.config' | + 'networking.onc' | + 'notifications' | + 'platformKeys' | + 'pointerLock' | + 'power' | + 'printerProvider' | + 'proxy' | + 'serial' | + 'signedInDevices' | + 'socket' | + 'storage' | + 'syncFileSystem' | + 'system.cpu' | + 'system.display' | + 'system.memory' | + 'system.network' | + 'system.powerSource' | + 'system.storage' | + 'tts' | + 'unlimitedStorage' | + 'usb' | + 'videoCapture' | + 'virtualKeyboard' | + 'vpnProvider' | + 'wallpaper' | + 'webview'; + interface Manifest { /** Required */ app: { @@ -2629,14 +6065,14 @@ declare namespace chrome { sub_package_path: string; }[]; /** - * Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer. Supported requirements currently include "3D" and "plugins"; additional requirements checks may be added in the future. + * Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer. Supported requirements currently include '3D' and 'plugins'; additional requirements checks may be added in the future. */ requirements?: { /** - * The "3D" requirement denotes GPU hardware acceleration. The "webgl" requirement refers to the WebGL API. For more information on Chrome 3D graphics support, see the help article on WebGL and 3D graphics. You can list the 3D-related features your app requires, as demonstrated in the following example: - * "requirements": { - * "3D": { - * "features": ["webgl"] + * The '3D' requirement denotes GPU hardware acceleration. The 'webgl' requirement refers to the WebGL API. For more information on Chrome 3D graphics support, see the help article on WebGL and 3D graphics. You can list the 3D-related features your app requires, as demonstrated in the following example: + * 'requirements': { + * '3D': { + * 'features': ['webgl'] * } * } */ @@ -2644,10 +6080,10 @@ declare namespace chrome { features?: Array; }; /** - * The "plugins" requirement indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the "plugins" field. For apps and extensions that still work when plugins aren't available, you can disable this requirement by setting NPAPI to false. You can also enable this requirement manually, by setting NPAPI to true, as shown in this example: - * "requirements": { - * "plugins": { - * "npapi": true + * The 'plugins' requirement indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the 'plugins' field. For apps and extensions that still work when plugins aren't available, you can disable this requirement by setting NPAPI to false. You can also enable this requirement manually, by setting NPAPI to true, as shown in this example: + * 'requirements': { + * 'plugins': { + * 'npapi': true * } * } */ @@ -2664,6 +6100,15 @@ declare namespace chrome { pages: string[]; content_security_policy?: string; }; + /** + * The short_name (maximum of 12 characters recommended) is + * a short version of the app's name. It is an optional field + * and if not specified, the name will be used, though it will + * likely be truncated. The short name is typically used where + * there is insufficient space to display the full name, such as: + * - App launcher + * - New Tab page + */ short_name?: string; signature?: any; sockets?: { @@ -2678,7 +6123,7 @@ declare namespace chrome { managed_schema: string }; system_indicator?: any; - update_url?: string; + // update_url?: string; // Listed but deprecated since Chrome 33 - leaving it here so it's not added again url_handlers?: { [name: string]: { matches: string[]; @@ -2708,75 +6153,91 @@ declare namespace chrome { * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. * @since Chrome 26. */ - export function connect(connectInfo?: ConnectInfo): Port; + function connect(connectInfo?: ConnectInfo): Port; /** * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. * @since Chrome 26. * @param extensionId Optional. * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging. */ - export function connect(extensionId: string, connectInfo?: ConnectInfo): Port; + function connect(extensionId: string, connectInfo?: ConnectInfo): Port; /** * Connects to a native application in the host machine. * @since Chrome 28. * @param application The name of the registered application to connect to. */ - export function connectNative(application: string): Port; - /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */ - export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + function connectNative(application: string): Port; + /** - * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. + * Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. + * If the background page is an event page, the system will ensure it is loaded before calling the callback. + * If there is no background page, an error is set. + */ + function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + + /** + * Returns details about the app or extension from the manifest. + * The object returned is a serialization of the full manifest file. * @returns The manifest details. */ - export function getManifest(): Manifest; + function getManifest(): Manifest; + /** * Returns a DirectoryEntry for the package directory. * @since Chrome 29. */ - export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + /** * Returns information about the current platform. * @since Chrome 29. * @param callback Called with results */ - export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + /** * Converts a relative path within an app/extension install directory to a fully-qualified URL. * @param path A path to a resource within an app/extension expressed relative to its install directory. */ - export function getURL(path: string): string; + function getURL(path: string): string; + /** * Reloads the app or extension. * @since Chrome 25. */ - export function reload(): void; + function reload(): void; + /** * Requests an update check for this app/extension. * @since Chrome 25. * @param callback - * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available" + * Parameter status: Result of the update check. One of: 'throttled', 'no_update', or 'update_available' * Optional parameter details: If an update is available, this contains more information about the available update. */ - export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + /** * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. * @since Chrome 32. */ - export function restart(): void; + function restart(): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 26. * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(message: any, responseCallback?: (response: any) => void): void; + function sendMessage(message: any, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 32. * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 26. @@ -2784,7 +6245,8 @@ declare namespace chrome { * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + /** * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. * @since Chrome 32. @@ -2792,7 +6254,8 @@ declare namespace chrome { * @param responseCallback Optional * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** * Send a single message to a native application. * @since Chrome 28. @@ -2801,7 +6264,8 @@ declare namespace chrome { * @param responseCallback Optional. * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message. */ - export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + /** * 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. * @since Chrome 41. @@ -2809,73 +6273,82 @@ declare namespace chrome { * 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. * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. */ - export function setUninstallURL(url: string, callback?: () => void): void; + function setUninstallURL(url: string, callback?: () => void): void; + /** * Open your Extension's options page, if possible. * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload. * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError. * @since Chrome 42. */ - export function openOptionsPage(callback?: () => void): void; + function openOptionsPage(callback?: () => void): void; + + + interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } + + interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } + + interface RuntimeEvent extends chrome.events.Event<() => void> { } /** * Fired when a connection is made from either an extension process or a content script. * @since Chrome 26. */ - export var onConnect: ExtensionConnectEvent; + const onConnect: ExtensionConnectEvent; /** * Fired when a connection is made from another extension. * @since Chrome 26. */ - export var onConnectExternal: ExtensionConnectEvent; + const onConnectExternal: ExtensionConnectEvent; /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */ - export var onSuspend: RuntimeEvent; + const onSuspend: RuntimeEvent; /** * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode. * @since Chrome 23. */ - export var onStartup: RuntimeEvent; + const onStartup: RuntimeEvent; /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */ - export var onInstalled: RuntimeInstalledEvent; + const onInstalled: chrome.events.Event<(details: InstalledDetails) => void>; /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ - export var onSuspendCanceled: RuntimeEvent; + const onSuspendCanceled: RuntimeEvent; /** * Fired when a message is sent from either an extension process or a content script. * @since Chrome 26. */ - export var onMessage: ExtensionMessageEvent; + const onMessage: ExtensionMessageEvent; /** * Fired when a message is sent from another extension/app. Cannot be used in a content script. * @since Chrome 26. */ - export var onMessageExternal: ExtensionMessageEvent; + const onMessageExternal: ExtensionMessageEvent; /** * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. * @since Chrome 29. */ - export var onRestartRequired: RuntimeRestartRequiredEvent; + const onRestartRequired: chrome.events.Event<(reason: string) => void>; /** * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event. * @since Chrome 25. */ - export var onUpdateAvailable: RuntimeUpdateAvailableEvent; + const onUpdateAvailable: chrome.events.Event<(details: UpdateAvailableDetails) => void>; /** * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. */ - export var onBrowserUpdateAvailable: RuntimeEvent; + const onBrowserUpdateAvailable: RuntimeEvent; } //////////////////// // Serial //////////////////// /** - * Use the chrome.serial API to read from and write to a device connected to a serial port. + * Use the chrome.socket API to send and receive data over the network using TCP and UDP connections. + * @deprecated Note: Starting with Chrome 33, + * this API is deprecated in favor of the + * sockets.udp, sockets.tcp and sockets.tcpServer APIs. * @since Chrome 23 */ - namespace serial { - /** NOT YET IMPLEMENTED */ - } + const serial: chrome.deprecated; //////////////////// // Socket @@ -2920,21 +6393,21 @@ declare namespace chrome { address: string; } - export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; - export function destroy(socketId: number): void; - export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; - export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; - export function disconnect(socketId: number): void; - export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; - export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; - export function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; - export function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; - export function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; - export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; - export function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; - export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; - export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; - export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; + function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; + function destroy(socketId: number): void; + function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; + function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function disconnect(socketId: number): void; + function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; + function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; + function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; + function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; + function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; + function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; + function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; + function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; + function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; + function getNetworkList(callback: (result: NetworkInterface[]) => void): void; } namespace sockets.tcp { @@ -2976,28 +6449,28 @@ declare namespace chrome { peerPort?: number; } - export function create(callback: (createInfo: CreateInfo) => void): void; - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; - export function setKeepAlive(socketId: number, + function setKeepAlive(socketId: number, enable: boolean, callback: (result: number) => void): void; - export function setKeepAlive(socketId: number, + function setKeepAlive(socketId: number, enable: boolean, delay: number, callback: (result: number) => void): void; - export function setNoDelay(socketId: number, noDelay: boolean, callback: (result: number) => void): void; - export function connect(socketId: number, + function setNoDelay(socketId: number, noDelay: boolean, callback: (result: number) => void): void; + function connect(socketId: number, peerAddress: string, peerPort: number, callback: (result: number) => void): void; - export function disconnect(socketId: number, callback?: () => void): void; - export function send(socketId: number, data: ArrayBuffer, callback: (sendInfo: SendInfo) => void): void; - export function close(socketId: number, callback?: () => void): void; - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function disconnect(socketId: number, callback?: () => void): void; + function send(socketId: number, data: ArrayBuffer, callback: (sendInfo: SendInfo) => void): void; + function close(socketId: number, callback?: () => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; - export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + const onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + const onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } /** @@ -3029,7 +6502,7 @@ declare namespace chrome { interface SocketProperties { /** * Flag indicating if the socket remains open when the event page of the - * application is unloaded. The default value is "false." When the + * application is unloaded. The default value is 'false.' When the * application is loaded, any sockets previously opened with * persistent=true can be fetched with getSockets. * @@ -3051,7 +6524,7 @@ declare namespace chrome { /** * Flag indicating if the socket remains open when the event page of the * application is unloaded (see SocketProperties.persistent). The - * default value is "false". + * default value is 'false'. */ persistent: boolean; @@ -3061,7 +6534,7 @@ declare namespace chrome { /** * Flag indicating whether connection requests on a listening socket are * dispatched through the onAccept event or queued up in the listen - * queue backlog. See setPaused. The default value is "false" + * queue backlog. See setPaused. The default value is 'false' */ paused: boolean; @@ -3078,7 +6551,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create * @param callback Called when the socket has been created. */ - export function create(callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; /** * Creates a TCP server socket. @@ -3087,7 +6560,7 @@ declare namespace chrome { * @param properties The socket properties. * @param callback Called when the socket has been created. */ - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; /** * Updates the socket properties. @@ -3097,7 +6570,7 @@ declare namespace chrome { * @param properties The properties to update. * @param callback Called when the properties are updated. */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; /** * Enables or disables a listening socket from accepting new connections. @@ -3108,7 +6581,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-setPaused * @param callback Callback from the setPaused method. */ - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; /** * Listens for connections on the specified port and address. If the @@ -3125,7 +6598,7 @@ declare namespace chrome { * ensures a reasonable queue length for most applications. * @param callback Called when listen operation completes. */ - export function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; + function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; /** * Listens for connections on the specified port and address. If the @@ -3139,7 +6612,7 @@ declare namespace chrome { * be found by calling getInfo. * @param callback Called when listen operation completes. */ - export function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; /** * Disconnects the listening socket, i.e. stops accepting new connections @@ -3151,7 +6624,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the disconnect attempt is complete. */ - export function disconnect(socketId: number, callback?: () => void): void; + function disconnect(socketId: number, callback?: () => void): void; /** * Disconnects and destroys the socket. Each socket created should be closed @@ -3163,7 +6636,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the close operation completes. */ - export function close(socketId: number, callback?: () => void): void; + function close(socketId: number, callback?: () => void): void; /** * Retrieves the state of the given socket. @@ -3172,7 +6645,7 @@ declare namespace chrome { * @param socketId The socket identifier. * @param callback Called when the socket state is available. */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; /** * Retrieves the list of currently opened sockets owned by the application. @@ -3180,14 +6653,14 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getSockets * @param callback Called when the list of sockets is available. */ - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; /** * Event raised when a connection has been made to the server socket. * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept */ - export var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; + const onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -3197,13 +6670,13 @@ declare namespace chrome { * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError */ - export var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; + const onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } /** * Use the chrome.sockets.udp API to send and receive data over the network * using UDP connections. This API supersedes the UDP functionality previously - * found in the "socket" API. + * found in the 'socket' API. * * @since Chrome 33 * @see https://developer.chrome.com/apps/sockets_udp @@ -3236,7 +6709,7 @@ declare namespace chrome { interface SocketProperties { /** * Flag indicating if the socket is left open when the event page of the - * application is unloaded. The default value is "false." When the + * application is unloaded. The default value is 'false.' When the * application is loaded, any sockets previously opened with * persistent=true can be fetched with getSockets. * @see http://developer.chrome.com/apps/app_lifecycle.html @@ -3247,7 +6720,7 @@ declare namespace chrome { name?: string; /** - * The size of the buffer used to receive data. If the buffer is too + * The size of the buffer used to Receive data. If the buffer is too * small to receive the UDP packet, data is lost. The default value is * 4096. */ @@ -3299,7 +6772,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_udp#method-create * @param createInfo.socketId The ID of the newly created socket. */ - export function create(callback: (createInfo: CreateInfo) => void): void; + function create(callback: (createInfo: CreateInfo) => void): void; /** * Creates a UDP socket with the given properties. @@ -3308,7 +6781,7 @@ declare namespace chrome { * @param properties The socket properties. * @param createInfo.socketId The ID of the newly created socket. */ - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; /** * Updates the socket properties. @@ -3318,7 +6791,7 @@ declare namespace chrome { * @param properties The properties to update. * @param callback Called when the properties are updated. */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + function update(socketId: number, properties: SocketProperties, callback?: () => void): void; /** * Pauses or unpauses a socket. A paused socket is blocked from firing @@ -3330,7 +6803,7 @@ declare namespace chrome { * @param callback Called when the socket has been successfully paused or * unpaused. */ - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + function setPaused(socketId: number, paused: boolean, callback?: () => void): void; /** * Binds the local address and port for the socket. For a client socket, it @@ -3343,13 +6816,13 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_udp#method-bind * @param socketId The socket ID. * @param address The address of the local machine. DNS name, IPv4 and IPv6 - * formats are supported. Use "0.0.0.0" to accept packets + * formats are supported. Use '0.0.0.0' to accept packets * from all local available network interfaces. - * @param port The port of the local machine. Use "0" to bind to a free + * @param port The port of the local machine. Use '0' to bind to a free * port. * @param callback Called when the bind operation completes. */ - export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; /** * Sends data on the given socket to the given address and port. The socket @@ -3362,7 +6835,7 @@ declare namespace chrome { * @param port The port of the remote machine. * @param callback Called when the send operation completes. */ - export function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; + function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; /** * Closes the socket and releases the address/port the socket is bound to. @@ -3374,7 +6847,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called when the close operation completes. */ - export function close(socketId: number, callback?: () => void): void; + function close(socketId: number, callback?: () => void): void; /** * Retrieves the state of the given socket. @@ -3383,7 +6856,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called when the socket state is available. */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; /** * Retrieves the list of currently opened sockets owned by the application. @@ -3391,7 +6864,7 @@ declare namespace chrome { * @see https://developer.chrome.com/apps/sockets_udp#method-getSockets * @param callback Called when the list of sockets is available. */ - export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; /** * Joins the multicast group and starts to receive packets from that group. @@ -3402,7 +6875,7 @@ declare namespace chrome { * @param address The group address to join. Domain names are not supported. * @param callback Called when the joinGroup operation completes. */ - export function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; + function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; /** * Leaves the multicast group previously joined using joinGroup. This is @@ -3419,7 +6892,7 @@ declare namespace chrome { * supported. * @param callback Called when the leaveGroup operation completes. */ - export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; + function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; /** * Sets the time-to-live of multicast packets sent to the multicast group. @@ -3431,7 +6904,7 @@ declare namespace chrome { * @param ttl The time-to-live value. * @param callback Called when the configuration operation completes. */ - export function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; + function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; /** * Sets whether multicast packets sent from the host to the multicast group @@ -3442,7 +6915,7 @@ declare namespace chrome { * when there is more than one application on the same host joined to the * same multicast group while having different settings on multicast * loopback mode. On Windows, the applications with loopback off will not - * RECEIVE the loopback packets; while on Unix-like systems, the + * receive the loopback packets; while on Unix-like systems, the * applications with loopback off will not SEND the loopback packets to * other applications on the same host. * @see MSDN: http://goo.gl/6vqbj @@ -3454,7 +6927,7 @@ declare namespace chrome { * @param enabled Indicate whether to enable loopback mode. * @param callback Called when the configuration operation completes. */ - export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; + function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; /** * Gets the multicast group addresses the socket is currently joined to. @@ -3463,7 +6936,7 @@ declare namespace chrome { * @param socketId The socket ID. * @param callback Called with an array of strings of the result. */ - export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; + function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; /** * Enables or disables broadcast packets on this socket. @@ -3474,14 +6947,14 @@ declare namespace chrome { * @param enabled true to enable broadcast packets, false to disable them. * @param callback Callback from the setBroadcast method. */ - export function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; + function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; /** * Event raised when a UDP packet has been received for the given socket. * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive */ - export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + const onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -3491,7 +6964,7 @@ declare namespace chrome { * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError */ - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + const onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } //////////////////// @@ -3499,7 +6972,7 @@ declare namespace chrome { //////////////////// /** * Use the chrome.storage API to store, retrieve, and track changes to user data. - * Permissions: "storage" + * Permissions: 'storage' * @since Chrome 20. */ namespace storage { @@ -3526,7 +6999,7 @@ declare namespace chrome { /** * Sets multiple items. * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. - * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). + * Primitive values such as numbers will serialize as expected. Values with a typeof 'object' and 'function' will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). * @param callback Optional. * Callback on success, or on failure (in which case runtime.lastError will be set). */ @@ -3555,9 +7028,9 @@ declare namespace chrome { } interface StorageChange { - /** Optional. The new value of the item, if there is a new value. */ + /** The new value of the item, if there is a new value. */ newValue?: any; - /** Optional. The old value of the item, if there was an old value. */ + /** The old value of the item, if there was an old value. */ oldValue?: any; } @@ -3591,29 +7064,163 @@ declare namespace chrome { interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> { } /** Items in the local storage area are local to each machine. */ - export var local: LocalStorageArea; + const local: LocalStorageArea; /** Items in the sync storage area are synced using Chrome Sync. */ - export var sync: SyncStorageArea; + const sync: SyncStorageArea; /** * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. * @since Chrome 33. */ - export var managed: StorageArea; + const managed: StorageArea; /** Fired when one or more items change. */ - export var onChanged: StorageChangedEvent; + const onChanged: StorageChangedEvent; } //////////////////// // SyncFileSystem //////////////////// /** - * Use the chrome.syncFileSystem API to save and synchronize data on Google Drive. This API is NOT for accessing arbitrary user docs stored in Google Drive. It provides app-specific syncable storage for offline and caching usage so that the same data can be available across different clients. Read Manage Data for more on using this API. + * Use the chrome.syncFileSystem API to save and synchronize data on Google Drive. + * This API is NOT for accessing arbitrary user docs stored in Google Drive. + * It provides app-specific syncable storage for offline and caching usage so that + * the same data can be available across different clients. Read Manage Data for + * more on using this API. + * + * @requires[Permissions: 'syncFileSystem'] + * @see[Learn more: Manage Data]{@link https://developer.chrome.com/apps/app_storage} * @since Chrome 27 */ namespace syncFileSystem { - /** NOT YET IMPLEMENTED */ + /** + * 'initializing' + * - The sync service is being initialized (e.g. restoring data from the database, checking connectivity and authenticating to the service etc). + * 'running' + * - The sync service is up and running. + * 'authentication_required' + * - The sync service is not synchronizing files because the remote service needs to be authenticated by the user to proceed. + * 'temporary_unavailable' + * - The sync service is not synchronizing files because the remote service is (temporarily) unavailable due to some recoverable errors, e.g. network is offline, the remote service is down or not reachable etc. More details should be given by |description| parameter in OnServiceInfoUpdated (which could contain service-specific details). + * 'disabled' + * - The sync service is disabled and the content will never sync. (E.g. this could happen when the user has no account on the remote service or the sync service has had an unrecoverable error.) + */ + type ServiceStatus = + 'initializing' | + 'running' | + 'authentication_required' | + 'temporary_unavailable' | + 'disabled'; + /** + * 'synced' + * - Not conflicting and has no pending local changes. + * 'pending' + * - Has one or more pending local changes that haven't been synchronized. + * 'conflicting' + * - File conflicts with remote version and must be resolved manually. + */ + type FileStatus = + 'synced' | + 'pending' | + 'conflicting'; + type ConflictResolutionPolicy = + 'last_write_win' | + 'manual' + + type Action = + 'added' | + 'updated' | + 'deleted' + + type Direction = + 'local_to_remote' | + 'remote_to_local'; + + interface FileStatusInfo { + /** One of the Entry's originally given to getFileStatuses. */ + fileEntry: Entry; + /** Status value */ + status: FileStatus; + /** Optional error that is only returned if there was a problem retrieving the FileStatus for the given file. */ + error?: string; + } + interface FileStatusChangedDetail { + /** + * fileEntry for the target file whose status has changed. + * Contains name and path information of synchronized file. + * On file deletion, fileEntry information will still be + * available but file will no longer exist. + */ + fileEntry: Entry; + /** + * Resulting file status after onFileStatusChanged event. + * The status value can be 'synced', 'pending' or 'conflicting'. + */ + status: FileStatus; + /** + * Sync action taken to fire onFileStatusChanged event. + * The action value can be 'added', 'updated' or 'deleted'. + * Only applies if status is 'synced'. + */ + action?: Action; + /** + * Sync direction for the onFileStatusChanged event. + * Sync direction value can be 'local_to_remote' or + * 'remote_to_local'. Only applies if status is 'synced'. + */ + direction?: Direction; + } + /** + * Returns a syncable filesystem backed by Google Drive. + * The returned DOMFileSystem instance can be operated on + * in the same way as the Temporary and Persistant file systems + * @see[More information]{@link http://dev.w3.org/2009/dap/file-system/file-dir-sys.html} + * @description + * Calling this multiple times from the same app will return the same handle to the same file system. + * Note this call can fail. + * For example, if the user is not signed in to Chrome + * or if there is no network operation. To handle these + * errors it is important chrome.runtime.lastError is + * checked in the callback. + * @param callback A callback type for requestFileSystem. + */ + function requestFileSystem(callback: (fileSystem: FileSystem) => void): void; + /** + * Sets the default conflict resolution policy for the 'syncable' file storage + * for the app. By default it is set to 'last_write_win'. When conflict resolution + * policy is set to 'last_write_win' conflicts for existing files are automatically + * resolved next time the file is updated. |callback| can be optionally given to + * know if the request has succeeded or not. + * @param policy Policy + * @param [callback] A generic result callback to indicate success or failure. + */ + function setConflictResolutionPolicy(policy: ConflictResolutionPolicy, callback?: () => void): void; + /** Gets the current conflict resolution policy. */ + function getConflictResolutionPolicy(callback: (policy: ConflictResolutionPolicy) => void): void; + /** + * Returns the current usage and quota in bytes for the 'syncable' file storage for the app. + * @param fileSystem + * @param callback + */ + function getUsageAndQuota(fileSystem: FileSystem, callback: (info: { usageBytes: number, quotaBytes: number }) => void): void; + /** + * Returns the FileStatus for the given fileEntry. + * Note that 'conflicting' state only happens when + * the service's conflict resolution policy is set to 'manual'. + * */ + function getFileStatus(fileEntry: Entry, callback: (status: FileStatus) => void): void; + /** Returns each FileStatus for the given fileEntry array. Typically called with the result from dirReader.readEntries(). */ + function getFileStatuses(fileEntries: Entry[], callback: (status: FileStatusInfo[]) => void): void; + /** + * Returns the current sync backend status. + * @since Chrome 31. + * @param callback + */ + function getServiceStatus(callback: (status: ServiceStatus) => void): void; + /** Fired when an error or other status change has happened in the sync backend (for example, when the sync is temporarily disabled due to network or authentication error). */ + const onServiceStatusChanged: chrome.events.Event<(detail: { state: ServiceStatus, description: string }) => void>; + /** Fired when a file has been updated by the background sync service. */ + const onFileStatusChanged: chrome.events.Event<(detail: FileStatusChangedDetail) => void>; } @@ -3622,7 +7229,7 @@ declare namespace chrome { //////////////////// /** * Use the system.cpu API to query CPU metadata. - * Permissions: "system.cpu" + * Permissions: 'system.cpu' * @since Chrome 32. */ namespace system.cpu { @@ -3651,7 +7258,7 @@ declare namespace chrome { modelName: string; /** * A set of feature codes indicating some of the processor's capabilities. - * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". + * The currently supported codes are 'mmx', 'sse', 'sse2', 'sse3', 'ssse3', 'sse4_1', 'sse4_2', and 'avx'. */ features: string[]; /** Information about each logical processor. */ @@ -3659,7 +7266,7 @@ declare namespace chrome { } /** Queries basic CPU information of the system. */ - export function getInfo(callback: (info: CpuInfo) => void): void; + function getInfo(callback: (info: CpuInfo) => void): void; } //////////////////// @@ -3667,7 +7274,7 @@ declare namespace chrome { //////////////////// /** * Use the system.display API to query display metadata. - * Permissions: "system.display" + * Permissions: 'system.display' * @since Chrome 30. */ namespace system.display { @@ -3707,7 +7314,7 @@ declare namespace chrome { * @since Chrome 57 */ interface TouchCalibrationPair { - /** The coordinates of the display point. */ + /** The coordinates of the display point. */ displayPoint: Point; /** The coordinates of the touch point corresponding to the display point. */ touchPoint: Point; @@ -3742,6 +7349,8 @@ declare namespace chrome { isSelected: boolean; } + type DisplayPosition = 'top' | 'right' | 'bottom' | 'left'; + /** * @since Chrome 53 */ @@ -3751,13 +7360,13 @@ declare namespace chrome { /** The unique identifier of the parent display. Empty if this is the root. */ parentId: string; /** The layout position of this display relative to the parent. This will be ignored for the root. */ - position: 'top' | 'right' | 'bottom' | 'left'; + position: DisplayPosition; /** The offset of the display along the connected edge. 0 indicates that the topmost or leftmost corners are aligned. */ offset: number; } /** - * @description The pairs of point used to calibrate the display. + * The pairs of point used to calibrate the display. * @export * @interface TouchCalibrationPairs */ @@ -3773,13 +7382,13 @@ declare namespace chrome { } /** - * @description Representation of info data to be used in chrome.system.display.setDisplayProperties() + * Representation of info data to be used in chrome.system.display.setDisplayProperties() * @export * @interface DisplayPropertiesInfo */ interface DisplayPropertiesInfo { /** - * @description Chrome OS only. If set to true, changes the display mode to unified desktop (see enableUnifiedDesktop for details). If set to false, unified desktop mode will be disabled. This is only valid for the primary display. If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. + * Chrome OS only. If set to true, changes the display mode to unified desktop (see enableUnifiedDesktop for details). If set to false, unified desktop mode will be disabled. This is only valid for the primary display. If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. * @since Chrome 59 * */ isUnified?: boolean; @@ -3806,20 +7415,20 @@ declare namespace chrome { /** * @since Chrome 52 - * @description If set, updates the display mode to the mode matching this value. + * If set, updates the display mode to the mode matching this value. */ displayMode?: DisplayMode; } /** - * @description Options affecting how the information is returned. + * Options affecting how the information is returned. * @since Chrome 59 * @export * @interface DisplayInfoFlags */ interface DisplayInfoFlags { /** - * @description If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode (see enableUnifiedDesktop). Defaults to false. + * If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode (see enableUnifiedDesktop). Defaults to false. * @type {boolean} * @memberof DisplayInfoFlags */ @@ -3830,7 +7439,7 @@ declare namespace chrome { interface DisplayInfo { /** The unique identifier of the display. */ id: string; - /** The user-friendly name (e.g. "HP LCD monitor"). */ + /** The user-friendly name (e.g. 'HP LCD monitor'). */ name: string; /** Identifier of the display that is being mirrored on the display unit. If mirroring is not in progress, set to an empty string. Currently exposed only on ChromeOS. Will be empty string on other platforms. */ mirroringSourceId: string; @@ -3871,7 +7480,7 @@ declare namespace chrome { } /** - * @description Fired when anything changes to the display configuration. + * Fired when anything changes to the display configuration. * @export * @interface DisplayChangedEvent * @extends {chrome.events.Event<() => void>} @@ -3879,123 +7488,123 @@ declare namespace chrome { interface DisplayChangedEvent extends chrome.events.Event<() => void> { } /** - * @description Requests the information for all attached display devices. + * Requests the information for all attached display devices. * @export * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. */ - export function getInfo(callback: (info: DisplayInfo[]) => void): void; + function getInfo(callback: (info: DisplayInfo[]) => void): void; /** - * @description Requests the information for all attached display devices. + * Requests the information for all attached display devices. * @export * @since Chrome 59 * @param {DisplayInfoFlags} [flags] Options affecting how the information is returned. * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. */ - export function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void; + function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void; /** - * @description Requests the layout info for all displays. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Requests the layout info for all displays. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 53 * @export * @param {(layouts: DisplayLayout[]) => void} callback The callback to invoke with the results. */ - export function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void; + function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void; /** - * @description Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @export * @param {string} id The display's unique identifier. * @param {DisplayPropertiesInfo} info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. * @param {() => void} [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. */ - export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void; + function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void; /** - * @description Set the layout for all displays. Any display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Set the layout for all displays. Any display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 53 * @export * @param {DisplayLayout[]} layouts The layout information, required for all displays except the primary display. * @param {() => void} callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. */ - export function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void; + function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void; /** - * @description Enables/disables the unified desktop feature. Note that this simply enables the feature, but will not change the actual desktop mode. (That is, if the desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * Enables/disables the unified desktop feature. Note that this simply enables the feature, but will not change the actual desktop mode. (That is, if the desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only available to Chrome OS Kiosk apps and Web UI. * @since Chrome 46 * @export * @param {boolean} enabled True if unified desktop should be enabled. */ - export function enableUnifiedDesktop(enabled: boolean): void; + function enableUnifiedDesktop(enabled: boolean): void; /** - * @description Starts overscan calibration for a display. This will show an overlay on the screen indicating the current overscan insets. If overscan calibration for display |id| is in progress this will reset calibration. + * Starts overscan calibration for a display. This will show an overlay on the screen indicating the current overscan insets. If overscan calibration for display |id| is in progress this will reset calibration. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationStart(id: string): void; + function overscanCalibrationStart(id: string): void; /** - * @description Adjusts the current overscan insets for a display. Typically this should etiher move the display along an axis (e.g. left+right have the same value) or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust call is cumulative with previous calls since Start. + * Adjusts the current overscan insets for a display. Typically this should etiher move the display along an axis (e.g. left+right have the same value) or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust call is cumulative with previous calls since Start. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. * @param {Insets} delta The amount to change the overscan insets. */ - export function overscanCalibrationAdjust(id: string, delta: Insets): void; + function overscanCalibrationAdjust(id: string, delta: Insets): void; /** - * @description Resets the overscan insets for a display to the last saved value (i.e before Start was called). + * Resets the overscan insets for a display to the last saved value (i.e before Start was called). * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationReset(id: string): void; + function overscanCalibrationReset(id: string): void; /** - * @description Complete overscan adjustments for a display by saving the current values and hiding the overlay. + * Complete overscan adjustments for a display by saving the current values and hiding the overlay. * @since Chrome 53 * @export * @param {string} id The display's unique identifier. */ - export function overscanCalibrationComplete(id: string): void; + function overscanCalibrationComplete(id: string): void; /** - * @description Displays the native touch calibration UX for the display with |id| as display id. This will show an overlay on the screen with required instructions on how to proceed. The callback will be invoked in case of successful calibraion only. If the calibration fails, this will throw an error. + * Displays the native touch calibration UX for the display with |id| as display id. This will show an overlay on the screen with required instructions on how to proceed. The callback will be invoked in case of successful calibraion only. If the calibration fails, this will throw an error. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. * @param {(success) => void} callback Optional callback to inform the caller that the touch calibration has ended. The argument of the callback informs if the calibration was a success or not. */ - export function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void; + function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void; /** - * @description Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error. + * Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. */ - export function startCustomTouchCalibration(id: string): void; + function startCustomTouchCalibration(id: string): void; /** - * @description Sets the touch calibration pairs for a display. These |pairs| would be used to calibrate the touch screen for display with |id| called in startCustomTouchCalibration(). Always call |startCustomTouchCalibration| before calling this method. If another touch calibration is already in progress this will throw an error. + * Sets the touch calibration pairs for a display. These |pairs| would be used to calibrate the touch screen for display with |id| called in startCustomTouchCalibration(). Always call |startCustomTouchCalibration| before calling this method. If another touch calibration is already in progress this will throw an error. * @since Chrome 57 * @export * @param {TouchCalibrationPairs} pairs The pairs of point used to calibrate the display. * @param {Bounds} bounds Bounds of the display when the touch calibration was performed. |bounds.left| and |bounds.top| values are ignored. */ - export function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void; + function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void; /** - * @description Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display. + * Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display. * @since Chrome 57 * @export * @param {string} id The display's unique identifier. */ - export function clearTouchCalibration(id: string): void; + function clearTouchCalibration(id: string): void; /** - * @description Fired when anything changes to the display configuration. + * Fired when anything changes to the display configuration. * @export */ - export var onDisplayChanged: DisplayChangedEvent; + const onDisplayChanged: DisplayChangedEvent; } //////////////////// @@ -4003,7 +7612,7 @@ declare namespace chrome { //////////////////// /** * The chrome.system.memory API. - * Permissions: "system.memory" + * Permissions: 'system.memory' * @since Chrome 32. */ namespace system.memory { @@ -4015,7 +7624,7 @@ declare namespace chrome { } /** Get physical memory information. */ - export function getInfo(callback: (info: MemoryInfo) => void): void; + function getInfo(callback: (info: MemoryInfo) => void): void; } //////////////////// @@ -4028,7 +7637,7 @@ declare namespace chrome { prefixLength: number; } - export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; + function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; } //////////////////// @@ -4036,7 +7645,7 @@ declare namespace chrome { //////////////////// /** * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. - * Permissions: "system.storage" + * Permissions: 'system.storage' * @since Chrome 30. */ namespace system.storage { @@ -4068,23 +7677,23 @@ declare namespace chrome { interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> { } /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ - export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; + function getInfo(callback: (info: StorageUnitInfo[]) => void): void; /** * Ejects a removable storage device. * @param callback * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. */ - export function ejectDevice(id: string, callback: (result: string) => void): void; + function ejectDevice(id: string, callback: (result: string) => void): void; /** * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. * @since Dev channel only. */ - export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; + function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; /** Fired when a new removable storage is attached to the system. */ - export var onAttached: SystemStorageAttachedEvent; + const onAttached: SystemStorageAttachedEvent; /** Fired when a removable storage is detached from the system. */ - export var onDetached: SystemStorageDetachedEvent; + const onDetached: SystemStorageDetachedEvent; } //////////////////// @@ -4092,33 +7701,33 @@ declare namespace chrome { //////////////////// /** * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. - * Permissions: "tts" + * Permissions: 'tts' * @since Chrome 14. */ namespace tts { /** An event from the TTS engine to communicate the status of an utterance. */ interface TtsEvent { - /** Optional. The index of the current character in the utterance. */ + /** The index of the current character in the utterance. */ charIndex?: number; - /** Optional. The error description, if the event type is 'error'. */ + /** The error description, if the event type is 'error'. */ errorMessage?: string; /** * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. - * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume" + * One of: 'start', 'end', 'word', 'sentence', 'marker', 'interrupted', 'cancelled', 'error', 'pause', or 'resume' */ type: string; } /** A description of a voice available for speech synthesis. */ interface TtsVoice { - /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + /** The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; /** - * Optional. This voice's gender. - * One of: "male", or "female" + * This voice's gender. + * One of: 'male', or 'female' */ gender?: string; - /** Optional. The name of the voice. */ + /** The name of the voice. */ voiceName?: string; /** The ID of the extension providing this voice. */ extensionsId?: string; @@ -4132,7 +7741,7 @@ declare namespace chrome { } interface SpeakOptions { - /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + /** Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ volume?: number; /** * Optional. @@ -4145,7 +7754,7 @@ declare namespace chrome { */ rate?: number; /** - * Optional. This function is called with events that occur in the process of speaking the utterance. + * This function is called with events that occur in the process of speaking the utterance. * @param event The update event from the text-to-speech engine indicating the status of this utterance. */ onEvent?: (event: TtsEvent) => void; @@ -4154,52 +7763,52 @@ declare namespace chrome { * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. */ pitch?: number; - /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + /** The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; - /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */ + /** The name of the voice to use for synthesis. If empty, uses any available voice. */ voiceName?: string; - /** Optional. The extension ID of the speech engine to use, if known. */ + /** The extension ID of the speech engine to use, if known. */ extensionId?: string; /** - * Optional. Gender of voice for synthesized speech. - * One of: "male", or "female" + * Gender of voice for synthesized speech. + * One of: 'male', or 'female' */ gender?: string; - /** Optional. The TTS event types the voice must support. */ + /** The TTS event types the voice must support. */ requiredEventTypes?: string[]; - /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ + /** The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ desiredEventTypes?: string[]; } /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */ - export function isSpeaking(callback?: (speaking: boolean) => void): void; + function isSpeaking(callback?: (speaking: boolean) => void): void; /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */ - export function stop(): void; + function stop(): void; /** Gets an array of all available voices. */ - export function getVoices(callback?: (voices: TtsVoice[]) => void): void; + function getVoices(callback?: (voices: TtsVoice[]) => void): void; /** * Speaks text using a text-to-speech engine. * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * @param callback Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ - export function speak(utterance: string, callback?: Function): void; + function speak(utterance: string, callback?: Function): void; /** * Speaks text using a text-to-speech engine. * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. - * @param options Optional. The speech options. - * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + * @param options The speech options. + * @param callback Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. */ - export function speak(utterance: string, options: SpeakOptions, callback?: Function): void; + function speak(utterance: string, options: SpeakOptions, callback?: Function): void; /** * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. * @since Chrome 29. */ - export function pause(): void; + function pause(): void; /** * If speech was paused, resumes speaking where it left off. * @since Chrome 29. */ - export function resume(): void; + function resume(): void; } //////////////////// @@ -4240,14 +7849,14 @@ declare namespace chrome { } interface ChromeSettingGetDetails { - /** Optional. Whether to return the value that applies to the incognito session (default false). */ + /** Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } /** * @param details Details of the currently effective value. */ - export type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; + type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; interface ChromeSettingGetResultDetails { /** @@ -4275,7 +7884,7 @@ declare namespace chrome { /** * Sets the value of a setting. * @param details Which setting to change. - * @param callback Optional. Called at the completion of the set operation. + * @param callback Called at the completion of the set operation. */ set(details: ChromeSettingSetDetails, callback?: Function): void; /** @@ -4286,7 +7895,7 @@ declare namespace chrome { /** * Clears the setting, restoring any default value. * @param details Which setting to clear. - * @param callback Optional. Called at the completion of the clear operation. + * @param callback Called at the completion of the clear operation. */ clear(details: ChromeSettingClearDetails, callback?: Function): void; /** Fired after the setting changes. */ @@ -4315,13 +7924,17 @@ declare namespace chrome { productId: number } + type EndpointType = 'control' | 'interrupt' | 'isochronous' | 'bulk'; + type EndpointSyncType = 'asynchronous' | 'adaptive' | 'synchronous'; + type EndpointUsage = 'data' | 'feedback' | 'explicitFeedback'; + interface EndpointDescriptor { address: number, - type: 'control' | 'interrupt' | 'isochronous' | 'bulk', + type: EndpointType, direction: Direction, maximumPacketSize: number, - synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', - usage?: 'data' | 'feedback' | 'explicitFeedback', + synchronization?: EndpointSyncType, + usage?: EndpointUsage, pollingInterval?: number, extra_data: ArrayBuffer } @@ -4369,10 +7982,14 @@ declare namespace chrome { interfaceProtocol?: number } + type TransferRecipient = 'device' | 'interface' | 'endpoint' | 'other'; + + type TransferRequestType = 'standard' | 'class' | 'vendor' | 'reserved'; + interface TransferInfo { direction: Direction; - recipient: 'device' | 'interface' | 'endpoint' | 'other'; - requestType: 'standard' | 'class' | 'vendor' | 'reserved'; + recipient: TransferRecipient; + requestType: TransferRequestType; request: number; value: number; index: number; @@ -4383,27 +8000,27 @@ declare namespace chrome { interface DeviceEvent extends chrome.events.Event<(device: Device) => void> { } - export var onDeviceAdded: DeviceEvent; - export var onDeviceRemoved: DeviceEvent; + const onDeviceAdded: DeviceEvent; + const onDeviceRemoved: DeviceEvent; - export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; - export function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; - export function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; - export function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; - export function closeDevice(handle: ConnectionHandle, callback?: () => void): void; - export function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; - export function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; - export function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; - export function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; - export function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; - export function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; - export function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; + function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; + function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; + function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; + function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; + function closeDevice(handle: ConnectionHandle, callback?: () => void): void; + function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; + function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; + function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; + function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; + function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; + function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; + function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; } @@ -4412,7 +8029,7 @@ declare namespace chrome { //////////////////// /** * Use the chrome.vpnProvider API to implement a VPN client. - * Permissions: "vpnProvider" + * Permissions: 'vpnProvider' * Important: This API works only on Chrome OS. * @since Chrome 43. */ @@ -4420,19 +8037,19 @@ declare namespace chrome { interface VpnSessionParameters { /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */ address: string; - /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ + /** Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ broadcastAddress?: string; - /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */ + /** MTU setting for the VPN interface. (default: 1500 bytes) */ mtu?: string; /** * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */ exclusionList: string[]; /** - * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry '0.0.0.0/0' to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */ inclusionList: string[]; - /** Optional. A list of search domains. (default: no search domain) */ + /** A list of search domains. (default: no search domain) */ domainSearch?: string[]; /** A list of IPs for the DNS servers. */ dnsServer: string[]; @@ -4454,135 +8071,123 @@ declare namespace chrome { * @param callback Called when the configuration is created or if there is an error. * Parameter id: A unique ID for the created configuration, empty string on failure. */ - export function createConfig(name: string, callback: (id: string) => void): void; + function createConfig(name: string, callback: (id: string) => void): void; /** * Destroys a VPN configuration created by the extension. * @param id ID of the VPN configuration to destroy. - * @param callback Optional. Called when the configuration is destroyed or if there is an error. + * @param callback Called when the configuration is destroyed or if there is an error. */ - export function destroyConfig(id: string, callback?: Function): void; + function destroyConfig(id: string, callback?: Function): void; /** - * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension. + * Sets the parameters for the VPN session. This should be called immediately after 'connected' is received from the platform. This will succeed only when the VPN session is owned by the extension. * @param parameters The parameters for the VPN session. * @param callback Called when the parameters are set or if there is an error. */ - export function setParameters(parameters: VpnSessionParameters, callback: Function): void; + function setParameters(parameters: VpnSessionParameters, callback: Function): void; /** * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. * @param data The IP packet to be sent to the platform. - * @param callback Optional. Called when the packet is sent or if there is an error. + * @param callback Called when the packet is sent or if there is an error. */ - export function sendPacket(data: ArrayBuffer, callback?: Function): void; + function sendPacket(data: ArrayBuffer, callback?: Function): void; /** * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. * @param state The VPN session state of the VPN client. * connected: VPN connection was successful. * failure: VPN connection failed. - * @param callback Optional. Called when the notification is complete or if there is an error. + * @param callback Called when the notification is complete or if there is an error. */ - export function notifyConnectionStateChanged(state: string, callback?: Function): void; + function notifyConnectionStateChanged(state: string, callback?: Function): void; /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ - export var onPlatformMessage: VpnPlatformMessageEvent; + const onPlatformMessage: VpnPlatformMessageEvent; /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ - export var onPacketReceived: VpnPacketReceptionEvent; + const onPacketReceived: VpnPacketReceptionEvent; /** Triggered when a configuration created by the extension is removed by the platform. */ - export var onConfigRemoved: VpnConfigRemovalEvent; + const onConfigRemoved: VpnConfigRemovalEvent; /** Triggered when a configuration is created by the platform for the extension. */ - export var onConfigCreated: VpnConfigCreationEvent; + const onConfigCreated: VpnConfigCreationEvent; /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */ - export var onUIEvent: VpnUiEvent; + const onUIEvent: VpnUiEvent; } - //////////////////// - // Wallpaper - //////////////////// + /////////////// + // Wallpaper // + /////////////// /** * Use the chrome.wallpaper API to change the ChromeOS wallpaper. - * Permissions: "wallpaper" - * Important: This API works only on Chrome OS. + * @requires Permissions: 'wallpaper' + * @requires Important: This API works only on Chrome OS. * @since Chrome 43. */ namespace wallpaper { + type WallpaperLayout = + 'STRETCH' | + 'CENTER' | + 'CENTER_CROPPED'; interface WallpaperDetails { - /** Optional. The jpeg or png encoded wallpaper image. */ + /** The jpeg or png encoded wallpaper image. */ data?: any; - /** Optional. The URL of the wallpaper to be set. */ + /** The URL of the wallpaper to be set. */ url?: string; - /** - * The supported wallpaper layouts. - * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" - */ - layout: string; + /** The supported wallpaper layouts. */ + layout: WallpaperLayout; /** The file name of the saved wallpaper. */ filename: string; - /** Optional. True if a 128x60 thumbnail should be generated. */ + /** True if a 128x60 thumbnail should be generated. */ thumbnail?: boolean; } /** * Sets wallpaper to the image at url or wallpaperData with the specified layout - * @param callback - * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. + * @param callback Contains the optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. */ - export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; + function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: string) => void): void; } - /////////////////// - // Webview Tag - /////////////////// + ///////////////// + // Webview Tag // + ///////////////// /** - * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the webview and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see Usage). + * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. + * Your app can control the appearance of the *webview* and interact with the web content, initiate navigations in + * an embedded web page, react to error events that happen within it. */ namespace webview { - /** Options that determine what data should be cleared by `clearData`. */ + /** Options that determine what data should be cleared by *clearData`* */ interface ClearDataOptions { - /** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */ + /** + * Clear data accumulated on or after this date, + * represented in milliseconds since the epoch + * (accessible via the getTime method of the JavaScript *Date* object). + * If absent, defaults to *0* (which would remove all browsing data). + **/ since?: number; } interface WindowEvent extends chrome.events.Event<() => void> { } interface ConsoleEvent extends Event { - /** - * @description The severity level of the log message. Ranges from 0 to 4. - * @type {number} - * @memberof ConsoleEvent - */ + /** The severity level of the log message. Ranges from 0 to 4. */ level: number; - /** - * @description The logged message contents. - * @type {string} - * @memberof ConsoleEvent - */ + /** The logged message contents.*/ message: string; - /** - * @description The line number of the message source. - * @type {number} - * @memberof ConsoleEvent - */ + /** The line number of the message source.*/ line: number; - /** - * @description A string identifying the resource which logged the message. - * @type {string} - * @memberof ConsoleEvent - */ + /** A string identifying the resource which logged the message. */ sourceId: string; } + type ExitEventReason = + 'normal' | + 'abnormal' | + 'crash' | + 'kill'; interface ExitEvent extends Event { - /** - * @description Chrome's internal ID of the process that exited. - * @type {number} - * @memberof ExitEvent - */ + /** Chrome's internal ID of the process that exited. */ processID: number; - /** - * @description String indicating the reason for the exit. - * @type {string} - * @memberof ExitEvent - */ - reason: 'normal' | 'abnormal' | 'crash' | 'kill'; + /** String indicating the reason for the exit. */ + reason: ExitEventReason; } /** Description of a declarative rule for handling events. */ @@ -4591,1186 +8196,1229 @@ declare namespace chrome { priority?: number; /** List of conditions that can trigger the actions. */ conditions: any[]; - /** Optional. Optional identifier that allows referencing this rule. */ + /** Optional identifier that allows referencing this rule. */ id?: string; /** List of actions that are triggered if one of the condtions is fulfilled. */ actions: any[]; /** - * @description Tags can be used to annotate rules and perform operations on sets of rules.¨ + * Tags can be used to annotate rules and perform operations on sets of rules.¨ * @since Chrome 28 - * @type {string[]} - * @memberof Rule */ tags?: string[]; } /** - * @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. - * @export - * @interface InjectDetails + * Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. */ interface InjectDetails { /** - * @description JavaScript or CSS code to inject.

Warning:
Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks. - * @type {string} - * @memberof InjectDetails + * JavaScript or CSS code to inject. + * + * **Warning** + * Be careful using the *code* parameter. + * Incorrect use of it may open your app to + * cross site scripting attacks. + * @see[More information]{@link https://en.wikipedia.org/wiki/Cross-site_scripting} */ code?: string, /** - * @description JavaScript or CSS file to inject. - * @type {string} - * @memberof InjectDetails + * JavaScript or CSS file to inject. */ file?: string } - interface WebViewElementEventMap { - 'close': Event, - 'consolemessage': IConsolemessage, - 'contentload': Event, - 'dialog': IDialog, - 'exit': IExit, - 'findupdate': IFindupdate, - 'loadabort': ILoadabort, - 'loadcommit': ILoadcommit, - 'loadredirect': ILoadredirect, - 'loadstart': ILoadstart, - 'loadstop': Event, - 'newwindow': INewwindow, - 'permissionrequest': IPermissionrequest, - 'responsive': IResponsive, - 'sizechanged': ISizechanged, - 'unresponsive': IUnresponsive, - 'zoomchange': IZoomchange, - } - - /** - * @description - * @export - * @interface HTMLWebViewElement - * @extends {Element} + * WebView element from html */ - interface HTMLWebViewElement extends Element { - executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void; + interface HTMLWebViewElement extends HTMLElement { + /** This sets the guest content's window.name object.**/ + name: string; + + /** + * Returns the visible URL. Mirrors the logic in the browser's omnibox: either returning a pending new navigation if initiated by the embedder page, or the last committed navigation. Writing to this attribute initiates top-level navigation. + * Assigning src its own value will reload the current page. + * The src attribute cannot be cleared or removed once it has been set, unless the webview is removed from the DOM. + * The src attribute can also accept data URLs, such as 'data:text/plain,Hello, world!'. + */ src: string; - contentWindow: Window; - addEventListener(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void; + + /** + * Storage partition ID used by the webview tag. + * If the storage partition ID starts with persist: (partition='persist:googlepluswidgets'), + * the webview will use a persistent storage partition available to all guests in the app with the same storage partition ID. + * If the ID is unset or if there is no 'persist': prefix, the webview will use an in-memory storage partition. + * his value can only be modified before the first navigation, since the storage partition of an active renderer process cannot change. + * Subsequent attempts to modify the value will fail with a DOM exception. + * By assigning the same partition ID, multiple webviews can share the same storage partition. + */ + partition?: string; + + /** + * If present, portions of the embedder could be visible through the webview, + * where the contents are transparent. Without allowtransparency enabled, + * no part of the embedder will be shown through the webview, + * even if elements exist that are specified as transparent. + * This does not affect transparency within the contents of the webview itself. + */ + allowtransparency?: boolean; + + /** + * If 'on', the webview container will automatically resize within the bounds specified by the attributes minwidth, minheight, maxwidth, and maxheight. + * These constraints do not impact the webview UNLESS autosize is enabled. + * When autosize is enabled, the webview container size cannot be less than the minimum values or greater than the maximum. + */ + autosize?: 'on'; + + /** + * Object reference which can be used to post messages into the guest page. + */ + contentWindow: ContentWindow; + + /** Interface which provides access to webRequest events on the guest page. */ + request: WebRequestEventInterface; + + /** Similar to chrome's ContextMenus API, but applies to webview instead of browser. + * Use the webview.contextMenus API to add items to webview's context menu. + * You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. */ + contextMenus: webview.ContextMenus; + /** + * Fired when the guest window attempts to close itself. + * The following example code navigates the webview to about:blank when the guest attempts to close itself. + */ + addEventListener(type: 'close', listener: (this: HTMLWebViewElement) => void, useCapture?: boolean): void; + /** + * Fired when the guest window logs a console message. + * The following example code forwards all log messages to the embedder's console without regard for log level or other properties. + */ + addEventListener(type: 'consolemessage', listener: (this: HTMLWebViewElement, ev: ConsoleMessage) => void, useCapture?: boolean): void; + /** + * Fired when the guest window fires a load event, i.e., when a new document is loaded. This does not include page navigation within the current document or asynchronous resource loads. + * The following example code modifies the default font size of the guest's body element after the page loads: + * @example + * webview.addEventListener('contentload', function() { + * webview.executeScript({ code: 'document.body.style.fontSize = '42px'' }) + * }); + */ + addEventListener(type: 'contentload', listener: (this: HTMLWebViewElement) => void, useCapture?: boolean): void; + /** + * Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt. + * Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.) + * The default behavior is to cancel the dialog. + */ + addEventListener(type: 'dialog', listener: (this: HTMLWebViewElement, ev: Dialog) => void, useCapture?: boolean): void; + /** + * Fired when the process rendering the guest web content has exited. + */ + addEventListener(type: 'exit', listener: (this: HTMLWebViewElement, ev: Exit) => void, useCapture?: boolean): void; + /** + * Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found. + */ + addEventListener(type: 'findupdate', listener: (this: HTMLWebViewElement, ev: FindUpdate) => void, useCapture?: boolean): void; + /** + * Fired when a top-level load has aborted without committing. An error message will be printed to the console unless the event is default-prevented. + * Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted. + * Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'. + */ + addEventListener(type: 'loadabort', listener: (this: HTMLWebViewElement, ev: LoadAbort) => void, useCapture?: boolean): void; + /** + * Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. + */ + addEventListener(type: 'loadcommit', listener: (this: HTMLWebViewElement, ev: LoadCommit) => void, useCapture?: boolean): void; + /** + * Fired when a top-level load request has redirected to a different URL. + */ + addEventListener(type: 'loadredirect', listener: (this: HTMLWebViewElement, ev: LoadRedirect) => void, useCapture?: boolean): void; + /** + * Fired when a load has begun. + */ + addEventListener(type: 'loadstart', listener: (this: HTMLWebViewElement, ev: LoadStart) => void, useCapture?: boolean): void; + /** + * Fired when all frame-level loads in a guest page (including all its subframes) have completed. + * This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. + * This event fires every time the number of document-level loads transitions from one (or more) to zero. For example, if a page that has already finished loading (i.e., loadstop already fired once) creates a new iframe which loads a page, then a second loadstop will fire when the iframe page load completes. + * This pattern is commonly observed on pages that load ads. + * Note: When a committed load is aborted, a loadstop event will eventually follow a loadabort event, even if all committed loads since the last loadstop event (if any) were aborted. + */ + addEventListener(type: 'loadstop', listener: (this: HTMLWebViewElement) => void, useCapture?: boolean): void; + /** + * Fired when the guest page attempts to open a new browser window. + * The following example code will create and navigate a new webview in the embedder for each requested new window: + * @example + * webview.addEventListener('newwindow', function(e) { + * const newWebview = document.createElement('webview'); + * document.body.appendChild(newWebview); + * e.window.attach(newWebview); + * }); + */ + addEventListener(type: 'newwindow', listener: (this: HTMLWebViewElement, ev: NewWindow) => void, useCapture?: boolean): void; + /** + * Fired when the guest page needs to request special permission from the embedder. + * The following example code will grant the guest page access to the webkitGetUserMedia API. + * Note that an app using this example code must itself specify audioCapture and/or videoCapture manifest permissions: + * @example + * webview.addEventListener('permissionrequest', function(e) { + * if (e.permission === 'media') { + * e.request.allow(); + * } + * }); + */ + addEventListener(type: 'permissionrequest', listener: (this: HTMLWebViewElement, ev: PermissionRequest) => void, useCapture?: boolean): void; + /** Fired when the process rendering the guest web content has become responsive again after being unresponsive. */ + addEventListener(type: 'response', listener: (this: HTMLWebViewElement, ev: ProcessResponsive) => void, useCapture?: boolean): void; + /** Fired when the embedded web content has been resized via autosize. Only fires if autosize is enabled. */ + addEventListener(type: 'sizechanged', listener: (this: HTMLWebViewElement, ev: SizeChanged) => void, useCapture?: boolean): void; + /** Fired when the process rendering the guest web content has become unresponsive. This event will be generated once with a matching responsive event if the guest begins to respond again. */ + addEventListener(type: 'unresponsive', listener: (this: HTMLWebViewElement, ev: ProcessUnresponsive) => void, useCapture?: boolean): void; + /** Fired when the page's zoom changes. */ + addEventListener(type: 'zoomchange', listener: (this: HTMLWebViewElement, ev: ZoomChange) => void, useCapture?: boolean): void; + /** + * Queries audio state. + **/ + getAudioState(callback: (audible: boolean) => void): void; + + /** + * Sets audio mute state of the webview. + * @param mute Mute audio value + */ + setAudioMuted(mute: boolean): void; + + /** + * Queries whether audio is muted. + */ + isAudioMuted(callback: (muted: boolean) => void): void; + + /** + * Captures the visible region of the webview. + * @param callback A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + captureVisibleRegion(callback: (dataUrl: string) => void): void; + /** + * Captures the visible region of the webview. + * @param options + * @param callback + */ + captureVisibleRegion(options: chrome.extensionTypes.ImageDetails, callback: (dataUrl: string) => void): void; + + /** + * Adds content script injection rules to the webview. + * When the webview navigates to a page matching one or more rules, the associated scripts will be injected. + * You can programmatically add rules or update existing rules. + * The following example adds two rules to the webview: 'myRule' and 'anotherRule'. + * webview.addContentScripts([ + * { + * name: 'myRule', + * matches: ['http://www.foo.com/*'], + * css: { files: ['mystyles.css'] }, + * js: { files: ['jquery.js', 'myscript.js'] }, + * run_at: 'document_start' + * }, + * { + * name: 'anotherRule', + * matches: ['http://www.bar.com/*'], + * js: { code: 'document.body.style.backgroundColor = 'red';' }, + * run_at: 'document_end' + * }]); + * ... + * + * // Navigates webview. + * webview.src = 'http://www.foo.com'; + * You can defer addContentScripts call until you needs to inject scripts. + * The following example shows how to overwrite an existing rule. + * + * webview.addContentScripts([{ + * name: 'rule', + * matches: ['http://www.foo.com/*'], + * js: { files: ['scriptA.js'] }, + * run_at: 'document_start'}]); + * + * // Do something. + * webview.src = 'http://www.foo.com/*'; + * ... + * // Overwrite 'rule' defined before. + * webview.addContentScripts([{ + * name: 'rule', + * matches: ['http://www.bar.com/*'], + * js: { files: ['scriptB.js'] }, + * run_at: 'document_end'}]); + * If webview has been naviagted to the origin (e.g., foo.com) and calls webview.addContentScripts to add 'myRule', + * you need to wait for next navigation to make the scripts injected. + * If you want immediate injection, executeScript will do the right thing. + * Rules are preserved even if the guest process crashes or is killed or even if the webview is reparented. + * Refer to the /extensions/content_scripts documentation for more details. + * @param {ContentScriptDetails[]} contentScriptList Details of the content scripts to add. + */ + addContentScripts(contentScriptList: ContentScriptDetails[]): void; + + /** + * Navigates backward one history entry if possible. Equivalent to go(-1). + * @param [callback] Called after the navigation has either failed or completed successfully. Success parameter indicates whether the navigation was successful. + */ + back(callback?: (success: boolean) => void): void; + + /** + * Indicates whether or not it is possible to navigate backward through history. + * The state of this function is cached, and updated before each loadcommit, + * so the best place to call it is on loadcommit. + */ + canGoBack(): void; + + /** + * Indicates whether or not it is possible to navigate forward through history. + * The state of this function is cached, and updated before each loadcommit, + * so the best place to call it is on loadcommit. + */ + canGoForward(): void; + + /** + * Clears browsing data for the webview partition. + * @param options Options determining which data to clear. + * @param types The types of data to be cleared. + * @param callback + */ + clearData(options: ClearDataOptions, types: ClearDataTypeSet, callback?: () => void): void; + + /** + * Injects JavaScript code into the guest page. + * The following sample code uses script injection + * to set the guest page's background color to red: + * @example webview.executeScript({ code: 'document.body.style.backgroundColor = 'red'' }); + * @param details Details of the script to run. + * @param callback + */ + executeScript(details: InjectDetails, callback?: (result?: any[]) => void): void; + + /** + * Initiates a find-in-page request. + * @param {string} searchText The string to find in the page. + * @param options Options for the find request. + * @param callback + */ + find(searchText: string, options?: FindOptions, callback?: (results?: any) => void): void; + + /** + * Navigates forward one history entry if possible. Equivalent to go(1). + * @param callback + */ + forward(callback?: (success: boolean) => void): void; + + /** + * Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID. + */ + getProcessId(): void; + + /** + * Returns the user agent string used by the webview for guest page requests. + */ + getUserAgent(): void; + + /** + * Gets the current zoom factor. + * @param callback + */ + getZoom(callback: (zoomFactor: number) => void): void; + + /** + * Gets the current zoom mode. + * @param callback + */ + getZoomMode(callback: (ZoomMode: any) => void): void; + + /** + * Navigates to a history entry using a history index relative to the current navigation. + * If the requested navigation is impossible, this method has no effect. + * @param relativeIndex Relative history index to which the webview should be navigated. + * For example, a value of 2 will navigate forward 2 history entries if possible; + * a value of -3 will navigate backward 3 entries. + * @param callback + */ + go(relativeIndex: number, callback?: (success: boolean) => void): void; + + /** + * Injects CSS into the guest page. + * @param details Details of the CSS to insert. + * @param callback + */ + insertCSS(details: InjectDetails, callback?: () => void): void; + + /** Indicates whether or not the webview's user agent string has been overridden by *setUserAgentOverride*. */ + isUserAgentOverridden(): void; + + /** Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself. */ + print(): void; + + /** Reloads the current top-level page. */ + reload(): void; + + /** + * Removes content scripts from a webview. + * The following example removes 'myRule' which was added before. + * @example webview.removeContentScripts(['myRule']); + * @description You can remove all the rules by calling: + * @example webview.removeContentScripts(); + * @todo TODO LIST FIX + * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed. + */ + removeContentScripts(scriptNameList?: any[]): void; + + /** + * Override the user agent string used by the webview for guest page requests. + * @param userAgent The user agent string to use. + */ + setUserAgentOverride(userAgent: string): void; + + /** + * Changes the zoom factor of the page. + * The scope and persistence of this change + * are determined by the webview's current zoom mode. + * @param zoomFactor The new zoom factor. + * @param [callback] + */ + setZoom(zoomFactor: number, callback?: () => void): void; + + /** + * Sets the zoom mode of the webview. + * @param ZoomMode Defines how zooming is handled in the webview. + * @param [callback] + */ + setZoomMode(ZoomMode: ZoomMode, callback?: () => void): void; + + /** Stops loading the current webview navigation if in progress. */ + stop(): void; + + /** + * @todo TODO Fix action param + * Ends the current find session (clearing all highlighting) + * and cancels all find requests in progress. + * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep. + */ + stopFinding(action?: string): void; + + /** + * Loads a data URL with a specified base URL used for relative links. + * Optionally, a virtual URL can be provided to be shown to the user instead of the data URL. + * @param {string} dataUrl The data URL to load. + * @param {string} baseUrl The base URL that will be used for relative links. + * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar). + */ + loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void; + + /** + * Forcibly kills the guest web page's renderer process. + * This may affect multiple webview tags in the current app if they share the same process, + * but it will not affect webview tags in other apps. + */ + terminate(): void; + + /** + * Fired when the guest window attempts to close itself. + * The following example code navigates the webview to + * about:blank when the guest attempts to close itself. + * @example + * webview.addEventListener('close', function() { + * webview.src = 'about:blank'; + * }); + */ + close(event: chrome.events.Event): void; + + /** + * Fired when the guest window logs a console message. + * The following example code forwards all log messages + * to the embedder's console without regard for log level + * or other properties. + * @example + * webview.addEventListener('consolemessage', function(e) { + * console.log('Guest page logged a message: ', e.message); + * }); + */ + consolemessage: chrome.events.Event; + + /** + * Fired when the guest window fires a load event, i.e., when a new document is loaded. + * This does *not* include page navigation within the current document or asynchronous + * resource loads. The following example code modifies the default font size of the + * guest's body element after the page loads: + * @example + * webview.addEventListener('contentload', function() { + * webview.executeScript({ code: 'document.body.style.fontSize = '42px'' }); + * }); + */ + contentload: (event: chrome.events.Event) => void; + + /** + * Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.

Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)

The default behavior is to cancel the dialog.

+ * @param callback + */ + + dialog: chrome.events.Event; + + /** + * Fired when the process rendering the guest web content has exited. + * The following example code will show a farewell message whenever + * the guest page crashes: + * @example + * webview.addEventListener('exit', function(e) { + * if (e.reason === 'crash') { + * webview.src = 'data:text/plain,Goodbye, world!'; + * } + * }); + * @param callback + */ + + exit: chrome.events.Event; + + /** + * Fired when new find results are available for an active find request. + * This might happen multiple times for a single find request as matches are found. + */ + + findupdate: chrome.events.Event; + + /** + * Fired when a top-level load has aborted without committing. + * An error message will be printed to the console unless the event is default-prevented. + * @requires Note: When a resource load is aborted, + * a loadabort event will eventually be followed by a loadstop event, + * even if all committed loads since the last loadstop event (if any) + * were aborted. + * @requires Note: When the load of either an about URL + * or a JavaScript URL is aborted, loadabort will be fired + * and then the webview will be navigated to 'about:blank'. + */ + + loadabort: chrome.events.Event; + + /** + * Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. + * @param callback + */ + + loadcommit: chrome.events.Event; + + /** + * Fired when a top-level load request has redirected to a different URL. + * @param callback + */ + + loadredirect: chrome.events.Event; + + /** + * Fired when a load has begun. + * @param callback + */ + + loadstart: chrome.events.Event; + + /** + * Fired when all frame-level loads in a guest page (including all its subframes) + * have completed. This includes navigation within the current document as well + * as subframe document-level loads, but does not(!) include asynchronousresource + * loads. This event fires every time the number of document-level loads transitions + * from one (or more) to zero. For example, if a page that has already finished loading + * (i.e., loadstop already fired once) creates a new iframe which loads a page, + * then a second loadstop will fire when the iframe page load completes. This pattern + * is commonly observed on pages that load ads. + * @requires Note: When a committed load is aborted, + * a loadstop event will eventually follow a loadabort event, + * even if all committed loads since the last loadstop event (if any) were aborted. + */ + loadstop(event: chrome.events.Event): void; + + /** + * Fired when the guest page attempts to open a new browser window. + * The following example code will create and navigate a new webview + * in the embedder for each requested new window: + * @example + * webview.addEventListener('newwindow', function(e) { + * const newWebview = document.createElement('webview'); + * document.body.appendChild(newWebview); + * e.window.attach(newWebview); + * }); + */ + + newwindow: chrome.events.Event; + + /** + * Fired when the guest page needs to request special permission from the embedder. + * The following example code will grant the guest page access to the webkitGetUserMedia API. + * Note that an app using this example code must itself specify audioCapture and / or + * videoCapture manifest permissions: + * @example + * webview.addEventListener('permissionrequest', function(e) { + * if (e.permission === 'media') { + * e.request.allow(); + * } + * }); + */ + + permissionrequest: chrome.events.Event; + + /** + * Fired when the process rendering the guest web content has become + * responsive again after being unresponsive. + * + * The following example code will fade the webview element + * in or out as it becomes responsive or unresponsive: + * + * @example + * webview.style.webkitTransition = 'opacity 250ms'; + * webview.addEventListener('unresponsive', function() { + * webview.style.opacity = '0.5'; + * }); + * webview.addEventListener('responsive', function() { + * webview.style.opacity = '1'; + * }); + */ + responsive: chrome.events.Event; + /** + * Fired when the embedded web content has been resized via autosize. + * @requires Note: Only fires if autosize is enabled. + */ + sizechanged: chrome.events.Event; + /** + * Fired when the process rendering the guest web content has become unresponsive. + * This event will be generated once with a matching responsive event if the guest begins to respond again. + */ + unresponsive: chrome.events.Event; + /** + * Fired when the page's zoom changes. + */ + zoomchange: chrome.events.Event; } - /**Options that determine what data should be cleared by clearData. */ + /** Options that determine what data should be cleared by clearData. */ interface ClearDataOptions { - /** - * @description Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). + * Clear data accumulated on or after this date, + * represented in milliseconds since the epoch + * (accessible via the getTime method of the JavaScript Date object). + * If absent, defaults to 0 (which would remove all browsing data). + * @default 0 */ - since?: number; + since?: integer; } - /**A set of data types. Missing properties are interpreted as false. */ + /** A set of data types. Missing properties are interpreted as false. */ interface ClearDataTypeSet { - + /** Websites' appcaches. */ + appcache?: boolean; /** - * @description Websites' appcaches. + * The browser's cache. Note: when removing data, this clears the entire cache; it is not limited to the range you specify. + * @since Available since Chrome 43. */ - appcache?: boolean - - /** - * @description Since Chrome 43. The browser's cache. Note: when removing data, this clears the entire cache; it is not limited to the range you specify. - */ - cache?: boolean - - /** - * @description The partition's cookies. - */ - cookies?: boolean - - /** - * @description The partition's session cookies. - */ - sessionCookies?: boolean - - /** - * @description The partition's persistent cookies. - */ - persistentCookies?: boolean - - /** - * @description Websites' filesystems. - */ - fileSystems?: boolean - - /** - * @description Websites' IndexedDB data. - */ - indexedDB?: boolean - - /** - * @description Websites' local storage data. - */ - localStorage?: boolean - - /** - * @description Websites' WebSQL data. - */ - webSQL?: boolean + cache?: boolean; + /** The partition's cookies. */ + cookies?: boolean; + /** The partition's session cookies. */ + sessionCookies?: boolean; + /** The partition's persistent cookies. */ + persistentCookies?: boolean; + /** Websites' filesystems. */ + fileSystems?: boolean; + /** Websites' IndexedDB data. */ + indexedDB?: boolean; + /** Websites' local storage data. */ + localStorage?: boolean; + /** Websites' WebSQL data. */ + webSQL?: boolean; } /** - * The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts. - * Enum values: - * "all" - * "page" - * "frame" - * "selection" - * "link" - * "editable" - * "image" - * "video" - * "audio" */ - export type ContextType = "all" | "page" | "frame" | "selection" | "link" | "editable" | "image" | "video" | "audio"; - /**Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. */ + * The different contexts a menu can appear in. + * Specifying 'all' is equivalent to the combination of all other contexts. + **/ + type ContextType = + 'all' | + 'page' | + 'frame' | + 'selection' | + 'link' | + 'editable' | + 'image' | + 'video' | + 'audio'; + /** + * Details of the script or CSS to inject. + * Either the code or the file property must be set, + * but both may not be set at the same time. + **/ interface InjectDetails { - /** - * @description JavaScript or CSS code to inject. Warning: Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks. + * JavaScript or CSS code to inject. + * Warning: Be careful using the code parameter. + * Incorrect use of it may open your app to xss attacks. */ - code?: string + code?: string; - /** - * @description JavaScript or CSS file to inject. - */ + /** JavaScript or CSS file to inject. */ file?: string } - /**The type of injection item: code or a set of files. */ + /** The type of injection item: code or a set of files. */ interface InjectionItems { - - /** - * @description JavaScript code or CSS to be injected into matching pages. - */ + /** JavaScript code or CSS to be injected into matching pages. */ code?: string - /** - * @description The list of JavaScript or CSS files to be injected into matching pages. These are injected in the order they appear in this array. + * The list of JavaScript or CSS files to be injected into matching pages. + * These are injected in the order they appear in this array. */ files?: any[] } - /**Details of the content script to inject. Refer to the content scripts documentation for more details. */ + /** Details of the content script to inject. **/ interface ContentScriptDetails { - - /** - * @description The name of the content script to inject. - */ + /** The name of the content script to inject. */ name: string - /** - * @description Specifies which pages this content script will be injected into. - */ + /** Specifies which pages this content script will be injected into. */ matches: any[] - /** - * @description Excludes pages that this content script would otherwise be injected into. - */ + /** Excludes pages that this content script would otherwise be injected into. */ exclude_matches?: any[] /** - * @description Whether to insert the content script on about:blank and about:srcdoc. Content scripts will only be injected on pages when their inherit URL is matched by one of the declared patterns in the matches field. The inherit URL is the URL of the document that created the frame or window. Content scripts cannot be inserted in sandboxed frames. + * Whether to insert the content script on about:blank and about:srcdoc. + * Content scripts will only be injected on pages when their inherit URL + * is matched by one of the declared patterns in the matches field. + * The inherit URL is the URL of the document that created the frame or window. + * Content scripts cannot be inserted in sandboxed frames. */ - match_about_blank?: boolean + match_about_blank?: boolean; /** - * @description The CSS code or a list of CSS files to be injected into matching pages. These are injected in the order they appear, before any DOM is constructed or displayed for the page. + * The CSS code or a list of CSS files to be injected into matching pages. + * These are injected in the order they appear, + * before any DOM is constructed or displayed for the page. */ - css?: InjectionItems + css?: InjectionItems; /** - * @description The JavaScript code or a list of JavaScript files to be injected into matching pages. These are injected in the order they appear. + * The JavaScript code or a list of JavaScript files to be injected into matching pages. + * These are injected in the order they appear. */ - js?: InjectionItems + js?: InjectionItems; /** - * @description The soonest that the JavaScript or CSS will be injected into the tab. Defaults to "document_idle". + * The soonest that the JavaScript or CSS will be injected into the tab. + * Defaults to 'document_idle'. */ run_at?: chrome.extensionTypes.RunAt; /** - * @description If all_frames is true, this implies that the JavaScript or CSS should be injected into all frames of current page. By default, all_frames is false and the JavaScript or CSS is only injected into the top frame. + * If all_frames is true, this implies that the JavaScript or CSS should be injected into all frames of current page. + * By default, all_frames is false and the JavaScript or CSS is only injected into the top frame. + * @default false */ all_frames?: boolean; /** - * @description Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword. + * Applied after matches to include only those URLs that also match this glob. + * Intended to emulate the @include Greasemonkey keyword. */ include_globs?: string[]; /** - * @description Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword. + * Applied after matches to exclude URLs that match this glob. + * Intended to emulate the @exclude Greasemonkey keyword. */ exclude_globs?: string[]; } - /**@todo Add documentation */ + /** @todo TODO Add documentation */ interface ContextMenuCreateProperties { /** - * @description The type of menu item. Defaults to 'normal' if not specified. + * The type of menu item. Defaults to 'normal' if not specified. */ - type?: chrome.contextMenus.ItemType + type?: chrome.contextMenus.ItemType; /** - * @description The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. + * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */ - id?: string + id?: string; /** - * @description The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". + * The text to be displayed in the item; this is -required- unless type is 'separator'. + * When the context is 'selection', you can use %s within the string to show the selected text. + * For example, if this parameter's value is 'Translate '%s' to Pig Latin' and the user selects + * the word 'cool', the context menu item for the selection is 'Translate 'cool' to Pig Latin'. */ - title?: string + title?: string; /** - * @description The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. + * The initial state of a checkbox or radio item: + * true for selected and false for unselected. + * Only one radio item can be selected at a time in a given group of radio items. */ checked?: boolean /** - * @description List of contexts this menu item will appear in. Defaults to ['page'] if not specified. + * List of contexts this menu item will appear in. + * Defaults to ['page'] if not specified. */ - contexts?: any[] + contexts?: any[]; /** - * @description A function that will be called back when the menu item is clicked. - * @param {any} [object Object] + * A function that will be called back when the menu item is clicked. */ onclick?: (info: any) => void /** - * @description The ID of a parent menu item; this makes the item a child of a previously added item. + * The ID of a parent menu item; this makes the item a child of a previously added item. */ - parentId?: number | string + parentId?: number | string; /** - * @description Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. + * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ - documentUrlPatterns?: any[] + documentUrlPatterns?: any[]; /** - * @description Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. + * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: any[] + targetUrlPatterns?: any[]; /** - * @description Whether this context menu item is enabled or disabled. Defaults to true. + * Whether this context menu item is enabled or disabled. Defaults to true. */ - enabled?: boolean + enabled?: boolean; } /**@todo Add documentation */ interface ContextMenuUpdateProperties { - - /** - * @description The type of menu item. - */ + /** The type of menu item. */ type?: chrome.webview.ContextType; - /** - * @description The text to be displayed in the item - */ - title?: string + /** The text to be displayed in the item */ + title?: string; /** - * @description The state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. + * The state of a checkbox or radio item: true for selected and false for unselected. + * Only one radio item can be selected at a time in a given group of radio items. */ - checked?: boolean + checked?: boolean; /** - * @description List of contexts this menu item will appear in. + * List of contexts this menu item will appear in. */ - contexts?: any[] + contexts?: any[]; /** - * @description A function that will be called back when the menu item is clicked. - * @param {any} [object Object] + * A function that will be called back when the menu item is clicked. + * @param callback */ - onclick?: (info: any) => void + onclick?: (info: any) => void; /** - * @description The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants. + * The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants. */ - parentId?: number | string + parentId?: number | string; /** - * @description Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. + * Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. + * (This applies to frames as well.) */ - documentUrlPatterns?: any[] + documentUrlPatterns?: any[]; /** - * @description Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. + * Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ - targetUrlPatterns?: any[] + targetUrlPatterns?: any[]; /** - * @description Whether this context menu item is enabled or disabled. + * Whether this context menu item is enabled or disabled. */ - enabled?: boolean + enabled?: boolean; } interface ContextMenus { - /** - * @description Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). - * @param {object} createProperties The properties used to create the item - * @param {any} [object Object] + * Creates a new context menu item. Note that if an error occurs during creation, + * you may not find out until the creation callback fires + * (the details will be in chrome.runtime.lastError). + * @param createProperties The properties used to create the item + * @param [callback] */ create(createProperties: object, callback?: () => void): void; /** - * @description Updates a previously created context menu item. - * @param {any} id The ID of the item to update. - * @param {object} updateProperties The properties to update. Accepts the same values as the create function. - * @param {any} [object Object] + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param [callback] */ - update(id: number | string, updateProperties: object, callback?: () => void): void; + update(id: integer | string, updateProperties: object, callback?: () => void): void; /** - * @description Removes a context menu item. - * @param {any} menuItemId The ID of the context menu item to remove. - * @param {any} [object Object] + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param [callback] */ - remove(menuItemId: number | string, callback?: () => void): void; + remove(menuItemId: integer | string, callback?: () => void): void; /** - * @description Removes all context menu items added to this webview. - * @param {any} [object Object] + * Removes all context menu items added to this webview. + * @param [callback] */ removeAll(callback?: () => void): void; - /** - * @description Fired before showing a context menu on this webview. Can be used to disable this context menu by calling event.preventDefault(). + * Fired before showing a context menu on this webview. + * Can be used to disable this context menu by calling event.preventDefault(). */ - onShow: chrome.events.Event; - + onShow: chrome.events.Event; } - interface IOnShowEvent { - /** - * @description Call this to prevent showing the context menu. - * @memberof IOnShowEvent - */ + interface OnShowEvent { + /** Call this to prevent showing the context menu. */ preventDefault: () => void; } interface ContentWindow { - /** - * @description

Posts a message to the embedded web content as long as the embedded content is displaying a page from the target origin. This method is available once the page has completed loading. Listen for the contentload event and then call the method.

The guest will be able to send replies to the embedder by posting message to event.source on the message event it receives.

This API is identical to the HTML5 postMessage API for communication between web pages. The embedder may listen for replies by adding a message event listener to its own frame.

- * @param {any} message Message object to send to the guest. - * @param {string} targetOrigin Specifies what the origin of the guest window must be for the event to be dispatched. + * Posts a message to the embedded web content as long as the embedded + * content is displaying a page from the target origin. This method is + * available once the page has completed loading. Listen for the + * contentload event and then call the method. + * + * The guest will be able to send replies to the embedder by posting message + * to event.source on the message event it receives. + * + * This API is identical to the HTML5 postMessage API for communication + * between web pages. The embedder may listen for replies by adding + * a message event listener to its own frame. + * + * @param message Message object to send to the guest. + * @param targetOrigin Specifies what the origin of the guest window must be for the event to be dispatched. */ postMessage(message: any, targetOrigin: string): void; - } interface DialogController { - /** - * @description Accept the dialog. Equivalent to clicking OK in an alert, confirm, or prompt dialog. - * @param {string} response The response string to provide to the guest when accepting a prompt dialog. + * Accept the dialog. Equivalent to clicking OK in an alert, confirm, or prompt dialog. + * @param response The response string to provide to the guest when accepting a prompt dialog. */ ok(response?: string): void; - - /** - * @description Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog. - */ + /** Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog. */ cancel(): void; - } - /**Contains all of the results of the find request. */ + /** Contains all of the results of the find request. */ interface FindCallbackResults { - - /** - * @description The number of times searchText was matched on the page. - */ - numberOfMatches: number - - /** - * @description The ordinal number of the current match. - */ - activeMatchOrdinal: number - - /** - * @description Describes a rectangle around the active match in screen coordinates. - */ - selectionRect: SelectionRect - - /** - * @description Indicates whether this find request was canceled. - */ - canceled: boolean + /** The number of times searchText was matched on the page. */ + numberOfMatches: number; + /** The ordinal number of the current match. */ + activeMatchOrdinal: number; + /** Describes a rectangle around the active match in screen coordinates. */ + selectionRect: SelectionRect; + /** Indicates whether this find request was canceled. */ + canceled: boolean; } - /**Options for the find request. */ interface FindOptions { - /** - * @description Flag to find matches in reverse order. The default value is false. + * Flag to find matches in reverse order. + * @default false */ - backward?: boolean - + backward?: boolean; /** - * @description Flag to match with case-sensitivity. The default value is false. + * Flag to match with case-sensitivity. + * @default false */ - matchCase?: boolean + matchCase?: boolean; } interface NewWindow { - /** - * @description Attach the requested target page to an existing webview element. - * @param {object} webview The webview element to which the target page should be attached. + * Attach the requested target page to an existing webview element. + * @param webview The webview element to which the target page should be attached. */ - attach(webview: object): void; - + attach(webview: HTMLWebViewElement): void; /** - * @description Cancel the new window request. + * Cancel the new window request. */ discard(): void; - } - interface MediaPermissionRequest { - - /** - * @description Allow the permission request. - */ + interface PermissionRequestHandler { + /** Allow the permission request. */ allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ + /** Deny the permission request. This is the default behavior if allow is not called. */ deny(): void; - } - interface GeolocationPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface PointerLockPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface DownloadPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. This is the default behavior if allow is not called. - */ - deny(): void; - - } - interface FileSystemPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - - } - interface FullscreenPermissionRequest { - - /** - * @description Allow the permission request. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - - } - interface LoadPluginPermissionRequest { - - /** - * @description Allow the permission request. This is the default behavior if deny is not called.. - */ - allow(): void; - - /** - * @description Deny the permission request. - */ - deny(): void; - - } - /**

Describes a rectangle in screen coordinates.

The containment semantics are array-like; that is, the coordinate (left, top) is considered to be contained by the rectangle, but the coordinate (left + width, top) is not.

*/ + /** + * Describes a rectangle in screen coordinates. + * The containment semantics are array-like; that is, the coordinate (left, top) is considered to be contained by the rectangle, + * but the coordinate (left + width, top) is not. + **/ interface SelectionRect { - - /** - * @description Distance from the left edge of the screen to the left edge of the rectangle. - */ - left: number - - /** - * @description Distance from the top edge of the screen to the top edge of the rectangle. - */ - top: number - - /** - * @description Width of the rectangle. - */ - width: number - - /** - * @description Height of the rectangle. - */ - height: number + /** Distance from the left edge of the screen to the left edge of the rectangle. */ + left: number; + /** Distance from the top edge of the screen to the top edge of the rectangle. */ + top: number; + /** Width of the rectangle. */ + width: number; + /** Height of the rectangle. */ + height: number; } - /**Interface which provides access to webRequest events on the guest page. See the chrome.webRequest extensions API for details on webRequest life cycle and related concepts.

To illustrate how usage differs from the extensions webRequest API, consider the following example code which blocks any guest requests for URLs which match *://www.evil.com/*:

webview.request.onBeforeRequest.addListener(
-          function(details) { return {cancel: true}; },
-          {urls: ["*://www.evil.com/*"]},
-          ["blocking"]);

Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events. See declarativeWebRequest for API details.

Note that conditions and actions for declarative webview webRequests should be instantiated from their chrome.webViewRequest.* counterparts. The following example code declaratively blocks all requests to "example.com" on the webview myWebview:

var rule = {
-          conditions: [
-            new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } })
-          ],
-          actions: [ new chrome.webViewRequest.CancelRequest() ]
-        };
-        myWebview.request.onRequest.addRules([rule]);
*/ + /** + * Interface which provides access to webRequest events on the guest page. + * @see[chrome.webRequest]{@link http://developer.chrome.com/extensions/webRequest} + * extensions API for details on webRequest life cycle and related concepts. + * + * To illustrate how usage differs from the extensions webRequest API, + * consider the following example code which blocks any guest requests + * for URLs which match *://www.evil.com/*: + * @example + * webview.request.onBeforeRequest.addListener( + * function(details) { return {cancel: true}; }, {urls: ['*://www.evil.com/*']}, ['blocking']); + * @description + * Additionally, this interface supports declarative webRequest rules through onRequest and onMessage events. + * @see[Docs]{@link http://developer.chrome.com/extensions/declarativeWebRequest.htmldeclarativeWebRequest} + * @description + * Note that conditions and actions for declarative webview webRequests should be instantiated + * from their chrome.webViewRequest.* counterparts. The following example code declaratively + * blocks all requests to 'example.com' on the webview myWebview: + * @example const rule = { conditions: [ new chrome.webViewRequest.RequestMatcher({ url: { hostSuffix: 'example.com' } }) ], actions: [ new chrome.webViewRequest.CancelRequest() ] }; myWebview.request.onRequest.addRules([rule]); + **/ interface WebRequestEventInterface { + /** @todo TODO */ } /** * Defines the how zooming is handled in the webview. * Enum values: - * "per-origin" - * * Zoom changes will persist in the zoomed page's origin, i.e. all other webviews in the same partition that are navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. - * "per-view" - * * Zoom changes only take effect in this webview, and zoom changes in other webviews will not affect the zooming of this webview. Also, per-view zoom changes are reset on navigation; navigating a webview will always load pages with their per-origin zoom factors (within the scope of the partition). - * "disabled" - * * Disables all zooming in the webview. The content will revert to the default zoom level, and all attempted zoom changes will be ignored. */ - export type ZoomMode = "per-origin" | "per-view" | "disabled"; - - /** - * @description Queries audio state. - * @param {any} [object Object] - */ - export function getAudioState(callback: (audible: boolean) => void): void; - - /** - * @description Sets audio mute state of the webview. - * @param {boolean} mute Mute audio value - */ - export function setAudioMuted(mute: boolean): void; - - /** - * @description Queries whether audio is muted. - * @param {any} [object Object] - */ - export function isAudioMuted(callback: (muted: boolean) => void): void; - - /** - * @description Captures the visible region of the webview. - * @param {(dataUrl: string) => void} callback A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. - */ - export function captureVisibleRegion(callback: (dataUrl: string) => void): void; - /** - * @description Captures the visible region of the webview. - * @param {*} options - * @param {(dataUrl: string) => void} callback - */ - export function captureVisibleRegion(options: chrome.extensionTypes.ImageDetails, callback: (dataUrl: string) => void): void; - - /** - * @description

Adds content script injection rules to the webview. When the webview navigates to a page matching one or more rules, the associated scripts will be injected. You can programmatically add rules or update existing rules.

The following example adds two rules to the webview: 'myRule' and 'anotherRule'.

webview.addContentScripts([
-          {
-            name: 'myRule',
-            matches: ['http://www.foo.com/*'],
-            css: { files: ['mystyles.css'] },
-            js: { files: ['jquery.js', 'myscript.js'] },
-            run_at: 'document_start'
-          },
-          {
-            name: 'anotherRule',
-            matches: ['http://www.bar.com/*'],
-            js: { code: "document.body.style.backgroundColor = 'red';" },
-            run_at: 'document_end'
-          }]);
-         ...
-
-        // Navigates webview.
-        webview.src = 'http://www.foo.com';

You can defer addContentScripts call until you needs to inject scripts.

The following example shows how to overwrite an existing rule.

webview.addContentScripts([{
-            name: 'rule',
-            matches: ['http://www.foo.com/*'],
-            js: { files: ['scriptA.js'] },
-            run_at: 'document_start'}]);
-
-        // Do something.
-        webview.src = 'http://www.foo.com/*';
-         ...
-        // Overwrite 'rule' defined before.
-        webview.addContentScripts([{
-            name: 'rule',
-            matches: ['http://www.bar.com/*'],
-            js: { files: ['scriptB.js'] },
-            run_at: 'document_end'}]);

If webview has been naviagted to the origin (e.g., foo.com) and calls webview.addContentScripts to add 'myRule', you need to wait for next navigation to make the scripts injected. If you want immediate injection, executeScript will do the right thing.

Rules are preserved even if the guest process crashes or is killed or even if the webview is reparented.

Refer to the content scripts documentation for more details.

- * @param {ContentScriptDetails[]} contentScriptList Details of the content scripts to add. - */ - export function addContentScripts(contentScriptList: ContentScriptDetails[]): void; - - /** - * @description Navigates backward one history entry if possible. Equivalent to go(-1). - * @param {(success: boolean) => void} [callback] Called after the navigation has either failed or completed successfully. Success parameter indicates whether the navigation was successful. - */ - export function back(callback?: (success: boolean) => void): void; - - /** - * @description Indicates whether or not it is possible to navigate backward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit. - */ - export function canGoBack(): void; - - /** - * @description Indicates whether or not it is possible to navigate forward through history. The state of this function is cached, and updated before each loadcommit, so the best place to call it is on loadcommit. - */ - export function canGoForward(): void; - - /** - * @description

Clears browsing data for the webview partition.

- * @param {any} options Options determining which data to clear. - * @param {any} types The types of data to be cleared. - * @param {any} [object Object] - */ - export function clearData(options: ClearDataOptions, types: ClearDataTypeSet, callback?: () => void): void; - - /** - * @description

Injects JavaScript code into the guest page.

The following sample code uses script injection to set the guest page's background color to red:

webview.executeScript({ code: "document.body.style.backgroundColor = 'red'" });
- * @param {any} details Details of the script to run. - * @param {any} [object Object] - */ - export function executeScript(details: InjectDetails, callback?: (result?: any[]) => void): void; - - /** - * @description Initiates a find-in-page request. - * @param {string} searchText The string to find in the page. - * @param {any} options Options for the find request. - * @param {any} [object Object] - */ - export function find(searchText: string, options?: FindOptions, callback?: (results?: any) => void): void; - - /** - * @description Navigates forward one history entry if possible. Equivalent to go(1). - * @param {any} [object Object] - */ - export function forward(callback?: (success: boolean) => void): void; - - /** - * @description Returns Chrome's internal process ID for the guest web page's current process, allowing embedders to know how many guests would be affected by terminating the process. Two guests will share a process only if they belong to the same app and have the same storage partition ID. The call is synchronous and returns the embedder's cached notion of the current process ID. The process ID isn't the same as the operating system's process ID. - */ - export function getProcessId(): void; - - /** - * @description Returns the user agent string used by the webview for guest page requests. - */ - export function getUserAgent(): void; - - /** - * @description Gets the current zoom factor. - * @param {any} [object Object] - */ - export function getZoom(callback: (zoomFactor: number) => void): void; - - /** - * @description Gets the current zoom mode. - * @param {any} [object Object] - */ - export function getZoomMode(callback: (ZoomMode: any) => void): void; - - /** - * @description Navigates to a history entry using a history index relative to the current navigation. If the requested navigation is impossible, this method has no effect. - * @param {number} relativeIndex Relative history index to which the webview should be navigated. For example, a value of 2 will navigate forward 2 history entries if possible; a value of -3 will navigate backward 3 entries. - * @param {any} [object Object] - */ - export function go(relativeIndex: number, callback?: (success: boolean) => void): void; - - /** - * @description Injects CSS into the guest page. - * @param {any} details Details of the CSS to insert. - * @param {any} [object Object] - */ - export function insertCSS(details: InjectDetails, callback?: () => void): void; - - /** - * @description Indicates whether or not the webview's user agent string has been overridden by $(ref:webviewTag.setUserAgentOverride). - */ - export function isUserAgentOverridden(): void; - - /** - * @description Prints the contents of the webview. This is equivalent to calling scripted print function from the webview itself. - */ - export function print(): void; - - /** - * @description Reloads the current top-level page. - */ - export function reload(): void; - - /** - * @description

Removes content scripts from a webview.

The following example removes "myRule" which was added before.

webview.removeContentScripts(['myRule']);

You can remove all the rules by calling:

webview.removeContentScripts();
- * @param {any[]} scriptNameList A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the webview will be removed. - */ - export function removeContentScripts(scriptNameList?: any[]): void; - - /** - * @description Override the user agent string used by the webview for guest page requests. - * @param {string} userAgent The user agent string to use. - */ - export function setUserAgentOverride(userAgent: string): void; - - /** - * @description Changes the zoom factor of the page. The scope and persistence of this change are determined by the webview's current zoom mode (see $(ref:webviewTag.ZoomMode)). - * @param {number} zoomFactor The new zoom factor. - * @param {any} [object Object] - */ - export function setZoom(zoomFactor: number, callback?: () => void): void; - - /** - * @description Sets the zoom mode of the webview. - * @param {any} ZoomMode Defines how zooming is handled in the webview. - * @param {any} [object Object] - */ - export function setZoomMode(ZoomMode: ZoomMode, callback?: () => void): void; - - /** - * @description Stops loading the current webview navigation if in progress. - */ - export function stop(): void; - - /** - * @description Ends the current find session (clearing all highlighting) and cancels all find requests in progress. - * @param {string} action Determines what to do with the active match after the find session has ended. clear will clear the highlighting over the active match; keep will keep the active match highlighted; activate will keep the active match highlighted and simulate a user click on that match. The default action is keep. - */ - export function stopFinding(action?: string): void; - - /** - * @description Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL. - * @param {string} dataUrl The data URL to load. - * @param {string} baseUrl The base URL that will be used for relative links. - * @param {string} virtualUrl The URL that will be displayed to the user (in the address bar). - */ - export function loadDataWithBaseUrl(dataUrl: string, baseUrl: string, virtualUrl?: string): void; - - /** - * @description Forcibly kills the guest web page's renderer process. This may affect multiple webview tags in the current app if they share the same process, but it will not affect webview tags in other apps. - */ - export function terminate(): void; - - /** - * @description Fired when the guest window attempts to close itself.

The following example code navigates the webview to about:blank when the guest attempts to close itself.

webview.addEventListener('close', function() {
-          webview.src = 'about:blank';
-        });
- */ - - export function close(event: chrome.events.Event): void; - - /** - * @description Fired when the guest window logs a console message.

The following example code forwards all log messages to the embedder's console without regard for log level or other properties.

webview.addEventListener('consolemessage', function(e) {
-          console.log('Guest page logged a message: ', e.message);
-        });
- * @param {any} [object Object] - */ - - export var consolemessage: chrome.events.Event; - - /** - * @description Fired when the guest window fires a load event, i.e., when a new document is loaded. This does not include page navigation within the current document or asynchronous resource loads.

The following example code modifies the default font size of the guest's body element after the page loads:

webview.addEventListener('contentload', function() {
-          webview.executeScript({ code: 'document.body.style.fontSize = "42px"' });
-        });
- */ - - export var contentload: (event: chrome.events.Event) => void; - - /** - * @description Fired when the guest window attempts to open a modal dialog via window.alert, window.confirm, or window.prompt.

Handling this event will block the guest process until each event listener returns or the dialog object becomes unreachable (if preventDefault() was called.)

The default behavior is to cancel the dialog.

- * @param {any} [object Object] - */ - - export var dialog: chrome.events.Event; - - /** - * @description Fired when the process rendering the guest web content has exited.

The following example code will show a farewell message whenever the guest page crashes:

webview.addEventListener('exit', function(e) {
-          if (e.reason === 'crash') {
-            webview.src = 'data:text/plain,Goodbye, world!';
-          }
-        });
- * @param {any} [object Object] - */ - - export var exit: chrome.events.Event; - - /** - * @description Fired when new find results are available for an active find request. This might happen multiple times for a single find request as matches are found. - * @param {any} [object Object] - */ - - export var findupdate: chrome.events.Event; - - /** - * @description Fired when a top-level load has aborted without committing. An error message will be printed to the console unless the event is default-prevented.

Note: When a resource load is aborted, a loadabort event will eventually be followed by a loadstop event, even if all committed loads since the last loadstop event (if any) were aborted.

Note: When the load of either an about URL or a JavaScript URL is aborted, loadabort will be fired and then the webview will be navigated to 'about:blank'.

- * @param {any} [object Object] - */ - - export var loadabort: chrome.events.Event; - - /** - * @description Fired when a load has committed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. - * @param {any} [object Object] - */ - - export var loadcommit: chrome.events.Event; - - /** - * @description Fired when a top-level load request has redirected to a different URL. - * @param {any} [object Object] - */ - - export var loadredirect: chrome.events.Event; - - /** - * @description Fired when a load has begun. - * @param {any} [object Object] - */ - - export var loadstart: chrome.events.Event; - - /** - * @description Fired when all frame-level loads in a guest page (including all its subframes) have completed. This includes navigation within the current document as well as subframe document-level loads, but does not include asynchronous resource loads. This event fires every time the number of document-level loads transitions from one (or more) to zero. For example, if a page that has already finished loading (i.e., loadstop already fired once) creates a new iframe which loads a page, then a second loadstop will fire when the iframe page load completes. This pattern is commonly observed on pages that load ads.

Note: When a committed load is aborted, a loadstop event will eventually follow a loadabort event, even if all committed loads since the last loadstop event (if any) were aborted.

- */ - - export function loadstop(event: chrome.events.Event): void; - - /** - * @description Fired when the guest page attempts to open a new browser window.

The following example code will create and navigate a new webview in the embedder for each requested new window:

webview.addEventListener('newwindow', function(e) {
-          var newWebview = document.createElement('webview');
-          document.body.appendChild(newWebview);
-          e.window.attach(newWebview);
-        });
- * @param {any} [object Object] - */ - - export var newwindow: chrome.events.Event; - - /** - * @description Fired when the guest page needs to request special permission from the embedder.

The following example code will grant the guest page access to the webkitGetUserMedia API. Note that an app using this example code must itself specify audioCapture and/or videoCapture manifest permissions:

webview.addEventListener('permissionrequest', function(e) {
-          if (e.permission === 'media') {
-            e.request.allow();
-          }
-        });
- * @param {any} [object Object] - */ - - export var permissionrequest: chrome.events.Event; - - /** - * @description Fired when the process rendering the guest web content has become responsive again after being unresponsive.

The following example code will fade the webview element in or out as it becomes responsive or unresponsive:

webview.style.webkitTransition = 'opacity 250ms';
-        webview.addEventListener('unresponsive', function() {
-          webview.style.opacity = '0.5';
-        });
-        webview.addEventListener('responsive', function() {
-          webview.style.opacity = '1';
-        });
- * @param {any} [object Object] - */ - - export var responsive: chrome.events.Event; - - /** - * @description Fired when the embedded web content has been resized via autosize. Only fires if autosize is enabled. - * @param {any} [object Object] - */ - - export var sizechanged: chrome.events.Event; - - /** - * @description Fired when the process rendering the guest web content has become unresponsive. This event will be generated once with a matching responsive event if the guest begins to respond again. - * @param {any} [object Object] - */ - - export var unresponsive: chrome.events.Event; - - /** - * @description Fired when the page's zoom changes. - * @param {any} [object Object] - */ - - export var zoomchange: chrome.events.Event; - /**IConsolemessage (Auto generated interface) */ - interface IConsolemessage { - + * 'per-origin' + * > Zoom changes will persist in the zoomed page's origin, + * i.e. all other webviews in the same partition that are + * navigated to that same origin will be zoomed as well. + * Moreover, per-origin zoom changes are saved with the origin, + * meaning that when navigating to other pages in the same origin, + * they will all be zoomed to the same zoom factor. + * 'per-view' + * > Zoom changes only take effect in this webview, + * and zoom changes in other webviews will not affect + * the zooming of this webview. Also, per-view zoom + * changes are reset on navigation; navigating a webview + * will always load pages with their per-origin zoom factors + * (within the scope of the partition). + * 'disabled' + * > Disables all zooming in the webview. + * The content will revert to the default zoom level, + * and all attempted zoom changes will be ignored. + **/ + type ZoomMode = + 'per-origin' | + 'per-view' | + 'disabled'; + type ConsoleMessageLevel = -1 | 0 | 1 | 2; + type LoadAbortReason = + 'ERR_ABORTED' | + 'ERR_INVALID_URL' | + 'ERR_DISALLOWED_URL_SCHEME' | + 'ERR_BLOCKED_BY_CLIENT' | + 'ERR_ADDRESS_UNREACHABLE' | + 'ERR_EMPTY_RESPONSE' | + 'ERR_FILE_NOT_FOUND' | + 'ERR_UNKNOWN_URL_SCHEME'; + interface ConsoleMessage { /** - * @description The severity level of the log message. Ranges from -1 to 2. LOG_VERBOSE (console.debug) = -1, LOG_INFO (console.log, console.info) = 0, LOG_WARNING (console.warn) = 1, LOG_ERROR (console.error) = 2. + * The severity level of the log message. + * Ranges from -1 to 2. + * LOG_VERBOSE (console.debug) = -1 + * LOG_INFO (console.log, console.info) = 0 + * LOG_WARNING (console.warn) = 1 + * LOG_ERROR (console.error) = 2 */ - level: number - - /** - * @description The logged message contents. - */ - message: string - - /** - * @description The line number of the message source. - */ - line: number - - /** - * @description A string identifying the resource which logged the message. - */ - sourceId: string + level: ConsoleMessageLevel; + /** The logged message contents. */ + message: string; + /** The line number of the message source. */ + line: number; + /** A string identifying the resource which logged the message. */ + sourceId: string; } - /**IDialog (Auto generated interface) */ - interface IDialog { + type DialogMessageType = + 'alert' | + 'confirm' | + 'prompt'; + interface Dialog { /** - * @description The type of modal dialog requested by the guest. + * The type of modal dialog requested by the guest. */ - messageType: 'alert' | 'confirm' | 'prompt' - + messageType: DialogMessageType; /** - * @description The text the guest attempted to display in the modal dialog. + * The text the guest attempted to display in the modal dialog. */ - messageText: string - + messageText: string; /** - * @description An interface that can be used to respond to the guest's modal request. + * An interface that can be used to respond to the guest's modal request. */ - dialog: DialogController + dialog: DialogController; } - /**IExit (Auto generated interface) */ - interface IExit { - - /** - * @description Chrome's internal ID of the process that exited. - */ - processID: number - - /** - * @description String indicating the reason for the exit. - */ - reason: 'normal' | 'abnormal' | 'crash' | 'kill' + type ExitReason = + 'normal' | + 'abnormal' | + 'crash' | + 'kill'; + interface Exit { + /** Chrome's internal ID of the process that exited. */ + processID: number; + /** String indicating the reason for the exit. */ + reason: ExitReason; } - /**IFindupdate (Auto generated interface) */ - interface IFindupdate { - + interface FindUpdate { /** - * @description The string that is being searched for in the page. + * The string that is being searched for in the page. */ - searchText: string - + searchText: string; /** - * @description The number of matches found for searchText on the page so far. + * The number of matches found for searchText on the page so far. */ - numberOfMatches: number - + numberOfMatches: number; /** - * @description The ordinal number of the current active match, if it has been found. This will be 0 until then. + * The ordinal number of the current active match, + * if it has been found. This will be 0 until then. */ - activeMatchOrdinal: number - + activeMatchOrdinal: number; /** - * @description Describes a rectangle around the active match, if it has been found, in screen coordinates. + * Describes a rectangle around the active match, + * if it has been found, in screen coordinates. */ - selectionRect: SelectionRect - + selectionRect: SelectionRect; /** - * @description Indicates whether the find request was canceled. + * Indicates whether the find request was canceled. */ - canceled: boolean - + canceled: boolean; /** - * @description Indicates that all find requests have completed and that no more findupdate events will be fired until more find requests are made. + * Indicates that all find requests have completed + * and that no more findupdate events will be fired + * until more find requests are made. */ - finalUpdate: string + finalUpdate: string; } - /**ILoadabort (Auto generated interface) */ - interface ILoadabort { - + interface LoadAbort { + /** Requested URL. */ + url: string; + /** Whether the load was top-level or in a subframe. */ + isTopLevel: boolean; /** - * @description Requested URL. + * Unique integer ID for the type of abort. + * Note that this ID is `not` guaranteed to + * remain backwards compatible between releases. + * You must not act based upon this specific integer. */ - url: string - + code: integer; /** - * @description Whether the load was top-level or in a subframe. + * String indicating what type of abort occurred. + * This string is `not` guaranteed to remain + * backwards compatible between releases. + * You must not parse and act based upon its content. + * It is also possible that, in some cases, + * an error not listed here could be reported. */ - isTopLevel: boolean - - /** - * @description Unique integer ID for the type of abort. Note that this ID is not guaranteed to remain backwards compatible between releases. You must not act based upon this specific integer. - */ - code: number - - /** - * @description String indicating what type of abort occurred. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. It is also possible that, in some cases, an error not listed here could be reported. - */ - reason: 'ERR_ABORTED' | 'ERR_INVALID_URL' | 'ERR_DISALLOWED_URL_SCHEME' | 'ERR_BLOCKED_BY_CLIENT' | 'ERR_ADDRESS_UNREACHABLE' | 'ERR_EMPTY_RESPONSE' | 'ERR_FILE_NOT_FOUND' | 'ERR_UNKNOWN_URL_SCHEME' + reason: LoadAbortReason; } - /**ILoadcommit (Auto generated interface) */ - interface ILoadcommit { - - /** - * @description The URL that committed. - */ - url: string - - /** - * @description Whether the load is top-level or in a subframe. - */ - isTopLevel: boolean + interface LoadCommit { + /** The URL that committed. */ + url: string; + /** Whether the load is top-level or in a subframe. */ + isTopLevel: boolean; } - /**ILoadredirect (Auto generated interface) */ - interface ILoadredirect { - - /** - * @description The requested URL before the redirect. - */ - oldUrl: string - - /** - * @description The new URL after the redirect. - */ - newUrl: string - - /** - * @description Whether or not the redirect happened at top-level or in a subframe. - */ - isTopLevel: boolean + interface LoadRedirect { + /** The requested URL before the redirect. */ + oldUrl: string; + /** The new URL after the redirect. */ + newUrl: string; + /** Whether or not the redirect happened at top-level or in a subframe. */ + isTopLevel: boolean; } - /**ILoadstart (Auto generated interface) */ - interface ILoadstart { - - /** - * @description Requested URL. - */ - url: string - - /** - * @description Whether the load is top-level or in a subframe. - */ - isTopLevel: boolean + interface LoadStart { + /** Requested URL. */ + url: string; + /** Whether the load is top-level or in a subframe. */ + isTopLevel: boolean; } - /**INewwindow (Auto generated interface) */ - interface INewwindow { - + type WindowOpenDisposition = + 'ignore' | + 'save_to_disk' | + 'current_tab' | + 'new_background_tab' | + 'new_foreground_tab' | + 'new_window' | + 'new_popup'; + interface NewWindow { /** - * @description An interface that can be used to either attach the requested target page to an existing webview element or explicitly discard the request. - */ - window: NewWindow + * An interface that can be used to either attach the requested + * target page to an existing webview element or explicitly + * discard the request. + **/ + window: NewWindow; - /** - * @description The target URL requested for the new window. - */ - targetUrl: string + /** The target URL requested for the new window. */ + targetUrl: string; - /** - * @description The initial width requested for the new window. - */ - initialWidth: number + /** The initial width requested for the new window. */ + initialWidth: number; - /** - * @description The initial height requested for the new window. - */ - initialHeight: number + /** The initial height requested for the new window. */ + initialHeight: number; - /** - * @description The requested name of the new window. - */ - name: string + /** The requested name of the new window. */ + name: string; - /** - * @description The requested disposition of the new window. - */ - windowOpenDisposition: 'ignore' | 'save_to_disk' | 'current_tab' | 'new_background_tab' | 'new_foreground_tab' | 'new_window' | 'new_popup' + /** The requested disposition of the new window. */ + windowOpenDisposition: WindowOpenDisposition; } - /**IPermissionrequest (Auto generated interface) */ - interface IPermissionrequest { - - /** - * @description The type of permission being requested. - */ - permission: 'media' | 'geolocation' | 'pointerLock' | 'download' | 'loadplugin' | 'filesystem' | 'fullscreen' - - /** - * @description An object which holds details of the requested permission. Depending on the type of permission requested, this may be a $(ref:webviewTag.MediaPermissionRequest), $(ref:webviewTag.GeolocationPermissionRequest), $(ref:webviewTag.PointerLockPermissionRequest), $(ref:webviewTag.DownloadPermissionRequest), $(ref:webviewTag.LoadPluginPermissionRequest), or $(ref:webviewTag.FullscreenPermissionRequest). - */ - request: object + type RequestedPermission = + 'media' | + 'geolocation' | + 'pointerLock' | + 'download' | + 'loadplugin' | + 'filesystem' | + 'fullscreen'; + interface PermissionRequest { + /** The type of permission being requested. */ + permission: RequestedPermission; + /** An object which holds details of the requested permission.*/ + request: PermissionRequestHandler; } - /**IResponsive (Auto generated interface) */ - interface IResponsive { - - /** - * @description Chrome's internal ID of the process that became responsive. - */ - processID: number + interface ProcessResponsive { + /** Chrome's internal ID of the process that became responsive. */ + processID: number; } - /**ISizechanged (Auto generated interface) */ - interface ISizechanged { - - /** - * @description Old width of embedded web content. - */ - oldWidth: number - - /** - * @description Old height of embedded web content. - */ - oldHeight: number - - /** - * @description New width of embedded web content. - */ - newWidth: number - - /** - * @description New height of embedded web content. - */ - newHeight: number + interface SizeChanged { + /** Old width of embedded web content. */ + oldWidth: number; + /** Old height of embedded web content. */ + oldHeight: number; + /** New width of embedded web content. */ + newWidth: number; + /** New height of embedded web content. */ + newHeight: number; } - /**IUnresponsive (Auto generated interface) */ - interface IUnresponsive { - - /** - * @description Chrome's internal ID of the process that has become unresponsive. - */ - processID: number + interface ProcessUnresponsive { + /** Chrome's internal ID of the process that has become unresponsive. */ + processID: number; } - /**IZoomchange (Auto generated interface) */ - interface IZoomchange { - - /** - * @description The page's previous zoom factor. - */ - oldZoomFactor: number - - /** - * @description The new zoom factor that the page was zoomed to. - */ - newZoomFactor: number + interface ZoomChange { + /** The page's previous zoom factor. */ + oldZoomFactor: number; + /** The new zoom factor that the page was zoomed to. */ + newZoomFactor: number; } - } + ///////////// + // METHODS // + ///////////// + + /** + * Different page speed and load metrics + */ + function csi(): { + onloadT: number; + pageT: number; + startE: number; + tran: number; + } + + /** + * @deprecated Deprecated in Chrome 64. + * chrome.loadTimes() is a non-standard API that exposes loading metrics + * and network information to developers in order to help them better + * understand their site's performance in the real world. + * @see[Use this instead]{@link https://www.w3.org/TR/navigation-timing-2/} + * @see[Deprecation article]{@link https://developers.google.com/web/updates/2017/12/chrome-loadtimes-deprecated} + */ + function loadTimes(): chrome.deprecatedButUsable; } ///////////////////// diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts index f976fc57b4..3babb0b80e 100644 --- a/types/chrome-apps/test/index.ts +++ b/types/chrome-apps/test/index.ts @@ -1,8 +1,8 @@ import runtime = chrome.app.runtime; -import cwindow = chrome.app.window; +const cwindow = chrome.app.window; -var createOptions: cwindow.CreateWindowOptions = { - id: "My Window", +const createOptions: chrome.app.CreateWindowOptions = { + id: 'My Window', bounds: { left: 0, top: 0, @@ -14,7 +14,7 @@ var createOptions: cwindow.CreateWindowOptions = { //Create new window on app launch chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchData) { - chrome.app.window.create('app/url', createOptions, function (created_window: cwindow.AppWindow) { + chrome.app.window.create('app/url', createOptions, function (created_window: chrome.app.AppWindow) { return; }); }); @@ -22,9 +22,9 @@ chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchDa chrome.app.runtime.onRestarted.addListener(function () { return; }); // retrieving windows -var currentWindow: cwindow.AppWindow = chrome.app.window.current(); -var otherWindow: cwindow.AppWindow = chrome.app.window.get('some-string'); -var allWindows: cwindow.AppWindow[] = chrome.app.window.getAll(); +var currentWindow: chrome.app.AppWindow = chrome.app.window.current(); +var otherWindow: chrome.app.AppWindow = chrome.app.window.get('some-string'); +var allWindows: chrome.app.AppWindow[] = chrome.app.window.getAll(); // listening to window events currentWindow.onBoundsChanged.addListener(function () { return; }); @@ -42,11 +42,11 @@ var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces( function test_fileSystem(): void { var accepts: chrome.fileSystem.AcceptOptions[] = [ - { mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] } + { mimeTypes: ['text/*'], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] } ]; var chooseOption: chrome.fileSystem.ChooseEntryOptions = { - type: "openFile", - suggestedName: "foo.txt", + type: 'openFile', + suggestedName: 'foo.txt', accepts: accepts, acceptsAllTypes: false, acceptsMultiple: false @@ -98,7 +98,7 @@ function test_socketsTcp(): void { chrome.sockets.tcp.setNoDelay(socketId, true, (result: number) => { }); // connect - chrome.sockets.tcp.connect(socketId, "192.168.0.1", 8080, (result: number) => { }); + chrome.sockets.tcp.connect(socketId, '192.168.0.1', 8080, (result: number) => { }); // disconnect chrome.sockets.tcp.disconnect(socketId); @@ -132,7 +132,7 @@ function testSocketsTcpTypes(): void { properties = { persistent: true, - name: "test", + name: 'test', bufferSize: 1024 }; @@ -146,11 +146,11 @@ function testSocketsTcpTypes(): void { connected: false }; - socketInfo.name = "test"; + socketInfo.name = 'test'; socketInfo.bufferSize = 1024; - socketInfo.localAddress = "192.168.0.2"; + socketInfo.localAddress = '192.168.0.2'; socketInfo.localPort = 8000; - socketInfo.peerAddress = "192.168.0.3"; + socketInfo.peerAddress = '192.168.0.3'; socketInfo.peerPort = 1000; } @@ -178,10 +178,10 @@ function test_socketsUdp(): void { chrome.sockets.udp.setPaused(socketId, true, () => { }); // bind - chrome.sockets.udp.bind(socketId, "0.0.0.0", 8080, (result: number) => { }); + chrome.sockets.udp.bind(socketId, '0.0.0.0', 8080, (result: number) => { }); // send - chrome.sockets.udp.send(socketId, buffer, "172.21.0.1", 10080, (info: chrome.sockets.udp.SendInfo) => { }); + chrome.sockets.udp.send(socketId, buffer, '172.21.0.1', 10080, (info: chrome.sockets.udp.SendInfo) => { }); // close chrome.sockets.udp.close(socketId); @@ -194,10 +194,10 @@ function test_socketsUdp(): void { chrome.sockets.udp.getSockets((infos: chrome.sockets.udp.SocketInfo[]) => { }); // joinGroup - chrome.sockets.udp.joinGroup(socketId, "224.0.0.1", (result: number) => { }); + chrome.sockets.udp.joinGroup(socketId, '224.0.0.1', (result: number) => { }); // leaveGroup - chrome.sockets.udp.leaveGroup(socketId, "224.0.0.1", (result: number) => { }); + chrome.sockets.udp.leaveGroup(socketId, '224.0.0.1', (result: number) => { }); // setMulticastTimeToLive chrome.sockets.udp.setMulticastTimeToLive(socketId, 100, (result: number) => { }); @@ -223,7 +223,7 @@ function testSocketsUdpTypes(): void { properties = { persistent: true, - name: "test", + name: 'test', bufferSize: 1024 }; @@ -236,9 +236,9 @@ function testSocketsUdpTypes(): void { paused: true }; - socketInfo.name = "test"; + socketInfo.name = 'test'; socketInfo.bufferSize = 1024; - socketInfo.localAddress = "192.168.0.2"; + socketInfo.localAddress = '192.168.0.2'; socketInfo.localPort = 8000; } @@ -266,8 +266,8 @@ function test_socketsTcpServer(): void { chrome.sockets.tcpServer.setPaused(socketId, true, () => { }); // listen - chrome.sockets.tcpServer.listen(socketId, "0.0.0.0", 80, (result: number) => { }); - chrome.sockets.tcpServer.listen(socketId, "0.0.0.0", 80, 128, (result: number) => { }); + chrome.sockets.tcpServer.listen(socketId, '0.0.0.0', 80, (result: number) => { }); + chrome.sockets.tcpServer.listen(socketId, '0.0.0.0', 80, 128, (result: number) => { }); // disconnect chrome.sockets.tcp.disconnect(socketId); @@ -298,7 +298,7 @@ function testSocketsTcpServerTypes(): void { properties = { persistent: true, - name: "test" + name: 'test' }; // SocketInfo @@ -310,8 +310,8 @@ function testSocketsTcpServerTypes(): void { paused: true }; - socketInfo.name = "test"; - socketInfo.localAddress = "192.168.0.2"; + socketInfo.name = 'test'; + socketInfo.localAddress = '192.168.0.2'; socketInfo.localPort = 8000; } @@ -324,5 +324,213 @@ function testSystemNetwork() { }); } -import webview = chrome.webview; -let element: webview.HTMLWebViewElement; +const gcmMessage = {}; +gcmMessage.data = { + /*goog: 'any', should not be allowed, and it is not :) */ + test: true +}; + +let wve: chrome.webview.HTMLWebViewElement = (document.getElementById('webview')); +wve.name = 'test'; +wve.src = 'https://github.com/DefinitelyTyped'; +wve.allowtransparency = true; +wve.autosize = 'on'; +wve.partition = 'persist:githubwebview'; +wve.addEventListener('close', () => { + return; +}); +wve.addEventListener('consolemessage', (ev) => { + if (ev.level === 2) { + const msg = ev.message; + } +}); +wve.addEventListener('dialog', (ev) => { + ev.dialog.ok('Hello World!'); +}); +wve.addEventListener('loadstart', (ev) => { + if (ev.isTopLevel) { + return ev.url; + } + return; +}); +wve.addEventListener('zoomchange', (ev) => { + return ev.newZoomFactor || ev.oldZoomFactor; +}); +wve.addEventListener('loadredirect', (ev) => { + return ev.newUrl || ev.oldUrl; +}); + +chrome.bluetooth.getAdapterState((adapter) => { + console.log('Adapter ' + adapter.address + ': ' + adapter.name); +}); + +chrome.bluetooth.getDevices((devices) => { + for (const device of devices) { + console.log(device.address); + } +}); + +chrome.bluetooth.onDeviceAdded.addListener((device) => { + let uuid = '0000180d-0000-1000-8000-00805f9b34fb'; + if (!device.uuids || device.uuids.indexOf(uuid) < 0) + return; + + // The device has a service with the desired UUID. + chrome.bluetoothLowEnergy.connect(device.address, () => { + if (chrome.runtime.lastError) { + console.log('Failed to connect: ' + chrome.runtime.lastError.message); + return; + } + // Connected! Do stuff... + }); +}); + +const uuid = '1105'; + +chrome.bluetooth.getDevices((devices) => { + chrome.bluetoothSocket.create((createInfo) => { + chrome.bluetoothSocket.connect(createInfo.socketId, + devices[0].address, uuid, () => { + if (chrome.runtime.lastError) { + console.log('Connection failed: ' + chrome.runtime.lastError.message); + } else { + chrome.bluetoothSocket.send(createInfo.socketId, new ArrayBuffer(4096), (bytes_sent) => { + if (chrome.runtime.lastError) { + console.log('Send failed: ' + chrome.runtime.lastError.message); + } else { + console.log('Sent ' + bytes_sent + ' bytes') + } + }); + } + }); + chrome.bluetoothSocket.onReceive.addListener((receiveInfo) => { + if (receiveInfo.socketId != createInfo.socketId) + return; + // receiveInfo.data is an ArrayBuffer. + }); + }); +}); + +chrome.hid.getDevices({ + filters: [ + { vendorId: 5 } + ] +}, (devices) => { + const productId = devices[0].productId; + chrome.hid.getUserSelectedDevices((selectedDevices) => { + const hmm = selectedDevices.productId == productId ? selectedDevices.vendorId : selectedDevices.maxFeatureReportSize; + }); +}); + +chrome.syncFileSystem.getConflictResolutionPolicy((policy) => { + if (policy === 'manual') { + chrome.syncFileSystem.requestFileSystem((fs) => { + if (fs.root.isFile) { + throw new Error('It was a file!'); + } + }); + } +}) +chrome.contextMenus.ACTION_MENU_TOP_LEVEL_LIMIT; + +chrome.i18n.getMessage('click_here', ['string1', 'string2']); + +const TLSFormatExample = { + NetworkConfigurations: + { + GUID: '{00f79111-51e0-e6e0-76b3b55450d80a1b}', + Name: 'MyTTLSNetwork', + Type: 'WiFi', + WiFi: { + AutoConnect: false, + EAP: { + ClientCertPattern: { + EnrollmentURI: [ + 'http://fetch-my-certificate.com' + ], + IssuerCARef: [ + '{6ed8dce9-64c8-d568-d225d7e467e37828}' + ] + }, + 'ClientCertType': 'Pattern', + 'Outer': 'EAP-TLS', + 'ServerCARef': '{6ed8dce9-64c8-d568-d225d7e467e37828}', + 'UseSystemCAs': true + }, + 'HiddenSSID': false, + 'SSID': 'MyTTLSNetwork', + 'Security': 'WPA-EAP' + } + } +} + +let serviceId: any = null; + +const runApp = () => { + var options = { + 'id': 'Bluetooth Sample App', + 'bounds': { + 'width': 1024, + 'height': 768 + } + }; + + chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + if (request.serviceId) { + serviceId = request.serviceId; + console.log('Received registered service Id: ' + serviceId); + } + }); + + chrome.app.window.create('test.html', options, (theWindow) => { + theWindow.onClosed.addListener(() => { + if (serviceId) { + console.log('Unregistering service: ' + serviceId); + chrome.bluetoothLowEnergy.unregisterService(serviceId, (status) => { + console.log('Unregister service status = ' + status); + }); + } + }); + }); +} + +chrome.app.runtime.onLaunched.addListener(runApp); +chrome.app.runtime.onRestarted.addListener(runApp); + +// networking.onc + +chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => { + console.log('Length of Network list: ' + networkList.length); + for (let networkObj of networkList) { + console.log('GUID: ' + networkObj.GUID); + console.log('Connectable: ' + networkObj.Connectable); + if (networkObj.WiFi) { + // WiFi active :) + console.log('Wifi BSID: ' + networkObj.WiFi.BSSID); + } + chrome.networking.onc.setProperties(networkObj.GUID || '', { + WiFi: { + Passphrase: 'Can be set :) but not get?' + } + }) + // Test that we can't get passphrase + chrome.networking.onc.getProperties(networkObj.GUID || '', (props) => { + const WiFiResult = props.WiFi; + }); + } +}); + +//// AUDIO + +chrome.audio.getDevices({}, (audioDeviceInfoList) => { + for (let audioObj of audioDeviceInfoList) { + console.log('ID: ' + audioObj.id); + console.log('Audio Stream Type: ' + audioObj.streamType); + console.log('Audio Device Name: ' + audioObj.deviceName); + } +}); + + +chrome.desktopCapture.chooseDesktopMedia(["screen", "window", "tab"], () => { }); +chrome.desktopCapture.chooseDesktopMedia([chrome.desktopCapture.DesktopCaptureSourceType.AUDIO], () => { }); + diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 0bfec6bfd8..49f079e159 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -4959,6 +4959,7 @@ declare namespace chrome.runtime { export interface ConnectInfo { name?: string; + includeTlsChannelId?: boolean; } export interface InstalledDetails { @@ -6564,7 +6565,7 @@ declare namespace chrome.tabs { * @param callback Optional. * Parameter window: Contains details about the window whose tabs were highlighted. */ - export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void; + export function highlight(highlightInfo: HighlightInfo, callback?: (window: chrome.windows.Window) => void): void; /** * Gets all tabs that have the specified properties, or all tabs if no properties are specified. * @since Chrome 16. @@ -7383,6 +7384,10 @@ declare namespace chrome.webRequest { type: ResourceType; /** The time when this signal is triggered, in milliseconds since the epoch. */ timeStamp: number; + /** The origin where the request was initiated. This does not change through redirects. If this is an opaque origin, the string 'null' will be used. + * @since Since Chrome 63. + */ + initiator?: string; } export interface WebRequestDetails extends ResourceRequest { diff --git a/types/chromecast-caf-receiver/cast.framework.events.d.ts b/types/chromecast-caf-receiver/cast.framework.events.d.ts index 0c69727a05..03b70ca459 100644 --- a/types/chromecast-caf-receiver/cast.framework.events.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.events.d.ts @@ -367,9 +367,15 @@ declare namespace cast.framework.events { total?: number, whenSkippable?: number, endedReason?: EndedReason, - breakClipId?: string + breakClipId?: string, + breakId?: string ); + /** + * The break's id. Refer to Break.id + */ + breakId?: string; + /** * The break clip's id. Refer to BreakClip.id */ diff --git a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts index a75834b0a8..08ce57cf86 100644 --- a/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts +++ b/types/chromecast-caf-receiver/chromecast-caf-receiver-tests.ts @@ -8,7 +8,8 @@ import { } from "chromecast-caf-receiver/cast.framework.system"; import { RequestEvent, - Event + Event, + BreaksEvent } from "chromecast-caf-receiver/cast.framework.events"; import { QueueBase, @@ -29,12 +30,16 @@ import { MediaMetadata } from "chromecast-caf-receiver/cast.framework.messages"; +const breaksEvent = new BreaksEvent('BREAK_STARTED'); +breaksEvent.breakId = 'some-break-id'; +breaksEvent.breakClipId = 'some-break-clip-id'; + const track = new Track(1, "TEXT"); const breakClip = new BreakClip("id"); const adBreak = new Break("id", ["id"], 1); const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 }); const pManager = new PlayerManager(); -pManager.addEventListener("STALLED", () => {}); +pManager.addEventListener("STALLED", () => { }); const ttManager = new TextTracksManager(); const qManager = new QueueManager(); const qBase = new QueueBase(); @@ -47,10 +52,10 @@ const breakManager: BreakManager = { getBreakClips: () => [breakClip], getBreaks: () => [adBreak], getPlayWatchedBreak: () => true, - setBreakClipLoadInterceptor: () => {}, - setBreakSeekInterceptor: () => {}, - setPlayWatchedBreak: () => {}, - setVastTrackingInterceptor: () => {} + setBreakClipLoadInterceptor: () => { }, + setBreakSeekInterceptor: () => { }, + setPlayWatchedBreak: () => { }, + setVastTrackingInterceptor: () => { } }; const lrd: LoadRequestData = { @@ -103,4 +108,4 @@ const pData: PlayerData = { whenSkippable: 321 }; const binder = new PlayerDataBinder(pData); -binder.addEventListener("ANY_CHANGE", e => {}); +binder.addEventListener("ANY_CHANGE", e => { }); diff --git a/types/classnames/index.d.ts b/types/classnames/index.d.ts index 40e3ce835c..84073ec109 100644 --- a/types/classnames/index.d.ts +++ b/types/classnames/index.d.ts @@ -12,7 +12,7 @@ type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean; interface ClassDictionary { - [id: string]: boolean | undefined | null; + [id: string]: any; } // This is the only way I found to break circular references between ClassArray and ClassValue @@ -21,7 +21,9 @@ interface ClassArray extends Array { } // tslint:disable-line no-emp type ClassNamesFn = (...classes: ClassValue[]) => string; -declare const classNames: ClassNamesFn; +type ClassNamesExport = ClassNamesFn & { default: ClassNamesFn }; + +declare const classNames: ClassNamesExport; export = classNames; export as namespace classNames; diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx index eb682d432b..a826d2607a 100644 --- a/types/cleave.js/cleave.js-tests.tsx +++ b/types/cleave.js/cleave.js-tests.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import Cleave = require("cleave.js"); import CleaveReact = require("cleave.js/react"); +import { Props } from "cleave.js/react/props"; const ExampleSelector1 = () => { const cleave = new Cleave("#my-input", { phone: true }); @@ -29,3 +30,14 @@ const ExampleReact1 = (props: any) => { /> ); }; + +const ExampleReact2 = (props: Props) => { + return ( + + ); +}; diff --git a/types/cleave.js/options/index.d.ts b/types/cleave.js/options/index.d.ts index 60e2e99e40..65d87d79e1 100644 --- a/types/cleave.js/options/index.d.ts +++ b/types/cleave.js/options/index.d.ts @@ -19,6 +19,12 @@ export interface CleaveOptions { datePattern?: ReadonlyArray; } +// Time Options +export interface CleaveOptions { + time?: boolean; + timePattern?: ReadonlyArray; +} + // Numeral Options export type NumeralThousandsGroupStyleType = "lakh" | "thousand" | "wan" | "none"; diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts index 1f50cbdbf3..bf158b8f4d 100644 --- a/types/cleave.js/react/index.d.ts +++ b/types/cleave.js/react/index.d.ts @@ -1,13 +1,5 @@ import * as React from "react"; -import { CleaveOptions } from "../options"; - -type InitHandler = (owner: React.ReactInstance) => void; - -interface Props extends React.InputHTMLAttributes { - onInit?: InitHandler; - options: CleaveOptions; - htmlRef?: (i: any) => void; -} +import { Props } from "./props"; declare var Cleave: React.ComponentClass; export = Cleave; diff --git a/types/cleave.js/react/props.d.ts b/types/cleave.js/react/props.d.ts new file mode 100644 index 0000000000..6ce47db62c --- /dev/null +++ b/types/cleave.js/react/props.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +import { CleaveOptions } from "../options"; + +export type InitHandler = (owner: React.ReactInstance) => void; + +export interface Props extends React.InputHTMLAttributes { + onInit?: InitHandler; + options: CleaveOptions; + htmlRef?: (i: any) => void; +} diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index ec4da5d047..1cf200a1d2 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -23,6 +23,7 @@ "index.d.ts", "options/creditCard.d.ts", "options/index.d.ts", - "react/index.d.ts" + "react/index.d.ts", + "react/props.d.ts" ] } \ No newline at end of file diff --git a/types/clipboard/clipboard-tests.ts b/types/clipboard/clipboard-tests.ts index a2ae8f9354..1a9a170087 100644 --- a/types/clipboard/clipboard-tests.ts +++ b/types/clipboard/clipboard-tests.ts @@ -14,6 +14,12 @@ const cb5 = new ClipboardJS(".btn", { action: elem => "copy", target: elem => null }); +const cb6 = new ClipboardJS(".btn", { + action: elem => "copy", + text: trigger => trigger.getAttribute('aria-label'), + target: trigger => trigger.nextElementSibling, + container: document.getElementById('modal') +}); cb1.destroy(); ClipboardJS.isSupported(); diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts index 2405c0c6f0..ceb15b885b 100644 --- a/types/clipboard/index.d.ts +++ b/types/clipboard/index.d.ts @@ -49,6 +49,14 @@ declare namespace ClipboardJS { * @returns Text to be copied. */ text?(elem: Element): string; + + /** + * For use in Bootstrap Modals or with any + * other library that changes the focus + * you'll want to set the focused element + * as the container value. + */ + container?: Element; } interface Event { diff --git a/types/cls-hooked/index.d.ts b/types/cls-hooked/index.d.ts index 6d0a68aa6e..57e6b79c60 100644 --- a/types/cls-hooked/index.d.ts +++ b/types/cls-hooked/index.d.ts @@ -14,6 +14,7 @@ export interface Namespace { get(key: string): any; run(fn: (...args: any[]) => void): void; runAndReturn(fn: (...args: any[]) => T): T; + runPromise(fn: (...args: any[]) => Promise): Promise; bind(fn: F, context?: any): F; // tslint:disable-line: ban-types bindEmitter(emitter: EventEmitter): void; createContext(): any; diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index e7fa7c368e..5ece4f497e 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: mihailik // nrbernard // Pr1st0n +// rileymiller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = CodeMirror; @@ -14,8 +15,9 @@ declare function CodeMirror(callback: (host: HTMLElement) => void , options?: Co declare namespace CodeMirror { export var Doc : CodeMirror.DocConstructor; export var Pos: CodeMirror.PositionConstructor; - export var Pass: any; + export var Pass: {toString(): "CodeMirror.PASS"}; + function countColumn(line: string, index: number | null, tabSize: number): number; function fromTextArea(host: HTMLTextAreaElement, options?: EditorConfiguration): CodeMirror.EditorFromTextArea; /** It contains a string that indicates the version of the library. This is a triple of integers "major.minor.patch", @@ -127,6 +129,10 @@ declare namespace CodeMirror { state: any; } + interface KeyMap { + [keyName: string]: false | string | ((instance: Editor) => void | typeof Pass); + } + interface Editor { /** Tells you whether the editor currently has focus. */ @@ -157,11 +163,11 @@ declare namespace CodeMirror { Maps added in this way have a higher precedence than the extraKeys and keyMap options, and between them, the maps added earlier have a lower precedence than those added later, unless the bottom argument was passed, in which case they end up below other keymaps added with this method. */ - addKeyMap(map: any, bottom?: boolean): void; + addKeyMap(map: string | KeyMap, bottom?: boolean): void; /** Disable a keymap added with addKeyMap.Either pass in the keymap object itself , or a string, which will be compared against the name property of the active keymaps. */ - removeKeyMap(map: any): void; + removeKeyMap(map: string | KeyMap): void; /** Enable a highlighting overlay.This is a stateless mini - mode that can be used to add extra highlighting. For example, the search add - on uses it to highlight the term that's currently being searched. @@ -714,8 +720,9 @@ declare namespace CodeMirror { } interface EditorChangeCancellable extends CodeMirror.EditorChange { - /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */ - update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; + /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. + If the change came from undo/redo, `update` is undefined and the change cannot be modified. */ + update?(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; cancel(): void; } @@ -778,7 +785,7 @@ declare namespace CodeMirror { keyMap?: string; /** Can be used to specify extra keybindings for the editor, alongside the ones defined by keyMap. Should be either null, or a valid keymap value. */ - extraKeys?: any; + extraKeys?: string | KeyMap; /** Whether CodeMirror should scroll or wrap for long lines. Defaults to false (scroll). */ lineWrapping?: boolean; diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index 39c601f159..bd2aefac88 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -4,7 +4,18 @@ var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body); var myCodeMirror2: CodeMirror.Editor = CodeMirror(document.body, { value: "function myScript(){return 100;}\n", - mode: "javascript" + mode: "javascript", + extraKeys: { + Enter: (cm) => { console.log("save"); }, + Esc: (cm) => { return CodeMirror.Pass; } + } +}); + +// $ExpectError +var myCodeMirror2_1: CodeMirror.Editor = CodeMirror(document.body, { + extraKeys: { + "Shift-Enter": (cm) => { return 42; } // not a valid return value + } }); var range = myCodeMirror2.findWordAt(CodeMirror.Pos(0, 2)); @@ -13,9 +24,9 @@ var head = range.head; var from = range.from(); var to = range.to(); -var myTextArea: HTMLTextAreaElement; +var myTextArea: HTMLTextAreaElement = undefined!; var myCodeMirror3: CodeMirror.Editor = CodeMirror(function (elt) { - myTextArea.parentNode.replaceChild(elt, myTextArea); + myTextArea.parentNode!.replaceChild(elt, myTextArea); }, { value: myTextArea.value }); var myCodeMirror4: CodeMirror.Editor = CodeMirror.fromTextArea(myTextArea); @@ -67,6 +78,15 @@ myCodeMirror.on( (instance: CodeMirror.Editor, line: CodeMirror.LineHandle, element: HTMLElement) => { } ); +myCodeMirror.on( + "beforeChange", + (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => { + // $ExpectError + change.update(); + if (change.update != null) change.update(); + } +); + CodeMirror.registerHelper("lint", "javascript", {}); myCodeMirror.isReadOnly(); diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index 2ff349d98e..a2c6a52430 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts new file mode 100644 index 0000000000..c46d48d563 --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/com.wikitude.phonegap.wikitudeplugin-tests.ts @@ -0,0 +1,33 @@ +const startupConfiguration: any = { camera_position: 'back' }; + +// Some code samples from the wikitude ionic starter +WikitudePlugin.loadARchitectWorld( + success => { + console.log('ARchitect World loaded successfully.'); + }, + fail => { + console.log('Failed to load ARchitect World!'); + }, + 'www/assets/07_3dModels_6_3dModelAtGeoLocation/index.html', + ['geo'], + startupConfiguration +); + +WikitudePlugin.setOnUrlInvokeCallback(url => { + if (url.indexOf('captureScreen') > -1) { + WikitudePlugin.captureScreen( + absoluteFilePath => { + WikitudePlugin.callJavaScript( + `World.testFunction('Screenshot saved at: ${absoluteFilePath}');` + ); + }, + errorMessage => { + console.log(errorMessage); + }, + true, + null + ); + } else { + alert(url + 'not handled'); + } +}); diff --git a/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts new file mode 100644 index 0000000000..50307d57c8 --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for com.wikitude.phonegap.wikitudeplugin 7.2 +// Project: https://github.com/Wikitude/wikitude-cordova-plugin +// Definitions by: zbarbuto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// The following types are taken directly (unmodified) from the wikitude-ionic-3-starter-app +// https://github.com/pbreuss/wikitude-ionic-3-starter-app +// Latest commit at time of writing was 647cd546f6d1805765c4cee725566e246ca6259d + +/** + * Wrapper for the Wikitude SDK Phonegap Plugin - to use with IONIC2 + * (c) 2016 Schneeweis.Technology + */ +interface WikitudePlugin { + isDeviceSupported( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + requiredFeatures: [string] + ): void; + + loadARchitectWorld( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + architectWorldPath: string, + requiredFeatures: [string], + startupConfiguration: JSON | object + ): void; + + close(): void; + + hide(): void; + + show(): void; + + // test type ok? + callJavaScript(js: any): void; + + setOnUrlInvokeCallback(onUrlInvokeCallback: (success: string) => void): void; + + setLocation(latitude: any, longitude: any, altitude: any, accuracy: any): void; + + captureScreen( + successCallback: (success: string) => void, + errorCallback: (message: string) => void, + includeWebView: boolean, + imagePathInBundleOrNullForPhotoLibrary: string | null + ): void; + + setErrorHandler(errorHandler: (message: string) => void): void; + + setDeviceSensorsNeedCalibrationHandler( + startCalibrationHandler: (message: string) => void + ): void; + + setDeviceSensorsFinishedCalibrationHandler( + finishedCalibrationHandler: (message: string) => void + ): void; + + setBackButtonCallback(onBackButtonCallback: (message: string) => void): void; + + /* Lifecycle updates */ + + onResume(): void; + onBackButton(): void; + onPause(): void; + + onWikitudeOK(): void; + onWikitudeError(): void; + + _sdkKey: string; + FeatureGeo: string; + Feature2DTracking: string; + CameraPositionUndefined: number; + CameraPositionFront: number; + CameraPositionBack: number; + CameraFocusRangeNone: number; + CameraFocusRangeNear: number; + CameraFocusRangeFar: number; +} + +declare var WikitudePlugin: WikitudePlugin; diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json new file mode 100644 index 0000000000..ed0ce7783e --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "com.wikitude.phonegap.wikitudeplugin-tests.ts" + ] +} diff --git a/types/com.wikitude.phonegap.wikitudeplugin/tslint.json b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/com.wikitude.phonegap.wikitudeplugin/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/common-prefix/common-prefix-tests.ts b/types/common-prefix/common-prefix-tests.ts new file mode 100644 index 0000000000..5de96a5358 --- /dev/null +++ b/types/common-prefix/common-prefix-tests.ts @@ -0,0 +1,4 @@ +import common = require('common-prefix'); // common is(string: ReadOnlyArray) => string + +// $ExpectType string +common(['a']); diff --git a/types/common-prefix/index.d.ts b/types/common-prefix/index.d.ts new file mode 100644 index 0000000000..482e880f05 --- /dev/null +++ b/types/common-prefix/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for common-prefix 1.1 +// Project: https://github.com/hughsk/common-prefix +// Definitions by: Sean Marvi Oliver Genabe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function common(strings: ReadonlyArray): string; + +export = common; diff --git a/types/common-prefix/tsconfig.json b/types/common-prefix/tsconfig.json new file mode 100644 index 0000000000..e7b8748dee --- /dev/null +++ b/types/common-prefix/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "common-prefix-tests.ts" + ] +} diff --git a/types/common-prefix/tslint.json b/types/common-prefix/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/common-prefix/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/commondir/commondir-tests.ts b/types/commondir/commondir-tests.ts new file mode 100644 index 0000000000..33adefb491 --- /dev/null +++ b/types/commondir/commondir-tests.ts @@ -0,0 +1,14 @@ +import commondir = require('commondir'); + +// $ExpectType string +commondir('wwwroot', [ + 'static_files/png/', + '../gif/image.gif', +]); + +// $ExpectType string +commondir([ + '/x/y/z', + '/x/y', + '/x/y/w/q', +]); diff --git a/types/commondir/index.d.ts b/types/commondir/index.d.ts new file mode 100644 index 0000000000..ac75d00d00 --- /dev/null +++ b/types/commondir/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for commondir 1.0 +// Project: https://github.com/substack/node-commondir +// Definitions by: Leonard Thieu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = commondir; + +/** + * Compute the closest common parent directory for an array absolutePaths. + * + * @see \`{@link https://github.com/substack/node-commondir#commondirabsolutepaths }\` + */ +declare function commondir(basedir: string, relativePaths: string[]): string; +/** + * Compute the closest common parent directory for an array relativePaths which will be resolved for each dir in + * relativePaths according to: path.resolve(basedir, dir). + * + * @see \`{@link https://github.com/substack/node-commondir#commondirbasedir-relativepaths }\` + */ +declare function commondir(absolutePaths: string[]): string; diff --git a/types/commondir/tsconfig.json b/types/commondir/tsconfig.json new file mode 100644 index 0000000000..e00a5278b8 --- /dev/null +++ b/types/commondir/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "commondir-tests.ts" + ] +} diff --git a/types/commondir/tslint.json b/types/commondir/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/commondir/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/config-yaml/config-yaml-tests.ts b/types/config-yaml/config-yaml-tests.ts new file mode 100644 index 0000000000..4ddf61e69f --- /dev/null +++ b/types/config-yaml/config-yaml-tests.ts @@ -0,0 +1,5 @@ +import yaml = require('config-yaml'); + +yaml('./simple.yaml'); +yaml('./simple.yaml', { encoding: 'gbk' }); +yaml('./simple.yaml', { encoding: 'utf-8' }); diff --git a/types/config-yaml/index.d.ts b/types/config-yaml/index.d.ts new file mode 100644 index 0000000000..6f2be7957b --- /dev/null +++ b/types/config-yaml/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for config-yaml 1.1 +// Project: https://github.com/neolao/config-yaml#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.1 + +/// +import * as fs from 'fs'; + +export = Yaml; + +declare namespace Yaml { + interface Options { + encoding: string; + } +} + +declare function Yaml(path: fs.PathLike, options?: Partial): any; diff --git a/types/config-yaml/tsconfig.json b/types/config-yaml/tsconfig.json new file mode 100644 index 0000000000..fa349a2f41 --- /dev/null +++ b/types/config-yaml/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "config-yaml-tests.ts" + ] +} diff --git a/types/config-yaml/tslint.json b/types/config-yaml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/config-yaml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index cf3d5ddb3e..ee110ab6b0 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -104,11 +104,11 @@ declare namespace connectMongo { } export class MongoStore extends session.Store { - get: (sid: string, callback: (err: any, session: Express.Session) => void) => void; + get: (sid: string, callback: (err: any, session: Express.Session | null) => void) => void; set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; destroy: (sid: string, callback?: (err: any) => void) => void; length: (callback: (err: any, length: number) => void) => void; - clear: (callback?: (err: any) => void) => void; + clear: (callback?: (err?: any) => void) => void; touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; } } diff --git a/types/connect-mongo/tsconfig.json b/types/connect-mongo/tsconfig.json index ca12068b57..c0c9ab3043 100644 --- a/types/connect-mongo/tsconfig.json +++ b/types/connect-mongo/tsconfig.json @@ -7,7 +7,10 @@ "paths": { "mongodb": [ "mongodb/v2" - ] + ], + "mongoose": [ + "mongoose/v4" + ] }, "noImplicitAny": true, "noImplicitThis": true, @@ -25,4 +28,4 @@ "index.d.ts", "connect-mongo-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/connect-mongodb-session/connect-mongodb-session-tests.ts b/types/connect-mongodb-session/connect-mongodb-session-tests.ts new file mode 100644 index 0000000000..963be905c0 --- /dev/null +++ b/types/connect-mongodb-session/connect-mongodb-session-tests.ts @@ -0,0 +1,39 @@ +import * as express from 'express' +import session = require('express-session') +import connectMongo = require('connect-mongodb-session') +let MongoDBStore = connectMongo(session) + +var app = express(); +var store = new MongoDBStore({ + uri: 'mongodb://localhost:27017/connect_mongodb_session_test', + collection: 'mySessions' +}, function(error) { + // some connection error occur +}); + +store.on('connected', function() { + store.client; // The underlying MongoClient object from the MongoDB driver +}); + +// Catch errors +store.on('error', function(error) { +}); + +app.use(require('express-session')({ + secret: 'This is a secret', + cookie: { + maxAge: 1000 * 60 * 60 * 24 * 7 // 1 week + }, + store: store, + // Boilerplate options, see: + // * https://www.npmjs.com/package/express-session#resave + // * https://www.npmjs.com/package/express-session#saveuninitialized + resave: true, + saveUninitialized: true +})); + +app.get('/', function(req, res) { + res.send('Hello ' + JSON.stringify(req.session)); +}); + +const server = app.listen(3000); \ No newline at end of file diff --git a/types/connect-mongodb-session/index.d.ts b/types/connect-mongodb-session/index.d.ts new file mode 100644 index 0000000000..c328a211b2 --- /dev/null +++ b/types/connect-mongodb-session/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for connect-mongodb-session +// Project: https://github.com/kcbanner/connect-mongodb-session +// Definitions by: Nattapong Sirilappanich +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import session = require('express-session'); +import * as express from 'express'; +import {MongoClient, MongoClientOptions} from 'mongodb' + +declare function connect(fn : (options?: session.SessionOptions) => express.RequestHandler) : connectMongodbSession.MongoDBStore + +declare namespace connectMongodbSession { + export interface MongoDBStore extends session.Store { + client : MongoClient + new(connection?: ConnectionInfo, callback?: (error : Error) => void) : MongoDBStore + } + + export interface ConnectionInfo { + idField? : string + collection : string + connectionOptions?: MongoClientOptions + databaseName?: string + expires?: number + uri : string + } +} + +export = connect \ No newline at end of file diff --git a/types/connect-mongodb-session/tsconfig.json b/types/connect-mongodb-session/tsconfig.json new file mode 100644 index 0000000000..61b0db83b2 --- /dev/null +++ b/types/connect-mongodb-session/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6" + ], + "module": "commonjs", + "noEmit": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "typeRoots": [ + "../" + ], + "types": [ + ] + }, + "files": [ + "connect-mongodb-session-tests.ts", + "index.d.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/types/interact.js/tslint.json b/types/connect-mongodb-session/tslint.json similarity index 100% rename from types/interact.js/tslint.json rename to types/connect-mongodb-session/tslint.json diff --git a/types/console-log-level/console-log-level-tests.ts b/types/console-log-level/console-log-level-tests.ts new file mode 100644 index 0000000000..3df123421b --- /dev/null +++ b/types/console-log-level/console-log-level-tests.ts @@ -0,0 +1,20 @@ +import consoleLogLevel = require("console-log-level"); + +const logger1 = consoleLogLevel({ + level: "trace", + stderr: undefined, + prefix: () => "SOME PREFIX" +}); + +const logger2 = consoleLogLevel({ + level: "trace", + stderr: true, + prefix: "OTHER PREFIX" +}); + +logger1.trace("hello %s", "world"); +logger2.debug("hello %s", "world"); +logger2.info("hello %s", "world"); +logger2.warn("hello %s", "world"); +logger2.error("hello %s", "world"); +logger2.fatal("hello %s", "world"); diff --git a/types/console-log-level/index.d.ts b/types/console-log-level/index.d.ts new file mode 100644 index 0000000000..3a70f850df --- /dev/null +++ b/types/console-log-level/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for console-log-level 1.4 +// Project: https://github.com/watson/console-log-level +// Definitions by: Ali Ijaz Sheikh +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +type PrefixFunction = (level: string) => string; + +declare namespace consoleLogLevel { + type LogLevelNames = + "trace" | "debug" | "info" | "warn" | "error" | "fatal"; + type Logger = Record void>; +} + +interface Options { + level?: consoleLogLevel.LogLevelNames; + prefix?: string | PrefixFunction; + stderr?: boolean; +} + +declare function consoleLogLevel(opts: Options): consoleLogLevel.Logger; + +export = consoleLogLevel; diff --git a/types/console-log-level/tsconfig.json b/types/console-log-level/tsconfig.json new file mode 100644 index 0000000000..3fcb21220b --- /dev/null +++ b/types/console-log-level/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "console-log-level-tests.ts" + ] +} diff --git a/types/console-log-level/tslint.json b/types/console-log-level/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/console-log-level/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/console-stamp/console-stamp-tests.ts b/types/console-stamp/console-stamp-tests.ts index d4dad4d695..55408d318a 100644 --- a/types/console-stamp/console-stamp-tests.ts +++ b/types/console-stamp/console-stamp-tests.ts @@ -15,6 +15,8 @@ var options2 = { label: "white", metadata: "green" }, - label: true + label: true, + labelPrefix: '[', + labelSuffix: ']' }; consoleStamp(console, options2); diff --git a/types/console-stamp/index.d.ts b/types/console-stamp/index.d.ts index c7b9547cc8..5912b6876e 100644 --- a/types/console-stamp/index.d.ts +++ b/types/console-stamp/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for console-stamp 0.2.0 // Project: https://github.com/starak/node-console-stamp // Definitions by: Eric Byers +// Guus De Graeve // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,6 +17,16 @@ declare function consoleStamp(console: {}, options?: { */ label?: boolean; + /** + * A custom prefix for the label. + */ + labelPrefix?: string; + + /** + * A custom suffix for the label. + */ + labelSuffix?: string; + /** * An array containing the methods to include in the patch */ diff --git a/types/consolidate/index.d.ts b/types/consolidate/index.d.ts index bfe432214f..23f431d8f8 100644 --- a/types/consolidate/index.d.ts +++ b/types/consolidate/index.d.ts @@ -2,13 +2,13 @@ // Project: https://github.com/visionmedia/consolidate.js // Definitions by: Carlos Ballesteros Velasco , Theo Sherry , Nicolas Henry // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 // Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts /// -/// +import Promise = require("bluebird"); declare var cons: Consolidate; diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json index a41bf5d19a..a403f5da2b 100644 --- a/types/consolidate/tslint.json +++ b/types/consolidate/tslint.json @@ -4,6 +4,7 @@ "adjacent-overload-signatures": false, "array-type": false, "arrow-return-shorthand": false, + "await-promise": false, "ban-types": false, "callable-types": false, "comment-format": false, diff --git a/types/cookie-session/index.d.ts b/types/cookie-session/index.d.ts index 001ba646d5..a0b7a2e6b0 100644 --- a/types/cookie-session/index.d.ts +++ b/types/cookie-session/index.d.ts @@ -78,17 +78,17 @@ declare namespace CookieSessionInterfaces { /** * Is true if the session has been changed during the request. */ - isChanged: boolean; + isChanged?: boolean; /** * Is true if the session is new. */ - isNew: boolean; + isNew?: boolean; /** * Determine if the session has been populated with data or is empty. */ - isPopulated: boolean; + isPopulated?: boolean; [propertyName: string]: any; } @@ -97,7 +97,7 @@ declare namespace CookieSessionInterfaces { /** * Represents the session for the given request. */ - session: CookieSessionObject; + session?: CookieSessionObject; /** * Represents the session options for the current request. These options are a shallow clone of what was provided at middleware construction and can be altered to change cookie setting behavior on a per-request basis. diff --git a/types/cookiejar/cookiejar-tests.ts b/types/cookiejar/cookiejar-tests.ts new file mode 100644 index 0000000000..9cc131e433 --- /dev/null +++ b/types/cookiejar/cookiejar-tests.ts @@ -0,0 +1,92 @@ +import cookiejarLib = require('cookiejar'); + +const { Cookie, CookieAccessInfo, CookieJar } = cookiejarLib; + +// Original test: https://github.com/bmeck/node-cookiejar/blob/master/tests/test.js + +let testCookie = new Cookie("a=1;domain=.test.com;path=/"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.equal(testCookie.secure, false); +// assert.equal(testCookie.expiration_date, Infinity); + +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); +// assert.ok(testCookie.collidesWith(new Cookie("a=1;domain=.test.com;path=/"))); + +testCookie = new Cookie("a=1;path=/", ".test.com"); +// assert.equal(testCookie.domain, ".test.com"); + +// Test CookieJar +const testCookieJar = new CookieJar(); +testCookieJar.setCookies([ + "a=1;domain=.test.com;path=/", + "b=2;domain=test.com;path=/", + "c=3;domain=test.com;path=/;expires=January 1, 1970" +].join(':')); + +let testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2, "Expires on setCookies fail\n" + testCookies.toString()); +// assert.equal(testCookies.toValueString(), 'a=1;b=2', "Cannot get value string of multiple cookies"); + +testCookies = testCookieJar.getCookies(new CookieAccessInfo("www.test.com", "/")); +// assert.equal(testCookies.length, 2, "Wildcard domain fail\n" + testCookies.toString()); + +testCookieJar.setCookies("b=2;domain=test.com;path=/;expires=January 1, 1970"); +testCookies = testCookieJar.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 1, "Delete cookie fail\n" + testCookies.toString()); +// assert.equal(String(testCookieJar.getCookies(new CookieAccessInfo("test.com", "/"))), "a=1; domain=.test.com; path=/"); + +testCookie = new Cookie("a=1;domain=test.com;path=/;HttpOnly"); +// assert.ok(testCookie.noscript, "HttpOnly flag parsing failed\n" + testCookie.toString()); + +const testCookieJar2 = new CookieJar(); +testCookieJar2.setCookies([ + "a=1;domain=.test.com;path=/", + "a=1;domain=.test.com;path=/", + "a=2;domain=.test.com;path=/", + "b=3;domain=.test.com;path=/" +]); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 2); +// assert.equal(testCookies[0].value, 2); + +// Test pure appending +testCookieJar2.setCookie("d=4;domain=.test.com;path=/"); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookies.length, 3); +// assert.equal(testCookies[2].value, 4); + +// Test Ignore Trailing Semicolons (Github Issue #6) +testCookie = new Cookie("a=1;domain=.test.com;path=/;;;;"); +// assert.equal(testCookie.name, "a"); +// assert.equal(testCookie.value, "1"); +// assert.equal(testCookie.domain, ".test.com"); +// assert.equal(testCookie.path, "/"); +// assert.deepEqual(testCookie, new Cookie("a=1;domain=.test.com;path=/")); + +// Test request_path and request_domain +testCookieJar2.setCookie(new Cookie("sub=4;path=/", "test.com")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("sub.test.com", "/")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/")); +// assert.equal(testCookie.name, "sub"); +// assert.equal(testCookie.domain, "test.com"); + +testCookieJar2.setCookie(new Cookie("sub=4;path=/accounts", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/foo")); +// assert.equal(testCookie, undefined); + +testCookie = testCookieJar2.getCookie("sub", new CookieAccessInfo("test.com", "/accounts")); +// assert.equal(testCookie.path, "/accounts"); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookies = testCookieJar2.getCookies(new CookieAccessInfo("test.com")); +// assert.equal(testCookies.length, 4); + +testCookieJar2.setCookie(new Cookie("sub=5;path=/", "test.com", "/accounts")); +testCookie = testCookieJar2.getCookie('sub', CookieAccessInfo.All); +// assert(testCookie); +// assert.equal(testCookie.name, 'sub'); diff --git a/types/cookiejar/index.d.ts b/types/cookiejar/index.d.ts new file mode 100644 index 0000000000..ba50b63ea2 --- /dev/null +++ b/types/cookiejar/index.d.ts @@ -0,0 +1,116 @@ +// Type definitions for CookieJar 2.1 +// Project: https://github.com/bmeck/node-cookiejar +// Definitions by: Rafal Proszowski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export class CookieAccessInfo { + /** + * Class to determine matching qualities of a cookie + * @param domain string domain to match + * @param path string path to match + * @param secure boolean access is secure (ssl generally) + * @param script boolean access is from a script + */ + constructor(domain: string, path?: string, secure?: boolean, script?: boolean); + + static All: CookieAccessInfo; + domain: string; // domain to match + path: string; // path to match + secure: boolean; // access is secure (ssl generally) + script: boolean; // access is from a script +} + +export class Cookie { + name: string; // name of the cookie + value: string; // string associated with the cookie + domain: string; // domain to match (on a cookie a '.' at the start means a wildcard matching anything ending in the rest) + explicit_domain: boolean; // if the domain was explicitly set via the cookie string + path: string; // base path to match (matches any path starting with this '/' is root) + explicit_path: boolean; // if the path was explicitly set via the cookie string + noscript: boolean; // if it should be kept from scripts + secure: boolean; // should it only be transmitted over secure means + expiration_date: number; // number of millis since 1970 at which this should be removed + + /** + * It turns input into a Cookie (singleton if given a Cookie), the + * request_domain argument is used to default the domain if it is not + * explicit in the cookie string, the request_path argument is used to set + * the path if it is not explicit in a cookie String. + * + * Explicit domains/paths will cascade, implied domains/paths must exactly + * match (see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Pat). + * @param cookie string or a cookie to work on + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + constructor(cookie: string | Cookie, requestDomain?: string, requestPath?: string); + + /** + * the set-cookie: string for this cookie + */ + toString(): string; + + /** + * the cookie: string for this cookie + */ + toValueString(): string; + + /** + * parses the string onto this cookie or a new one if called directly + * @param cookie string to be parsed into a Cookie + * @param requestDomain string definind the requesting domain + * @param requestPath string defining the requesting path + */ + parse(cookie: string, requestDomain?: string, requestPath?: string): Cookie; + + /** + * returns true if the access_info allows retrieval of this cookie + * @param accessInfo CookieAccessInfo + */ + matches(accessInfo: CookieAccessInfo): boolean; + + /** + * returns true if the cookies cannot exist in the same space + * (domain and path match) + * @param cookie Cookie + */ + collidesWith(cookie: Cookie): boolean; +} + +export class CookieJar { + /** + * class to hold numerous cookies from multiple domains correctly + */ + constructor(); + + /** + * modify (or add if not already-existing) a cookie to the jar + * @param cookie string | Cookie + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookie(cookie: string | Cookie, requestDomain?: string, requestPath?: string): Cookie | false; + + /** + * modify (or add if not already-existing) a large number of cookies to the + * jar + * @param cookie string or list of strings defining cookies + * @param requestDomain string argument is used to default the domain if it is not explicit in the cookie string + * @param requestPath string argument is used to set the path if it is not explicit in a cookie String + */ + setCookies(cookie: string | ReadonlyArray, requestDomain?: string, requestPath?: string): ReadonlyArray | false; + + /** + * get a cookie with the name and access_info matching + * @param cookieName string to be parsed into a Cookie + * @param accessInfo CookieAccessInfo + */ + getCookie(cookieName: string, accessInfo: CookieAccessInfo): Cookie; + + /** + * grab all cookies matching this access_info + * @param accessInfo CookieAccessInfo + */ + getCookies(accessInfo: CookieAccessInfo): ReadonlyArray; +} diff --git a/types/interact.js/tsconfig.json b/types/cookiejar/tsconfig.json similarity index 86% rename from types/interact.js/tsconfig.json rename to types/cookiejar/tsconfig.json index 6d4887d0f1..7fbf974ede 100644 --- a/types/interact.js/tsconfig.json +++ b/types/cookiejar/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "interact.js-tests.ts" + "cookiejar-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/cookiejar/tslint.json b/types/cookiejar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cookiejar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts index eedf42f450..59c1b8d0cb 100644 --- a/types/copy-webpack-plugin/index.d.ts +++ b/types/copy-webpack-plugin/index.d.ts @@ -61,7 +61,7 @@ interface CopyWebpackPluginConfiguration { } interface CopyWebpackPlugin { - new (patterns?: CopyPattern[], options?: CopyWebpackPluginConfiguration): Plugin + new (patterns?: (string | CopyPattern)[], options?: CopyWebpackPluginConfiguration): Plugin } declare const copyWebpackPlugin: CopyWebpackPlugin diff --git a/types/cosmiconfig/cosmiconfig-tests.ts b/types/cosmiconfig/cosmiconfig-tests.ts index c477eedb3e..f25337f3d3 100644 --- a/types/cosmiconfig/cosmiconfig-tests.ts +++ b/types/cosmiconfig/cosmiconfig-tests.ts @@ -1,4 +1,5 @@ -import cosmiconfig, { CosmiconfigResult } from "cosmiconfig"; +import cosmiconfig = require("cosmiconfig"); +import { CosmiconfigResult } from "cosmiconfig"; import * as path from "path"; const explorer = cosmiconfig("yourModuleName", { diff --git a/types/cosmiconfig/index.d.ts b/types/cosmiconfig/index.d.ts index 16ba1967f3..94e28e9dab 100644 --- a/types/cosmiconfig/index.d.ts +++ b/types/cosmiconfig/index.d.ts @@ -3,57 +3,62 @@ // Definitions by: ozum // szeck87 // saadq +// jinwoo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// -export interface Config { - [key: string]: any; +declare function cosmiconfig(moduleName: string, options?: cosmiconfig.ExplorerOptions): cosmiconfig.Explorer; + +declare namespace cosmiconfig { + interface Config { + [key: string]: any; + } + + type CosmiconfigResult = { + config: Config; + filepath: string; + isEmpty?: boolean; + } | null; + + interface LoaderResult { + config: Config | null; + filepath: string; + } + + type SyncLoader = (filepath: string, content: string) => Config | null; + type AsyncLoader = (filepath: string, content: string) => Config | null | Promise; + + interface LoaderEntry { + sync?: SyncLoader; + async?: AsyncLoader; + } + + interface Loaders { + [key: string]: LoaderEntry; + } + + interface Explorer { + search(searchFrom?: string): Promise; + searchSync(searchFrom?: string): null | CosmiconfigResult; + load(loadPath: string): Promise; + loadSync(loadPath: string): CosmiconfigResult; + clearLoadCache(): void; + clearSearchCache(): void; + clearCaches(): void; + } + + // These are the user options with defaults applied. + interface ExplorerOptions { + stopDir?: string; + cache?: boolean; + transform?: (result: CosmiconfigResult) => Promise | CosmiconfigResult; + packageProp?: string; + loaders?: Loaders; + searchPlaces?: string[]; + ignoreEmptySearchPlaces?: boolean; + } } -export type CosmiconfigResult = { - config: Config; - filepath: string; - isEmpty?: boolean; -} | null; - -export interface LoaderResult { - config: Config | null; - filepath: string; -} - -export type SyncLoader = (filepath: string, content: string) => Config | null; -export type AsyncLoader = (filepath: string, content: string) => Config | null | Promise; - -export interface LoaderEntry { - sync?: SyncLoader; - async?: AsyncLoader; -} - -export interface Loaders { - [key: string]: LoaderEntry; -} - -export interface Explorer { - search(searchFrom?: string): Promise; - searchSync(searchFrom?: string): null | CosmiconfigResult; - load(loadPath: string): Promise; - loadSync(loadPath: string): CosmiconfigResult; - clearLoadCache(): void; - clearSearchCache(): void; - clearCaches(): void; -} - -// These are the user options with defaults applied. -export interface ExplorerOptions { - stopDir?: string; - cache?: boolean; - transform?: (result: CosmiconfigResult) => Promise | CosmiconfigResult; - packageProp?: string; - loaders?: Loaders; - searchPlaces?: string[]; - ignoreEmptySearchPlaces?: boolean; -} - -export default function cosmiconfig(moduleName: string, options?: ExplorerOptions): Explorer; +export = cosmiconfig; diff --git a/types/couchbase/couchbase-tests.ts b/types/couchbase/couchbase-tests.ts index 547133754b..e6ea7c12d3 100644 --- a/types/couchbase/couchbase-tests.ts +++ b/types/couchbase/couchbase-tests.ts @@ -1,14 +1,167 @@ import couchbase = require('couchbase'); var cluster = new couchbase.Cluster('couchbase://127.0.0.1'); + +cluster.authenticate('username', 'password'); +cluster.authenticate({username: 'username', password: 'password'}); +cluster.authenticate(new couchbase.ClassicAuthenticator({'bucket': 'password'}, 'username', 'password')); + var bucket = cluster.openBucket('default'); +var N1qlQuery = couchbase.N1qlQuery; -bucket.upsert('testdoc', { name: 'Frank' }, (error) => { - if (error) throw error; +bucket.on('connect', () => console.error('Connected!')); +bucket.on('error', err => console.error('Connection failed!')); - bucket.get('testdoc', (err, result) => { - if (err) throw err; +bucket.once('connect', () => console.error('Connected!')); +bucket.once('error', err => console.error('Connection failed!')); - console.log(result.value); - // {name: Frank} +bucket.manager().createPrimaryIndex(function() { + bucket.upsert('user:king_arthur', { + 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows'] + }, + function(err, result) { + bucket.get('user:king_arthur', function(err, result) { + console.log('Got result: %j', result.value); + bucket.query( + N1qlQuery.fromString('SELECT * FROM bucketname WHERE $1 in interests LIMIT 1'), + ['African Swallows'], + function(err, rows) { + console.log("Got rows: %j", rows); + }); + }); }); -}); \ No newline at end of file +}); + +// Ensure bucket.upsert is composable with normal callbacks +function composable(callback: (err?: Error) => void) { + bucket.upsert('key', {value: 1}, callback); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/n1ql-queries-with-sdk.html +function n1ql_a() { + const n1qlquery = N1qlQuery.fromString('SELECT name, email FROM users WHERE name=$1'); + bucket.query(n1qlquery, ['Monty Python'], function(err, rows) { + // ... + }); +} + +function n1ql_b() { + const q = N1qlQuery.fromString('SELECT * FROM `travel-sample` LIMIT 10'); + const req = bucket.query(q); + req.on('row', function(row) { + console.log('Got a row'); + }); + req.on('error', function(err) { + console.error('Got error %j', err); + }); + req.on('end', function(meta) { + console.log('All rows received. Metadata is %j:', meta); + }); +} + +function n1ql_c() { + // Insert a document with a random x value + bucket.upsert('test-doc', {x: Math.round(Math.random()*10000000)}, function(err, res) { + if (err) { + throw err; + } + + var qs = 'SELECT t.*, TOSTRING(META().cas) AS `_cas` FROM `travel-sample` t WHERE META().id="test-doc"'; + var q = couchbase.N1qlQuery.fromString(qs); + q.consistency(couchbase.N1qlQuery.Consistency.REQUEST_PLUS); + bucket.query(q, function(err, rows) { + if (err) { + throw err; + } + + if (rows.length !== 1) { + throw new Error('unexpected number of rows'); + } + + console.log('Query Result:', rows[0]); + + var cas = rows[0]._cas; + var doc = rows[0]; + delete(doc._cas); + doc.y = doc.x; + + bucket.replace('test-doc', doc, {cas: cas}, function(err) { + if (err) { + throw err; + } + + bucket.get('test-doc', function(err, res) { + if (err) { + throw err; + } + + console.log('Updated:', res.value); + + process.exit(0); + }); + }); + }); + }); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/full-text-searching-with-sdk.html +const SearchQuery = couchbase.SearchQuery; +const SearchFacet = couchbase.SearchFacet; + +function search_a() { + let searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office')); + bucket.query(searchQuery, function(err, res, meta) { + for (var i = 0; i < res.length; ++i) { + console.log('Hit:', res[i].id); + } + }); +} + +function search_b() { + const searchQuery = SearchQuery.new('travel-search', SearchQuery.term('office')); + searchQuery.addFacet('countries', SearchFacet.term('country', 5)); + bucket.query(searchQuery, function(err, res, meta) { + console.log('Total Countries:', meta.facets['countries'].total); + }); +} + +// From https://developer.couchbase.com/documentation/server/5.1/sdk/nodejs/view-queries-with-sdk.html +const ViewQuery = couchbase.ViewQuery; + +function view_a() { + var query = ViewQuery.from('beer', 'by_name').skip(6).limit(3); + bucket.query(query, function(err, results) { + for(let i in results) + console.log(results[i]); + }); +} + +function view_b() { + var SpatialQuery = couchbase.SpatialQuery; + + var query = SpatialQuery.from('spatial', 'by_location').limit(10); + bucket.query(query, function(err, results) { + for(let i in results) + console.log(results[i]); + }); +} + +// From https://developer.couchbase.com/documentation/server/current/sdk/nodejs/sample-app-backend.html +function userSearch(location: string | undefined, description: string | undefined) { + var qp = couchbase.SearchQuery.conjuncts(couchbase.SearchQuery.term('hotel').field('type')); + if (location && location !== '*') { + qp.and(couchbase.SearchQuery.disjuncts( + couchbase.SearchQuery.matchPhrase(location).field("country"), + couchbase.SearchQuery.matchPhrase(location).field("city"), + couchbase.SearchQuery.matchPhrase(location).field("state"), + couchbase.SearchQuery.matchPhrase(location).field("address") + )); + } + + if (description && description !== '*') { + qp.and( + couchbase.SearchQuery.disjuncts( + couchbase.SearchQuery.matchPhrase(description).field("description"), + couchbase.SearchQuery.matchPhrase(description).field("name") + )); + } +} diff --git a/types/couchbase/index.d.ts b/types/couchbase/index.d.ts index eb945af458..813ee8f110 100644 --- a/types/couchbase/index.d.ts +++ b/types/couchbase/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Couchbase Node.js SDK 2.1.2 +// Type definitions for Couchbase Node.js SDK 2.4.5 // Project: https://github.com/couchbase/couchnode // Definitions by: Marwan Aouida +// Brian Crowell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -144,10 +145,75 @@ declare enum errors { restError } +/** + * Virtual base for authenticators. + */ +declare interface Authenticator { + username: string; + password: string; +} + +/** + * Authenticator for using classic authentication. + */ +declare class ClassicAuthenticator implements Authenticator { + /** + * Create a new instance of the ClassicAuthenticator class. + * @param buckets Map of bucket names to passwords. + * @param username Cluster administration username. + * @param password Cluster administration password. + */ + constructor(buckets: {[key: string]: string}, username: string, password: string); + + username: string; + password: string; +} + +/** + * Authenticator for using role-based authentication. + */ +declare class PasswordAuthenticator implements Authenticator { + /** + * Create a new instance of the PasswordAuthenticator class. + * @param username RBAC username. + * @param password RBAC password. + */ + constructor(username: string, password: string); + + username: string; + password: string; +} + +/** + * Authenticator for performing certificate-based authentication. + */ +declare class CertAuthenticator implements Authenticator { + /** + * Create a new instance of the CertAuthenticator class. + */ + constructor(); + + username: string; + password: string; +} + /** * Represents a singular cluster containing your buckets. */ declare class Cluster { + /** + * Authenticate to the cluster using role-based authentication. + * @param username RBAC username. + * @param password RBAC password. + */ + authenticate(username: string, password: string): void; + + /** + * Authenticate to the cluster using a specific authentication type. + * @param auther + */ + authenticate(auther: Authenticator): void; + /** * Create a new instance of the Cluster class. * @param cnstr The connection string for your cluster. @@ -255,7 +321,17 @@ interface CouchbaseError extends Error { /** * The error code for this error. */ - code: errors; + code?: errors; + + /** + * Possible response body included with the error. + */ + responseBody?: any; + + /** + * Possible inner error for this error. + */ + innerError?: CouchbaseError; } interface AppendOptions { @@ -352,10 +428,198 @@ interface InsertOptions { replicate_to?: number; } +interface CreateIndexOptions { + /** + * If a secondary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface CreatePrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If a primary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface DropIndexOptions { + /** + * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown. + */ + ignoreIfNotExists?: boolean; +} + +interface DropPrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If true, attempting to drop on a bucket without the specified index won't cause an error to be thrown. + */ + ignoreIfNotExists?: boolean; +} + +interface CreatePrimaryIndexOptions { + /** + * The custom name for the primary index. + */ + name?: string; + + /** + * If a primary index already exists, an error will be thrown unless this is set to true. + */ + ignoreIfExists?: boolean; + + /** + * True to defer building of the index until buildDeferredIndexes is called (or a direct call to the corresponding query service API). + */ + deferred?: boolean; +} + +interface IndexInfo { + /** + * ID for the index. + */ + id: string; + + /** + * Name for the index. + */ + name: string; + + /** + * List of index keys. + */ + index_key: string[]; + + /** + * True if this is a primary index. + */ + is_primary: boolean; + + /** + * ID for the keyspace to which the index belongs. + */ + keyspace_id: string; + + /** + * ID for the namespace to which the index belongs. + */ + namespace_id: string; + + /** + * ID for the datastore to which the index belongs. + */ + store_id: string; + + /** + * The current state of the index. + * + * Values include `online` and `pending`. + */ + state: string; + + /** + * The type of view, which will always be `gsi`. + */ + using: 'gsi'; +} + +interface WatchIndexesOptions { + /** + * Timeout for the operation in milliseconds. + */ + timeout?: number; +} + /** * A class for performing management operations against a bucket. This class should not be instantiated directly, but instead through the use of the Bucket#manager method instead. */ interface BucketManager { + /** + * Builds any indexes that were previously created with the deferred attribute. + * @param callback The callback function. + */ + buildDeferredIndexes(callback: (err: CouchbaseError | null, deferredIndexes: string[]) => void): void; + + /** + * Creates a non-primary GSI index with an optional name. + * @param indexName The name of the index. + * @param fields The JSON fields to index. + * @param options + * @param callback The callback function. + */ + createIndex(indexName: string, fields: string[], callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a non-primary GSI index with an optional name. + * @param indexName The name of the index. + * @param fields The JSON fields to index. + * @param options + * @param callback The callback function. + */ + createIndex(indexName: string, fields: string[], options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a primary GSI index with an optional name. + * @param options + * @param callback The callback function. + */ + createPrimaryIndex(callback: (err: CouchbaseError | null) => void): void; + + /** + * Creates a primary GSI index with an optional name. + * @param options + * @param callback The callback function. + */ + createPrimaryIndex(options: CreateIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a specific GSI index by name. + * @param indexName The name of the index. + * @param options + * @param callback The callback function. + */ + dropIndex(indexName: string, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a specific GSI index by name. + * @param indexName The name of the index. + * @param options + * @param callback The callback function. + */ + dropIndex(indexName: string, options: DropIndexOptions, callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a primary GSI index. + * @param options + * @param callback The callback function. + */ + dropPrimaryIndex(callback: (err: CouchbaseError | null) => void): void; + + /** + * Drops a primary GSI index. + * @param options + * @param callback The callback function. + */ + dropPrimaryIndex(options: DropPrimaryIndexOptions, callback: (err: CouchbaseError | null) => void): void; /** * Flushes the cluster, deleting all data stored within this bucket. Note that this method requires the Flush permission to be enabled on the bucket from the management console before it will work. @@ -376,6 +640,12 @@ interface BucketManager { */ getDesignDocuments(callback: Function): void; + /** + * Retrieves a list of the indexes currently configured on the cluster. + * @param callback The callback function. + */ + getIndexes(callback: (err: CouchbaseError | null, indexes: IndexInfo[] | null) => void): void; + /** * Registers a design document to this bucket, failing if it already exists. * @param name @@ -401,6 +671,21 @@ interface BucketManager { * @returns {} */ upsertDesignDocument(name: string, data: any, callback: Function): void; + + /** + * Watches a list of indexes, waiting for them to become available for use. + * @param watchList List of indexes to watch. + * @param callback The callback function. + */ + watchIndexes(watchList: string[], callback: (err: Error | null) => void): void; + + /** + * Watches a list of indexes, waiting for them to become available for use. + * @param watchList List of indexes to watch. + * @param options + * @param callback The callback function. + */ + watchIndexes(watchList: string[], options: WatchIndexesOptions, callback: (err: Error | null) => void): void; } /** @@ -571,6 +856,9 @@ declare namespace ViewQuery { * Class for dynamically construction of N1QL queries. This class should never be constructed directly, instead you should use the N1qlQuery.fromString static method to instantiate a N1qlStringQuery. */ declare class N1qlQuery { + // Private declaration to avoid other queries being misstaken for N1qlQuery + private __nominal: void; + /** * Creates a query object directly from the passed query string. * @param str @@ -703,10 +991,654 @@ declare namespace SpatialQuery { } } +declare abstract class SearchQuery { + /** + * Creates a new search query from an index name and search query definition. + * @param indexName The FTS index to search in. + * @param query The body of the FTS query. + */ + static new(indexName: string, query: SearchQuery.Query): SearchQuery; + + /** + * Creates a compound BooleanQuery composed of several other query objects. + */ + static boolean(): SearchQuery.BooleanQuery; + + /** + * Creates a BooleanFieldQuery for searching boolean fields in an index. + */ + static booleanField(val: boolean): SearchQuery.BooleanFieldQuery; + + /** + * Creates a query for matches all of a list of subqueries in an index. + */ + static conjuncts(queries: ReadonlyArray): SearchQuery.ConjunctionQuery; + + /** + * Creates a query for matches all of a list of subqueries in an index. + */ + static conjuncts(...queries: SearchQuery.Query[]): SearchQuery.ConjunctionQuery; + + /** + * Creates a search query for matching date ranges in an index. + */ + static dateRange(): SearchQuery.DateRangeQuery; + + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + static disjuncts(queries: ReadonlyArray): SearchQuery.DisjunctionQuery; + + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + static disjuncts(...queries: SearchQuery.Query[]): SearchQuery.DisjunctionQuery; + + /** + * Creates a query which allows you to match a list of document IDs in an index. + */ + static docIds(ids: ReadonlyArray): SearchQuery.DocIdQuery; + + /** + * Creates a query which allows you to match a list of document IDs in an index. + */ + static docIds(...ids: string[]): SearchQuery.DocIdQuery; + + /** + * Creates a geographical bounding-box based query. + * @param tl_lat Top-left latitude. + * @param tl_lon Top-left longitude. + * @param br_lat Bottom-right latitude. + * @param br_lon Bottom-right longitude. + */ + static geoBoundingBoxQuery(tl_lat: number, tl_lon: number, br_lat: number, br_lon: number): SearchQuery.GeoBoundingBoxQuery; + + /** + * Creates a geographical distance based query. + */ + static geoDistanceQuery(): SearchQuery.GeoDistanceQuery; + + /** + * Creates a search query for matching text. + */ + static match(match: string): SearchQuery.MatchQuery; + + /** + * Creates a search query which matches anything. + */ + static matchAll(): SearchQuery.MatchAllQuery; + + /** + * Creates a search query which matches nothing. + */ + static matchNone(): SearchQuery.MatchAllQuery; + + /** + * Creates a search query for matching phrases in an index. + */ + static matchPhrase(phrase: string): SearchQuery.MatchPhraseQuery; + + /** + * Creates a search query for matching numeric ranges in an index. + */ + static numericRange(): SearchQuery.NumericRangeQuery; + + /** + * Creates a search query for a prefix in an index. + */ + static phrase(terms: ReadonlyArray): SearchQuery.PhraseQuery; + + /** + * Creates a search query for a prefix in an index. + */ + static prefix(prefix: string): SearchQuery.PrefixQuery; + /** + * Creates a query for matches any of a list of subqueries in an index. + */ + + /** + * Creates a search query for matching string. + */ + static queryString(query: string): SearchQuery.QueryStringQuery; + + /** + * Creates a search query for matching against a regexp query in an index. + */ + static regexp(regexp: string): SearchQuery.RegexpQuery; + + /** + * Creates a search query for searching terms in an index. + */ + static term(term: string): SearchQuery.TermQuery; + + /** + * Creates a search query for matching term ranges in the index. + */ + static termRange(): SearchQuery.TermRangeQuery; + + /** + * Creates a search query for matching a string with wildcards in an index. + */ + static wildcard(wildcard: string): SearchQuery.WildcardQuery; + + /** + * Adds a SearchFacet object to return information about as part of the execution of this query. + */ + addFacet(name: string, facet: SearchFacet): this; + + /** + * Specify the consistency level for this query. + */ + consistency(val: SearchQuery.Consistency): this; + + /** + * Includes information about the internal search semantics used to execute your query. + */ + explain(explain: boolean): this; + + /** + * Specifies the fields you wish to receive in the result set. + */ + fields(fields: ReadonlyArray): this; + + /** + * Specifies the fields you wish to receive in the result set. + */ + fields(...fields: string[]): this; + + /** + * Request a particular highlight style and field list for this query. + */ + highlight(style: SearchQuery.HighlightStyle, fields: ReadonlyArray): this; + + /** + * Request a particular highlight style and field list for this query. + */ + highlight(style: SearchQuery.HighlightStyle, ...fields: string[]): this; + + /** + * Specifies the maximum number of results to return. + * @param limit Maximum number of results to return. + */ + limit(limit: number): this; + + /** + * Specifies how many results to skip from the beginning of the result set. + * @param skip How many results to skip from the beginning of the result set. + */ + skip(skip: number): this; + + /** + * Specifies the fields you wish to sort by in your result set. + */ + sort(fields: ReadonlyArray): this; + + /** + * Specifies the fields you wish to sort by in your result set. + */ + sort(...fields: (string | SearchSort)[]): this; + + /** + * Specifies the maximum time to wait for this query to complete. + * @param timeout Maximum time to wait (in milliseconds) for this query to complete. + */ + timeout(timeout: number): this; +} + +declare namespace SearchQuery { + abstract class Query { + } + + abstract class BooleanQuery extends Query { + /** + * Specifies a predicate query which must match. + * @param query + */ + must(query: Query): this; + + /** + * Specifies a predicate query which must not match. + * @param query + */ + mustNot(query: Query): this; + + /** + * Specifies a predicate query which should match. + * @param query + */ + should(query: Query): this; + + /** + * Specifies the minimum score for should predicate matches. + * @param shouldMin + */ + shouldMin(shouldMin: number): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class BooleanFieldQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param boost The field to query. + */ + field(field: string): this; + } + + abstract class ConjunctionQuery extends Query { + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + and(queries: ReadonlyArray): this; + + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + and(...queries: SearchQuery.Query[]): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class DateRangeQuery extends Query { + /** + * Defines the lower bound of the date range query. + * @param start The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + start(start: Date | string, inclusive?: boolean): this; + + /** + * Defines the upper bound of the date range query. + * @param end The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + end(end: Date | string, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class DisjunctionQuery extends Query { + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + or(queries: ReadonlyArray): this; + + /** + * Specifies additional predicate queries. + * @param queries Additional predicate queries. + */ + or(...queries: SearchQuery.Query[]): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class DocIdQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class GeoBoundingBoxQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class GeoDistanceQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class MatchAllQuery extends Query { + } + + abstract class MatchNoneQuery extends Query { + } + + abstract class MatchPhraseQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Specifies the analyzer to use for the query. + * @param analyzer Analyzer to use for the query. + */ + analyzer(analyzer: string): this; + } + + abstract class MatchQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Defines the level of fuzziness for the query. + * @param fuzziness Level of fuzziness for the query. + */ + fuzziness(fuzziness: number): this; + + /** + * Specifies the prefix length to consider for the query. + * @param prefixLength Prefix length to consider for the query. + */ + prefixLength(prefixLength: number): this; + + /** + * Specifies the analyzer to use for the query. + * @param analyzer Analyzer to use for the query. + */ + analyzer(analyzer: string): this; + } + + abstract class NumericRangeQuery extends Query { + /** + * Defines the lower bound of the numeric range query. + * @param min The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + min(min: number, inclusive?: boolean): this; + + /** + * Defines the upper bound of the numeric range query. + * @param max The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + max(max: number, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class PhraseQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class PrefixQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class QueryStringQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + } + + abstract class RegexpQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class TermQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + + /** + * Defines the level of fuzziness for the query. + * @param fuzziness Level of fuzziness for the query. + */ + fuzziness(fuzziness: number): this; + + /** + * Specifies the prefix length to consider for the query. + * @param prefixLength Prefix length to consider for the query. + */ + prefixLength(prefixLength: number): this; + } + + abstract class TermRangeQuery extends Query { + /** + * Defines the lower bound of the term range query. + * @param min The lower bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to true. + */ + min(min: string, inclusive?: boolean): this; + + /** + * Defines the upper bound of the term range query. + * @param max The upper bound of the query. + * @param inclusive True to set an inclusive bound. Defaults to false. + */ + max(max: string, inclusive?: boolean): this; + + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param field The field to query. + */ + field(field: string): this; + } + + abstract class WildcardQuery extends Query { + /** + * Defines the amount to boost the query. + * @param boost Amount to boost the query. + */ + boost(boost: number): this; + + /** + * Specifies the field to query. + * @param boost The field to query. + */ + field(field: string): this; + } + + /** + * Enumeration for specifying FTS consistency semantics. + */ + enum Consistency { + /** + * This is the default (for single-statement requests). + */ + NOT_BOUNDED, + } + + /** + * Enumeration for specifying FTS highlight styling. + */ + enum HighlightStyle { + /** + * This causes hits to be highlighted using the default style. + */ + DEFAULT, + + /** + * This causes hits to be highlighted using HTML tags. + */ + HTML, + + /** + * This causes hits to be highlighted with ANSI character codes. + */ + ANSI, + } +} + +declare class SearchFacet { +} + +declare namespace SearchFacet { + class TermFacet extends SearchFacet { + } + + function term(field: string, size: number): TermFacet; + + class NumericFacet extends SearchFacet { + addRange(name: string, min: number, max: number): this; + } + + function numeric(field: string, size: number): NumericFacet; + + class DateFacet extends SearchFacet { + addRange(name: string, start: string, end: string): this; + } + + function date(field: string, size: number): DateFacet; +} + +declare class SearchSort { + /** + * Specifies whether to sort descending or not. + */ + descending(descending: boolean): this; +} + +declare namespace SearchSort { + class ScoreSort extends SearchSort { + } + + function score(): ScoreSort; + + class IdSort extends SearchSort { + } + + function id(): IdSort; + + class FieldSort extends SearchSort { + type(type: string): this; + mode(mode: string): this; + missing(missing: string): this; + } + + function field(field: string): FieldSort; + + class GeoDistanceSort extends SearchSort { + unit(unit: string): this; + } + + function geoDistance(field: string, lat: number, lon: number): GeoDistanceSort; +} + /** * The Bucket class represents a connection to a Couchbase bucket. Never instantiate this class directly. Instead use the Cluster#openBucket method instead. */ -interface Bucket { +interface Bucket extends events.EventEmitter { /** * Returns the version of the Node.js library as a string. */ @@ -763,7 +1695,7 @@ interface Bucket { * @param fragment The document's contents to append. * @param callback The callback function. */ - append(key: any | Buffer, fragment: any, callback: Bucket.OpCallback): void; + append(key: string | Buffer, fragment: any, callback: Bucket.OpCallback): void; /** * @@ -772,7 +1704,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - append(key: any | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; + append(key: string | Buffer, fragment: any, options: AppendOptions, callback: Bucket.OpCallback): void; /** * Increments or decrements a key's numeric value. @@ -781,7 +1713,7 @@ interface Bucket { * @param delta The amount to add or subtract from the counter value. This value may be any non-zero integer. * @param callback The callback function. */ - counter(key: any | Buffer, delta: number, callback: Bucket.OpCallback): void; + counter(key: string | Buffer, delta: number, callback: Bucket.OpCallback): void; /** * @@ -790,7 +1722,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - counter(key: any | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; + counter(key: string | Buffer, delta: number, options: CounterOptions, callback: Bucket.OpCallback): void; /** * Shuts down this connection. @@ -808,14 +1740,14 @@ interface Bucket { * @param key The target document key. * @param callback The callback function. */ - get(key: any | Buffer, callback: Bucket.OpCallback): void; + get(key: string | Buffer, callback: Bucket.OpCallback): void; /** * @param key The target document key. * @param options The options object. * @param callback The callback function. */ - get(key: any | Buffer, options: any, callback: Bucket.OpCallback): void; + get(key: string | Buffer, options: any, callback: Bucket.OpCallback): void; /** * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. @@ -824,7 +1756,7 @@ interface Bucket { * @param key The target document key. * @param callback The callback function. */ - getAndLock(key: any, callback: Bucket.OpCallback): void; + getAndLock(key: string, callback: Bucket.OpCallback): void; /** * Lock the document on the server and retrieve it. When an document is locked, its CAS changes and subsequent operations on the document (without providing the current CAS) will fail until the lock is no longer held. @@ -835,7 +1767,7 @@ interface Bucket { * @param callback The callback function. * @returns {} */ - getAndLock(key: any, options: GetAndLockOptions, callback: Bucket.OpCallback): void; + getAndLock(key: string, options: GetAndLockOptions, callback: Bucket.OpCallback): void; /** * Retrieves a document and updates the expiry of the item at the same time. @@ -844,7 +1776,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - getAndTouch(key: any | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; + getAndTouch(key: string | Buffer, expiry: number, options: any, callback: Bucket.OpCallback): void; /** * Retrieves a document and updates the expiry of the item at the same time. @@ -852,21 +1784,21 @@ interface Bucket { * @param expiry The expiration time to use. If a value of 0 is provided, then the current expiration time is cleared and the key is set to never expire. Otherwise, the key is updated to expire in the time provided (in seconds). * @param callback The callback function. */ - getAndTouch(key: any | Buffer, expiry: number, callback: Bucket.OpCallback): void; + getAndTouch(key: string | Buffer, expiry: number, callback: Bucket.OpCallback): void; /** * Retrieves a list of keys * @param keys The target document keys. * @param callback The callback function. */ - getMulti(key: any[] | Buffer[], callback: Bucket.MultiGetCallback): void; + getMulti(key: ReadonlyArray, callback: Bucket.MultiGetCallback): void; /** * Get a document from a replica server in your cluster. * @param key The target document key. * @param callback The callback function. */ - getReplica(key: any | Buffer, callback: Bucket.OpCallback): void; + getReplica(key: string | Buffer, callback: Bucket.OpCallback): void; /** * Get a document from a replica server in your cluster. @@ -874,7 +1806,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - getReplica(key: any | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; + getReplica(key: string | Buffer, options: GetReplicaOptions, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert but will fail if the document already exists. @@ -882,7 +1814,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - insert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + insert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert but will fail if the document already exists. @@ -891,7 +1823,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - insert(key: any | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; + insert(key: string | Buffer, value: any, options: InsertOptions, callback: Bucket.OpCallback): void; /** * Returns an instance of a BuckerManager for performing management operations against a bucket. @@ -904,7 +1836,7 @@ interface Bucket { * @param fragment The document's contents to prepend. * @param callback The callback function. */ - prepend(key: any, fragment: any, callback: Bucket.OpCallback): void; + prepend(key: string, fragment: any, callback: Bucket.OpCallback): void; /** * Like Bucket#append, but prepends data to the existing value. @@ -913,31 +1845,43 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - prepend(key: any, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; + prepend(key: string, fragment: any, options: PrependOptions, callback: Bucket.OpCallback): void; /** - * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. - * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * Executes a previously prepared query object. * @param query The query to execute. * @param callback The callback function. */ - query(query: ViewQuery | N1qlQuery, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; + query(query: ViewQuery | SpatialQuery, callback?: Bucket.QueryCallback): Bucket.ViewQueryResponse; /** - * Executes a previously prepared query object. This could be a ViewQuery or a N1qlQuery. - * Note: N1qlQuery queries are currently an uncommitted interface and may be subject to change in 2.0.0's final release. + * Executes a previously prepared query object. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: N1qlQuery, callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse; + + /** + * Executes a previously prepared query object. + * @param query The query to execute. + * @param callback The callback function. + */ + query(query: SearchQuery, callback?: Bucket.FtsQueryCallback): Bucket.FtsQueryResponse; + + /** + * Executes a previously prepared query object. * @param query The query to execute. * @param params A list or map to do replacements on a N1QL query. * @param callback The callback function. */ - query(query: ViewQuery | N1qlQuery, params: Object | Array, callback: Bucket.QueryCallback): Bucket.ViewQueryResponse | Bucket.N1qlQueryResponse; + query(query: N1qlQuery, params: {[param: string]: any} | any[], callback?: Bucket.N1qlQueryCallback): Bucket.N1qlQueryResponse; /** * Deletes a document on the server. * @param key The target document key. * @param callback The callback function. */ - remove(key: any | Buffer, callback: Bucket.OpCallback): void; + remove(key: string | Buffer, callback: Bucket.OpCallback): void; /** * Deletes a document on the server. @@ -945,7 +1889,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - remove(key: any | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; + remove(key: string | Buffer, options: RemoveOptions, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). @@ -953,7 +1897,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - replace(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + replace(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Identical to Bucket#upsert, but will only succeed if the document exists already (i.e. the inverse of Bucket#insert). @@ -962,7 +1906,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - replace(key: any | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; + replace(key: string | Buffer, value: any, options: ReplaceOptions, callback: Bucket.OpCallback): void; /** * Configures a custom set of transcoder functions for encoding and decoding values that are being stored or retreived from the server. @@ -978,7 +1922,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - touch(key: any | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; + touch(key: string | Buffer, expiry: number, options: TouchOptions, callback: Bucket.OpCallback): void; /** * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. @@ -986,7 +1930,7 @@ interface Bucket { * @param cas The CAS value returned when the key was locked. This operation will fail if the CAS value provided does not match that which was the result of the original lock operation. * @param callback The callback function. */ - unlock(key: any | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; + unlock(key: string | Buffer, cas: Bucket.CAS, callback: Bucket.OpCallback): void; /** * Unlock a previously locked document on the server. See the Bucket#lock method for more details on locking. @@ -995,7 +1939,7 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - unlock(key: any | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; + unlock(key: string | Buffer, cas: Bucket.CAS, options: any, callback: Bucket.OpCallback): void; /** * Stores a document to the bucket. @@ -1003,7 +1947,7 @@ interface Bucket { * @param value The document's contents. * @param callback The callback function. */ - upsert(key: any | Buffer, value: any, callback: Bucket.OpCallback): void; + upsert(key: string | Buffer, value: any, callback: Bucket.OpCallback): void; /** * Stores a document to the bucket. @@ -1012,13 +1956,28 @@ interface Bucket { * @param options The options object. * @param callback The callback function. */ - upsert(key: any | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; + upsert(key: string | Buffer, value: any, options: UpsertOptions, callback: Bucket.OpCallback): void; + + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; } declare namespace Bucket { /** - * his is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. */ interface QueryCallback { /** @@ -1026,7 +1985,31 @@ declare namespace Bucket { * @param rows The rows returned from the query. * @param meta The metadata returned by the query. */ - (error: CouchbaseError, rows: any[], meta: Bucket.ViewQueryResponse.Meta): void; + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.ViewQueryResponse.Meta): void; + } + + /** + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface N1qlQueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.N1qlQueryResponse.Meta): void; + } + + /** + * This is used as a callback from executed queries. It is a shortcut method that automatically subscribes to the rows and error events of the Bucket.ViewQueryResponse. + */ + interface FtsQueryCallback { + /** + * @param error The error for the operation. This can either be an Error object or a falsy value. + * @param rows The rows returned from the query. + * @param meta The metadata returned by the query. + */ + (error: CouchbaseError | null, rows: any[] | null, meta: Bucket.FtsQueryResponse.Meta): void; } /** @@ -1036,10 +2019,10 @@ declare namespace Bucket { */ interface OpCallback { /** - * @param error The error for the operation. This can either be an Error object or a value which evaluates to false (null, undefined, 0 or false). + * @param error The error for the operation. This can either be an Error object or a value which evaluates to false. * @param result The result of the operation that was executed. This usually contains at least a cas property, and on some operations will contain a value property as well. */ - (error: CouchbaseError | number, result: any): void; + (error: CouchbaseError | null, result: any): void; } /** @@ -1081,7 +2064,7 @@ declare namespace Bucket { /** * The CAS value is a special object that indicates the current state of the item on the server. Each time an object is mutated on the server, the value is changed. CAS objects can be used in conjunction with mutation operations to ensure that the value on the server matches the local value retrieved by the client. This is useful when doing document updates on the server as you can ensure no changes were applied by other clients while you were in the process of mutating the document locally. - * In the Node.js SDK, the CAS is represented as an opaque value. As such,y ou cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. + * In the Node.js SDK, the CAS is represented as an opaque value. As such, you cannot generate CAS objects, but should rather use the values returned from a Bucket.OpCallback. */ interface CAS { @@ -1091,7 +2074,30 @@ declare namespace Bucket { * An event emitter allowing you to bind to various query result set events. */ interface N1qlQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: N1qlQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: N1qlQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: N1qlQueryResponse.Meta) => void): this; } namespace N1qlQueryResponse { @@ -1118,7 +2124,30 @@ declare namespace Bucket { * An event emitter allowing you to bind to various query result set events. */ interface ViewQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + on(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: ViewQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: ViewQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: ViewQueryResponse.Meta) => void): this; } namespace ViewQueryResponse { @@ -1132,4 +2161,73 @@ declare namespace Bucket { total_rows: number; } } + + /** + * An event emitter allowing you to bind to various query result set events. + */ + interface FtsQueryResponse extends events.EventEmitter { + addListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + addListener(event: 'error', listener: (error: CouchbaseError) => void): this; + addListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + addListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + on(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + on(event: 'error', listener: (error: CouchbaseError) => void): this; + on(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + on(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + once(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + once(event: 'error', listener: (error: CouchbaseError) => void): this; + once(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + once(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + prependListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + prependListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + prependListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + + prependOnceListener(event: 'end', listener: (meta: FtsQueryResponse.Meta) => void): this; + prependOnceListener(event: 'error', listener: (error: CouchbaseError) => void): this; + prependOnceListener(event: 'row', listener: (row: any, meta: FtsQueryResponse.Meta) => void): this; + prependOnceListener(event: 'rows', listener: (rows: any[], meta: FtsQueryResponse.Meta) => void): this; + } + + namespace FtsQueryResponse { + /** + * The meta-information available from a search query response. + */ + interface Meta { + /** + * The status information for this query, includes properties + * such as total, failed, and successful. + */ + status: any; + + /** + * Any non-fatal errors that occurred during query processing. + */ + errors: any; + + /** + * The total number of hits that were available for this search query. + */ + totalHits: number; + + /** + * The resulting facet information for any facets that were specified + * in the search query. + */ + facets: any; + + /** + * The time spent processing this query. + */ + took: number; + + /** + * The maximum score out of all the results in this query. + */ + maxScore: number; + } + } } diff --git a/types/cqrs-domain/index.d.ts b/types/cqrs-domain/index.d.ts index f826b45ffd..33db11b857 100644 --- a/types/cqrs-domain/index.d.ts +++ b/types/cqrs-domain/index.d.ts @@ -252,7 +252,7 @@ declare namespace Domain { /** * @param data is the command data - * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) + * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) */ type preLoadConditionHandler = (data: any, callback?: (err: string | Error) => string | Error) => void | string | Error; @@ -295,7 +295,7 @@ declare namespace Domain { /** * @param data is the command data * @param aggregate is the aggregate object - * @callback callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) + * @param callback is optional, if not defined as function argument you can throw errors or return errors here (sync way) */ type preConditionHandler = (data: any, aggregate: AggregateModel, callback?: (err: string | Error) => string | Error) => void | string | Error; diff --git a/types/create-react-class/index.d.ts b/types/create-react-class/index.d.ts index 9a1b0b12b5..9b9d2b2ad5 100644 --- a/types/create-react-class/index.d.ts +++ b/types/create-react-class/index.d.ts @@ -2,7 +2,7 @@ // Project: https://facebook.github.io/react/ // Definitions by: John Gozde // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ComponentSpec, ClassicComponentClass } from "react"; diff --git a/types/create-subscription/index.d.ts b/types/create-subscription/index.d.ts index 79003980ee..8c7d8c1ced 100644 --- a/types/create-subscription/index.d.ts +++ b/types/create-subscription/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Asana // Vincent Siao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index 22e5c1253c..faeeac78e6 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -9,11 +9,15 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - interface Base {} + interface Base { + create(): any; + } interface BufferedBlockAlgorithm extends Base {} - interface Hasher extends BufferedBlockAlgorithm {} + interface Hasher extends BufferedBlockAlgorithm { + update(messageUpdate: WordArray|string): Hasher; + } interface Cipher extends BufferedBlockAlgorithm { createEncryptor(secretPassphrase: string, option?: CipherOption): Encryptor; @@ -25,7 +29,7 @@ declare namespace CryptoJS { interface StreamCipher extends Cipher {} interface CipherHelper { - encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; + encrypt(message: string | LibWordArray, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; } interface Encryptor { @@ -141,6 +145,7 @@ declare namespace CryptoJS { lib: { WordArray: { create: (v: any) => LibWordArray; + random: (v: number) => string; }; }; mode: { diff --git a/types/crypto-random-string/crypto-random-string-tests.ts b/types/crypto-random-string/crypto-random-string-tests.ts new file mode 100644 index 0000000000..1a66c25981 --- /dev/null +++ b/types/crypto-random-string/crypto-random-string-tests.ts @@ -0,0 +1,4 @@ +import generate = require('crypto-random-string'); + +// $ExpectType string +generate(10); diff --git a/types/crypto-random-string/index.d.ts b/types/crypto-random-string/index.d.ts new file mode 100644 index 0000000000..dc41e18428 --- /dev/null +++ b/types/crypto-random-string/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for crypto-random-string 1.0 +// Project: https://github.com/sindresorhus/crypto-random-string +// Definitions by: Manuel Warum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Generate a hexadecimal string of the given length. + * @param length the length of the random string. + * @return a string of the specified length. + */ +declare function cryptoRandomString(length: number): string; + +export = cryptoRandomString; diff --git a/types/crypto-random-string/tsconfig.json b/types/crypto-random-string/tsconfig.json new file mode 100644 index 0000000000..fd68e9d080 --- /dev/null +++ b/types/crypto-random-string/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "crypto-random-string-tests.ts" + ] +} diff --git a/types/crypto-random-string/tslint.json b/types/crypto-random-string/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/crypto-random-string/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/css-to-style/css-to-style-tests.ts b/types/css-to-style/css-to-style-tests.ts new file mode 100644 index 0000000000..ede5ae8f06 --- /dev/null +++ b/types/css-to-style/css-to-style-tests.ts @@ -0,0 +1,9 @@ +import toStyle from "css-to-style"; + +toStyle(); // $ExpectError + +toStyle({}); // $ExpectError + +toStyle(1); // $ExpectError + +toStyle(''); // $ExpectType CSSStyleDeclaration diff --git a/types/css-to-style/index.d.ts b/types/css-to-style/index.d.ts new file mode 100644 index 0000000000..eb450341f9 --- /dev/null +++ b/types/css-to-style/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for css-to-style 1.2 +// Project: https://github.com/jacobbuck/css-to-style +// Definitions by: Ben Grynhaus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare function toStyle(cssText: string): CSSStyleDeclaration; + +export default toStyle; diff --git a/types/css-to-style/tsconfig.json b/types/css-to-style/tsconfig.json new file mode 100644 index 0000000000..8b3a9292b3 --- /dev/null +++ b/types/css-to-style/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es5", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "css-to-style-tests.ts"] +} diff --git a/types/css-to-style/tslint.json b/types/css-to-style/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/css-to-style/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cssnano/cssnano-tests.ts b/types/cssnano/cssnano-tests.ts new file mode 100644 index 0000000000..17828e1b02 --- /dev/null +++ b/types/cssnano/cssnano-tests.ts @@ -0,0 +1,17 @@ +import cssnano = require('cssnano'); +import { Transformer } from 'postcss'; + +const nano1: Transformer = cssnano(); +const nano2: Transformer = cssnano({ + configFile: '/path/to/config', +}); +const nano3: Transformer = cssnano({ + preset: 'default', +}); +const nano4: Transformer = cssnano({ + preset: ['default', { + discardComments: { + removeAll: true, + }, + }], +}); diff --git a/types/cssnano/index.d.ts b/types/cssnano/index.d.ts new file mode 100644 index 0000000000..bf298f1854 --- /dev/null +++ b/types/cssnano/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for cssnano 4.0 +// Project: https://github.com/cssnano/cssnano +// Definitions by: Armando Meziat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { Plugin } from 'postcss'; + +declare namespace cssnano { + interface CssNanoOptions { + configFile?: string; + preset?: [string, object] | string; + } + + type CssNano = Plugin; +} + +declare const cssnano: cssnano.CssNano; +export = cssnano; diff --git a/types/cssnano/package.json b/types/cssnano/package.json new file mode 100644 index 0000000000..3c7b1f0f76 --- /dev/null +++ b/types/cssnano/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "postcss": "5 - 7" + } +} diff --git a/types/cssnano/tsconfig.json b/types/cssnano/tsconfig.json new file mode 100644 index 0000000000..5667012b67 --- /dev/null +++ b/types/cssnano/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cssnano-tests.ts" + ] +} diff --git a/types/cssnano/tslint.json b/types/cssnano/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cssnano/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/csso/csso-tests.ts b/types/csso/csso-tests.ts new file mode 100644 index 0000000000..74e0b51dd9 --- /dev/null +++ b/types/csso/csso-tests.ts @@ -0,0 +1,40 @@ +import csso = require('csso'); + +csso.minify('.test { color: #ff0000; }').css; +csso.minify('.test { color: #ff0000; }').map; +csso.minify('.test { color: #ff0000; }', { + sourceMap: true, + filename: '', + debug: true, + beforeCompress: () => {}, + afterCompress: () => {}, + restructure: false, + forceMediaMerge: true, + clone: false, + comments: '', + logger: () => {} +}); + +csso.minifyBlock('color: rgba(255, 0, 0, 1); color: #ff0000').css; +csso.minifyBlock('color: rgba(255, 0, 0, 1); color: #ff0000').map; +csso.minifyBlock('color: rgba(255, 0, 0, 1); color: #ff0000', { + sourceMap: true, + filename: '', + debug: true, + beforeCompress: () => {}, + afterCompress: () => {}, + restructure: false, + forceMediaMerge: true, + clone: false, + comments: '', + logger: () => {} +}); + +csso.compress({}).ast; +csso.compress({}, { + restructure: false, + forceMediaMerge: true, + clone: false, + comments: '', + logger: () => {} +}).ast; diff --git a/types/csso/index.d.ts b/types/csso/index.d.ts new file mode 100644 index 0000000000..f89f395129 --- /dev/null +++ b/types/csso/index.d.ts @@ -0,0 +1,107 @@ +// Type definitions for csso 3.5 +// Project: https://github.com/css/csso +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +declare namespace csso { + interface Result { + /** + * Resulting CSS. + */ + css: string; + /** + * Instance of SourceMapGenerator or null. + */ + map: object | null; + } + + interface CompressOptions { + /** + * Disable or enable a structure optimisations. + * @default true + */ + restructure?: boolean; + /** + * Enables merging of @media rules with the same media query by splitted by other rules. + * The optimisation is unsafe in general, but should work fine in most cases. Use it on your own risk. + * @default false + */ + forceMediaMerge?: boolean; + /** + * Transform a copy of input AST if true. Useful in case of AST reuse. + * @default false + */ + clone?: boolean; + /** + * Specify what comments to leave: + * - 'exclamation' or true – leave all exclamation comments + * - 'first-exclamation' – remove every comment except first one + * - false – remove all comments + * @default true + */ + comments?: string | boolean; + /** + * Usage data for advanced optimisations. + */ + usage?: object; + /** + * Function to track every step of transformation. + */ + logger?: () => void; + } + + interface MinifyOptions { + /** + * Generate a source map when true. + * @default false + */ + sourceMap?: boolean; + /** + * Filename of input CSS, uses for source map generation. + * @default '' + */ + filename?: string; + /** + * Output debug information to stderr. + * @default false + */ + debug?: boolean; + /** + * Called right after parse is run. + */ + beforeCompress?: BeforeCompressFn | BeforeCompressFn[]; + /** + * Called right after compress() is run. + */ + afterCompress?: AfterCompressFn | AfterCompressFn[]; + restructure?: boolean; + } + + type BeforeCompressFn = (ast: object, options: CompressOptions) => void; + type AfterCompressFn = (compressResult: string, options: CompressOptions) => void; +} + +interface Csso { + /** + * Minify source CSS passed as String + * @param source + * @param options + */ + minify(source: string, options?: csso.MinifyOptions & csso.CompressOptions): csso.Result; + + /** + * The same as minify() but for list of declarations. Usually it's a style attribute value. + * @param source + * @param options + */ + minifyBlock(source: string, options?: csso.MinifyOptions & csso.CompressOptions): csso.Result; + + /** + * Does the main task – compress an AST. + */ + compress(ast: object, options?: csso.CompressOptions): { ast: object }; +} + +declare const csso: Csso; +export = csso; diff --git a/types/csso/tsconfig.json b/types/csso/tsconfig.json new file mode 100644 index 0000000000..9ed6695bc9 --- /dev/null +++ b/types/csso/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "csso-tests.ts" + ] +} diff --git a/types/csso/tslint.json b/types/csso/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/csso/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts index 25d6151259..0cffa42b31 100644 --- a/types/cytoscape/cytoscape-tests.ts +++ b/types/cytoscape/cytoscape-tests.ts @@ -1,6 +1,20 @@ 'use strict'; -import cytoscape = require('cytoscape'); +// TODO: document all aliases as aliases, not as duplicates! + +const assert = (tag: boolean) => {}; +const aliases = (...obj: Array<{}>) => {}; + +// definitions +function oneOf(a: A, b: B, c: C, d: D, e: E): A | B | C | D | E; +function oneOf(a: A, b: B, c: C, d: D): A | B | C | D; +function oneOf(a: A, b: B, c: C): A | B | C; +function oneOf(a: A, b: B): A | B; +function oneOf(...array: T[]): T { + return array[0]; +} + +import cytoscape = require('cytoscape'); const parentCSS = { 'padding-top': '10px', 'padding-left': '10px', @@ -69,6 +83,34 @@ const cy = cytoscape({ ] }, + // initial viewport state: + zoom: 1, + pan: { x: 0, y: 0 }, + + // interaction options: + minZoom: 1e-50, + maxZoom: 1e50, + zoomingEnabled: true, + userZoomingEnabled: true, + panningEnabled: true, + userPanningEnabled: true, + selectionType: 'single', + touchTapThreshold: 8, + desktopTapThreshold: 4, + autolock: false, + autoungrabify: false, + + // rendering options: + headless: false, + styleEnabled: true, + hideEdgesOnViewport: false, + hideLabelsOnViewport: false, + textureOnViewport: false, + motionBlur: false, + motionBlurOpacity: 0.2, + wheelSensitivity: 1, + pixelRatio: 'auto', + layout: { name: 'preset', padding: 5 @@ -80,6 +122,42 @@ cy.on('zoom', (event) => { cy.nodes('$node > node').style('opacity', 0); } }); +cy.off('zoom'); +// events(cy); - TODO + +cy.add({ data: { id: 'g' }, position: {x: 200, y: 150} }); +cy.add([ + { data: { id: 'h' }, position: {x: 250, y: 100} } +]); +const nodesBeforeDelete = cy.nodes(); +const edgesBeforeDelete = cy.edges(); + +const removed = cy.remove('#g #h'); +cy.add(removed); +const diffNodes = nodesBeforeDelete.diff(cy.nodes()); +const diffEdges = edgesBeforeDelete.diff(cy.edges()); +assert(diffNodes.left.size() === 0 && diffNodes.right.size() === 0 && diffNodes.both.size() === cy.nodes().size()); +assert(nodesBeforeDelete.same(cy.nodes())); +assert(edgesBeforeDelete.same(cy.edges())); + +const gh = cy.collection().add(cy.$id('g')).union(cy.getElementById('h')); +const gh2 = cy.$('#g #h'); +const gh3 = cy.nodes('#g #h'); +assert(gh2.same(gh)); +assert(gh3.same(gh)); +assert(gh.same(removed)); + +assert(cy.container() === null); // headless mode! + +cy.center(); +cy.center(gh); +aliases(cy.center, cy.centre); + +cy.fit(cy.$('#a #b #h')); + +const {x1, y1, x2, y2, w, h} = cy.extent(); + +aliases(cy.resize, cy.invalidateDimensions); cy.animate({ fit: { @@ -89,8 +167,404 @@ cy.animate({ duration: 500 }); -const node = cy.nodes()[0]; cy.animate({ - center: {eles: node}, + center: {eles: cy.nodes()[0]}, duration: 500 }); + +const anim = cy.animation({ + zoom: { + level: 1, + position: {x: 0, y: 0} + }, + pan: {x: 100, y: 100}, + duration: 100, + easing: 'ease' +}); +cy.stop(true, true); +anim.play(); +assert(anim.playing()); +anim.progress(anim.progress() + 50); +anim.time(anim.time() - 50); +anim.stop(); + +aliases(cy.layout, cy.createLayout, cy.makeLayout); + +// Preconfigured data for layouts (as it could be passed) +const boundingBox = oneOf({x1: 0, x2: 100, y1: 0, y2: 100}, {x1: 0, w: 100, y1: 0, h: 100}); +const positions = oneOf({a: {x: 100, y: 100}}, (node: cytoscape.NodeCollection): cytoscape.Position => ({x: 100, y: 100})); + +// TODO: uncomment after we have the way to add layout options properties from extensions +// const layouts = [ +// cy.layout({ +// name: 'null', +// ready: () => {}, +// stop: () => {} +// }), +// cy.layout({ +// name: 'random', +// fit: true, +// padding: 30, +// boundingBox, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-in', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'preset', +// positions, +// zoom: 1, +// pan: {x: 100, y: 100}, +// fit: false, +// padding: 30, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-out', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'grid', +// fit: true, +// padding: 30, +// boundingBox, +// avoidOverlap: true, +// avoidOverlapPadding: 10, +// nodeDimensionsIncludeLabels: false, +// spacingFactor: oneOf(1, undefined), +// condense: false, +// rows: oneOf(10, undefined), +// cols: oneOf(10, undefined), +// position: (node) => ({ row: 1, col: 1 }), +// sort: (a, b) => 1, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-in-out', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'circle', +// fit: true, +// padding: 30, +// boundingBox, +// avoidOverlap: true, +// nodeDimensionsIncludeLabels: false, +// spacingFactor: oneOf(1, undefined), +// radius: oneOf(1, undefined), +// startAngle: 3 / 2 * Math.PI, +// sweep: oneOf(6, undefined), +// clockwise: true, +// sort: (a, b) => 1, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-in-sine', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'concentric', +// fit: true, +// padding: 30, +// startAngle: 3 / 2 * Math.PI, +// sweep: oneOf(6, undefined), +// clockwise: true, +// equidistant: false, +// minNodeSpacing: 10, +// boundingBox, +// avoidOverlap: true, +// nodeDimensionsIncludeLabels: false, +// height: oneOf(500, undefined), +// width: oneOf(500, undefined), +// spacingFactor: oneOf(1, undefined), +// concentric: (node) => 1, +// levelWidth: (nodes) => 1, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-out-sine', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'breadthfirst', +// fit: true, +// directed: false, +// padding: 30, +// circle: false, +// spacingFactor: 1.75, +// boundingBox, +// avoidOverlap: true, +// nodeDimensionsIncludeLabels: false, +// maximalAdjustments: 0, +// animate: false, +// animationDuration: 500, +// animationEasing: 'ease-in-out-sine', +// animateFilter: (node, i) => true, +// transform: (node, position) => position +// }), +// cy.layout({ +// name: 'cose', +// ready: () => {}, +// stop: () => {}, +// animate: oneOf(true, false, 'end'), +// animationEasing: oneOf('ease-in-quad', undefined), +// animationDuration: oneOf(500, undefined), +// animateFilter: function ( node, i ){ return true; }, +// animationThreshold: 250, +// refresh: 20, +// fit: true, +// padding: 30, +// boundingBox: undefined, +// nodeDimensionsIncludeLabels: false, +// randomize: false, +// componentSpacing: 40, +// nodeRepulsion: (node) => 2048, +// nodeOverlap: 4, +// idealEdgeLength: (edge) => 32, +// edgeElasticity: (edge) => 32, +// nestingFactor: 1.2, +// gravity: 1, +// numIter: 1000, +// initialTemp: 1000, +// coolingFactor: 0.99, +// minTemp: 1.0, +// weaver: false +// }) +// ]; +// const lay = layouts[0]; +// aliases(lay.run, lay.start); +// events(lay); +// layouts.map(layout => { +// layout.run(); +// layout.stop(); +// }); + +cy.style(cy.style()); +cy.style([cy.style()]); + +// $ExpectType string +cy.png({ + output: oneOf('base64uri', 'base64', undefined), + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100 +}); +// $ExpectType Blob +cy.png({ + output: 'blob', + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100 +}); + +aliases(cy.jpg, cy.jpeg); +// $ExpectType string +cy.jpg({ + output: oneOf('base64uri', 'base64', undefined), + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100, + quality: 0.5 +}); +// $ExpectType Blob +cy.jpg({ + output: 'blob', + bg: oneOf('#ffffff', undefined), + full: true, + scale: 2, + maxWidth: 100, + maxHeight: 100, + quality: 0.5 +}); + +cy.json(cy.json()); + +// Types possible to call methods +const ele = oneOf(cy.nodes()[0], cy.edges()[0]); +const eles = cy.elements(); +const node = cy.nodes()[0]; +const nodes = cy.nodes(); +const edge = cy.edges()[0]; +const edges = cy.edges(); + +assert(ele.cy() === cy); +eles.remove(); +assert(eles.removed()); +assert(!eles.inside()); +eles.restore(); + +([ele, eles, node, nodes, edge, edges] as [ + cytoscape.SingularElementReturnValue, + cytoscape.CollectionReturnValue, + cytoscape.NodeSingular, + cytoscape.NodeCollection, + cytoscape.EdgeSingular, + cytoscape.EdgeCollection +]).forEach((elemType) => { + aliases(elemType.clone, elemType.copy); + // events(elemType); - TODO + aliases(elemType.removeData, elemType.removeAttr); +}); +([ele, node, edge] as [ + cytoscape.SingularElementReturnValue, + cytoscape.NodeSingular, + cytoscape.EdgeSingular +]).forEach((elemType) => { + aliases(elemType.data, elemType.attr); +}); +// TODO: tests for data flow + +const loops = oneOf(true, false); +node.degree(loops); node.indegree(loops); node.outdegree(loops); +nodes.totalDegree(loops); nodes.minDegree(loops); nodes.maxDegree(loops); +nodes.minIndegree(loops); nodes.maxIndegree(loops); nodes.minOutdegree(loops); nodes.maxOutdegree(loops); + +// tslint:disable-next-line:ban-types +const getsetPos = (func: T): T => { + func('x', func('x')); + func(func()); + func({x: 100, y: 100}); + return func; +}; + +aliases(node.modelPosition, node.point, node.position); +getsetPos(node.position); + +nodes.shift('x', 100); +nodes.shift({x: -100, y: 0}); + +aliases(nodes.modelPositions, nodes.positions, nodes.points); +nodes.positions((node, i) => Object.assign(node.position(), {x: node.position('x') + i})); + +aliases(node.renderedPosition, node.renderedPoint); +getsetPos(node.renderedPoint); + +// TODO: tests for compound nodes (relativePosition, in particular) + +const sizes: number[] = [ + ele.width(), ele.outerWidth(), ele.renderedWidth(), ele.renderedOuterWidth(), + ele.height(), ele.outerHeight(), ele.renderedHeight(), ele.renderedOuterHeight() +]; + +aliases(eles.boundingBox, eles.boundingbox); +aliases(eles.renderedBoundingBox, eles.renderedBoundingbox); + +const flags: boolean[] = [ + node.grabbed(), node.grabbable(), node.locked(), ele.active(), +]; +nodes.lock(); node.lock(); +nodes.unlock(); node.unlock(); + +const edgePoints: cytoscape.Position[] = [ + ...edge.controlPoints(), ...edge.segmentPoints(), edge.sourceEndpoint(), edge.targetEndpoint(), edge.midpoint() +]; + +aliases(eles.layout, eles.createLayout, eles.makeLayout); +const layout = eles.layout({name: 'random'}).run(); + +layout.on('layoutstop', () => { + cy.fit(); +}); +layout.on('layoutstop', {}, (obj) => { + console.log(obj); +}); + +eles.select(); +assert(ele.selected()); // as we selected all, and this too +aliases(eles.unselect, eles.deselect); +eles.selectify(); +assert(ele.selectable()); +eles.unselectify(); + +eles.addClass('test'); +eles.toggleClass('test', oneOf(true, false, undefined)); +eles.removeClass('test'); +eles.classes(oneOf('test', undefined)); +eles.flashClass('test flash', oneOf(1000, undefined)); +assert(ele.hasClass('test')); + +eles.style('background-color', 'green'); +Object.keys(eles.style()).map(key => eles.style(key)); +eles.style(eles.style()); +aliases(eles.style, eles.css); +aliases(ele.renderedCss, ele.renderedStyle); + +nodes.forEach((child) => { + child.animate({ + position: node.position(), + duration: 300, + complete: () => { + console.log(child.id()); + } + }); +}); + +nodes.animate({ + renderedPosition: node.position() +}, { + style: { backgroundColor: 'red' }, + duration: 1000, + queue: true, + complete: () => console.log('end'), + step: () => console.log('step'), + easing: 'ease-in-out-quint' +}); + +eles.anySame(nodes); +aliases(eles.contains, eles.has); +aliases(eles.allAreNeighbors, eles.allAreNeighbours); +eles.is('#g'); +eles.allAre('#g'); +eles.some((el, i, els) => true); +eles.every((el, i, els) => true); + +aliases(eles.forEach, eles.each); +const selected: cytoscape.SingularElementArgument[] = [eles.eq(0), eles.first(), eles.last()]; +const collSel = cy.collection(selected); +const selectedNodes: cytoscape.NodeSingular[] = [nodes.eq(0), nodes.first(), nodes.last()]; +const collNodes = cy.collection(selectedNodes); +const selectedEdges: cytoscape.EdgeSingular[] = [edges.eq(0), edges.first(), edges.last()]; +eles.slice(0, -1); +eles.toArray(); + +aliases(eles.getElementById, eles.$id); +aliases(eles.union, eles.add, eles.or, eles.u, eles['+'], eles['|']); +aliases(eles.difference, eles.not, eles.subtract, eles.relativeComplement, eles['\\'], eles['!'], eles['-']); +aliases(eles.absoluteComplement, eles.abscomp, eles.complement); +aliases(eles.intersection, eles.intersect, eles.and, eles.n, eles['&'], eles['.']); +aliases(eles.symmetricDifference, eles.symdiff, eles.xor, eles['^'], eles['(+)'], eles['(-)']); +cy.collection([nodes[0]]).union(nodes[1]).union(eles.$id('g')); +eles.difference(collNodes).abscomp().intersection(collSel).symdiff(collNodes); +const diff = collSel.diff(collNodes); +cy.collection().merge(diff.left).merge(diff.right).merge(diff.both).unmerge(collSel).filter((ele, i, eles) => true); + +nodes.map(n => n.degree(false)); +edges.map(e => e.source()); +eles.map(e => e.id()); +eles.map(e => e.isNode() ? e.degree(false) : e.source()); +eles.map(e => e.isEdge() ? e.source() : e.degree(false)); + +eles.sort((a, b) => a.id.length - b.id.length).map((ele, i, eles) => [i, ele]); +eles.reduce((prev, ele, i, eles) => [...prev, [ele, i]], []).concat(['finish']); + +const min = eles.min((ele, i, eles) => ele.isNode() ? ele.degree(false) : ele.source().degree(false)); +min.ele.scratch('min', min.value).scratch('min').value; +const max = eles.max((ele, i, eles) => ele.isEdge() ? ele.source().degree(false) : ele.degree(false)); +max.ele.scratch('max', max.value); + +nodes.min(n => n.degree(false)); +nodes.max(n => n.degree(false)); +edges.max(n => n.source().id().length); +edges.max(n => n.source().id().length); + +// TODO: traversing (need to actively check the nodes/edges distinction) +// TODO: algorithms +// TODO: compound nodes (there aren't any in current test case) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index e85041861a..59482ad507 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Cytoscape.js 3.1 +// Type definitions for Cytoscape.js 3.2 // Project: http://js.cytoscape.org/ // Definitions by: Fabian Schmidt and Fred Eisele // Shenghan Gao @@ -9,7 +9,7 @@ // // Translation from Objects in help to Typescript interface. // http://js.cytoscape.org/#notation/functions -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /** * cy --> Cy.Core @@ -361,7 +361,7 @@ declare namespace cytoscape { * * The default value is 1. */ - pixelRatio?: number; + pixelRatio?: number | 'auto'; } /** @@ -386,35 +386,42 @@ declare namespace cytoscape { /** * Add elements to the graph and return them. */ - add(eles: ElementDefinition | ElementDefinition[] | Collection): CollectionElements; + add(eles: ElementDefinition | ElementDefinition[] | CollectionArgument): CollectionReturnValue; /** * Remove elements in collecion or match the selector from the graph and return them. */ - remove(eles: Collection | Selector): CollectionElements; + remove(eles: CollectionArgument | Selector): CollectionReturnValue; /** * Get a collection from elements in the graph matching the specified selector or from an array of elements. * If no parameter specified, an empty collection will be returned */ - collection(eles?: Selector | CollectionElements[]): CollectionElements; + collection(eles?: Selector | CollectionArgument[]): CollectionReturnValue; /** * Get an element from its ID in a very performant way. + * http://js.cytoscape.org/#cy.getElementById */ - getElementById(id: string): CollectionElements; + getElementById(id: string): CollectionReturnValue; + + /** + * Get an element from its ID in a very performant way. + * http://js.cytoscape.org/#cy.getElementById + */ + $id(id: string): CollectionReturnValue; /** * Get elements in the graph matching the specified selector. * http://js.cytoscape.org/#cy.$ */ - $(selector: Selector): CollectionElements; + $(selector: Selector): CollectionReturnValue; /** * Get elements in the graph matching the specified selector. * http://js.cytoscape.org/#cy.$ */ - elements(selector?: Selector): CollectionElements; + elements(selector?: Selector): CollectionReturnValue; /** * Get nodes in the graph matching the specified selector. @@ -428,7 +435,7 @@ declare namespace cytoscape { /** * Get elements in the graph matching the specified selector or filter function. */ - filter(selector: Selector | ((ele: Singular, i: number, eles: CollectionElements) => boolean)): CollectionElements; + filter(selector: Selector | ((ele: Singular, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue; /** * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. @@ -475,7 +482,8 @@ declare namespace cytoscape { * @param namespace A namespace string. * @param value The value to set at the specified namespace. */ - scratch(namespace?: string, value?: any): Scratchpad; + scratch(namespace?: string): Scratchpad; + scratch(namespace: string, value: any): this; /** * Remove scratchpad data. You should remove scratchpad data only at your own namespaces. @@ -483,7 +491,7 @@ declare namespace cytoscape { * * @param namespace A namespace string. */ - removeScratch(namespace: string): void; + removeScratch(namespace: string): this; } /** @@ -501,25 +509,25 @@ declare namespace cytoscape { * @param eventsMap A map of event names to handler functions. */ - on(events: EventNames, handler: EventHandler): void; - on(events: EventNames, selector: Selector, handler: EventHandler): void; - on(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + on(events: EventNames, handler: EventHandler): this; + on(events: EventNames, selector: Selector, handler: EventHandler): this; + on(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - bind(events: EventNames, handler: EventHandler): void; - bind(events: EventNames, selector: Selector, handler: EventHandler): void; - bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + bind(events: EventNames, handler: EventHandler): this; + bind(events: EventNames, selector: Selector, handler: EventHandler): this; + bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - listen(events: EventNames, handler: EventHandler): void; - listen(events: EventNames, selector: Selector, handler: EventHandler): void; - listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + listen(events: EventNames, handler: EventHandler): this; + listen(events: EventNames, selector: Selector, handler: EventHandler): this; + listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; - addListener(events: EventNames, handler: EventHandler): void; - addListener(events: EventNames, selector: Selector, handler: EventHandler): void; - addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; - addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + addListener(events: EventNames, handler: EventHandler): this; + addListener(events: EventNames, selector: Selector, handler: EventHandler): this; + addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; + addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; /** * Get a promise that is resolved with the first @@ -535,7 +543,7 @@ declare namespace cytoscape { * @param events A space separated list of event names. * @param handler The handler function that is called when one of the specified events occurs. */ - one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -543,7 +551,7 @@ declare namespace cytoscape { * @param handler The handler function that is called when one of the specified events occurs. * @param selector A selector to specify elements for which the handler is triggered. */ - one(events: EventNames, selector: Selector, handler: EventHandler): void; + one(events: EventNames, selector: Selector, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -552,7 +560,7 @@ declare namespace cytoscape { * @param selector A selector to specify elements for which the handler is triggered. * @param data A plain object which is passed to the handler in the event object argument. */ - one(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + one(events: EventNames, selector: Selector, data: any, handler: EventHandler): this; /** * Bind to events that occur in the graph, and trigger the handler only once. * @@ -560,7 +568,7 @@ declare namespace cytoscape { * @param selector A selector to specify elements for which the handler is triggered. * @param data A plain object which is passed to the handler in the event object argument. */ - one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): this; /** * Remove event handlers. @@ -571,17 +579,17 @@ declare namespace cytoscape { * @param handler [optional] A reference to the handler function to remove. * @param eventsMap A map of event names to handler functions to remove. */ - off(events: EventNames, selector?: Selector, handler?: EventHandler): void; - off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + off(events: EventNames, selector?: Selector, handler?: EventHandler): this; + off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - unbind(events: EventNames, selector?: Selector, handler?: EventHandler): void; - unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + unbind(events: EventNames, selector?: Selector, handler?: EventHandler): this; + unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): void; - unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): this; + unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; - removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): void; - removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): this; + removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): this; /** * Trigger one or more events. @@ -589,24 +597,30 @@ declare namespace cytoscape { * @param events A space separated list of event names to trigger. * @param extraParams [optional] An array of additional parameters to pass to the handler. */ - trigger(events: EventNames, extraParams?: any[]): void; - emit(events: EventNames, extraParams?: any[]): void; + trigger(events: EventNames, extraParams?: any[]): this; + emit(events: EventNames, extraParams?: any[]): this; /** * Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately. * @param fn The callback run as soon as the graph is ready, inside which this refers to the core (cy). */ - ready(fn: EventHandler): void; + ready(fn: EventHandler): this; } - interface ZoomOptions { - /** The zoom level to set. */ - level: number; + interface ZoomOptionsModel { /** The position about which to zoom. */ position: Position; + } + interface ZoomOptionsRendered { /** The rendered position about which to zoom. */ renderedPosition: Position; } + interface ZoomOptionsLevel { + /** The zoom level to set. */ + level: number; + } + type ZoomOptions = ZoomOptionsLevel & (ZoomOptionsModel | ZoomOptionsRendered); + /** * http://js.cytoscape.org/#core/viewport-manipulation */ @@ -615,14 +629,21 @@ declare namespace cytoscape { * Get the HTML DOM element in which the graph is visualised. * A null value is returned if the Core is headless. */ - container(): any; + container(): Element | null; /** * Pan the graph to the centre of a collection. * * @param eles The collection to centre upon. */ - center(eles?: Collection): CollectionElements; + center(eles?: CollectionArgument): this; + + /** + * Pan the graph to the centre of a collection. + * + * @param eles The collection to centre upon. + */ + centre(eles?: CollectionArgument): this; /** * Pan and zooms the graph to fit to a collection. @@ -631,13 +652,13 @@ declare namespace cytoscape { * @param eles [optional] The collection to fit to. * @param padding [optional] An amount of padding (in pixels) to have around the graph */ - fit(eles?: Collection, padding?: number): CollectionElements; + fit(eles?: CollectionArgument, padding?: number): this; /** * Reset the graph to the default zoom level and panning position. * http://js.cytoscape.org/#cy.reset */ - reset(): CollectionElements; + reset(): this; /** * Get the panning position of the graph. @@ -651,7 +672,7 @@ declare namespace cytoscape { * * @param renderedPosition The rendered position to pan the graph to. */ - pan(renderedPosition?: Position): void; + pan(renderedPosition?: Position): this; /** * Relatively pan the graph by a specified rendered position vector. @@ -659,7 +680,7 @@ declare namespace cytoscape { * * @param renderedPosition The rendered position vector to pan the graph by. */ - panBy(renderedPosition: Position): void; + panBy(renderedPosition: Position): this; /** * Get whether panning is enabled. @@ -675,7 +696,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables panning; a falsey value disables it. */ - panningEnabled(bool: boolean): void; + panningEnabled(bool: boolean): this; /** * Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. @@ -689,7 +710,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables user panning; a falsey value disables it. */ - userPanningEnabled(bool: boolean): void; + userPanningEnabled(bool: boolean): this; /** * Get the zoom level. * http://js.cytoscape.org/#cy.zoom @@ -702,7 +723,7 @@ declare namespace cytoscape { * @param level The zoom level to set. * @param options The options for zooming. */ - zoom(level?: number | ZoomOptions): void; + zoom(level?: number | ZoomOptions): this; /** * Set or get whether zooming is enabled. Get if no parameter provided. @@ -710,7 +731,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables zooming; a falsey value disables it. */ - zoomingEnabled(bool?: boolean): void; + zoomingEnabled(bool?: boolean): this; /** * Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) @@ -725,7 +746,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables user zooming; a falsey value disables it. */ - userZoomingEnabled(bool?: boolean): void; + userZoomingEnabled(bool?: boolean): this; /** * Get the minimum zoom level. @@ -738,7 +759,7 @@ declare namespace cytoscape { * * @param zoom The new minimum zoom level to use. */ - minZoom(zoom: number): void; + minZoom(zoom: number): this; /** * Get the maximum zoom level. @@ -751,7 +772,7 @@ declare namespace cytoscape { * * @param zoom The new maximum zoom level to use. */ - maxZoom(zoom: number): void; + maxZoom(zoom: number): this; /** * Set the viewport state (pan & zoom) in one call. @@ -760,7 +781,7 @@ declare namespace cytoscape { * @param zoom The zoom level to set. * @param pan The pan to set (a rendered position). */ - viewport(zoom: number, pan: Position): void; + viewport(zoom: number, pan: Position): this; /** * Get whether box selection is enabled. @@ -775,7 +796,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables box selection; a falsey value disables it. */ - boxSelectionEnabled(bool: boolean): void; + boxSelectionEnabled(bool: boolean): this; /** * Get the on-screen width of the viewport in pixels. @@ -812,7 +833,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autolock(bool: boolean): void; + autolock(bool: boolean): this; /** * Get whether nodes are automatically ungrabified @@ -827,7 +848,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autoungrabify(bool: boolean): void; + autoungrabify(bool: boolean): this; /** * Get whether nodes are automatically unselectified @@ -842,7 +863,7 @@ declare namespace cytoscape { * * @param bool A truthy value enables autolocking; a falsey value disables it. */ - autounselectify(bool: boolean): void; + autounselectify(bool: boolean): this; /** * Force the renderer to redraw (i.e. draw a new frame). @@ -852,7 +873,7 @@ declare namespace cytoscape { * but it should not be needed for most developers. * http://js.cytoscape.org/#cy.forceRender */ - forceRender(): void; + forceRender(): this; /** * Force the renderer to recalculate the viewport bounds. @@ -867,7 +888,8 @@ declare namespace cytoscape { * there is no resize or style event for arbitrary DOM elements. * http://js.cytoscape.org/#cy.resize */ - resize(): CollectionElements; + resize(): this; + invalidateDimensions(): this; } /** @@ -875,15 +897,15 @@ declare namespace cytoscape { * */ interface AnimationFitOptions { - eles: CollectionElements | Selector; // to which the viewport will be fitted. + eles: CollectionArgument | Selector; // to which the viewport will be fitted. padding: number; // Padding to use with the fitting. } interface CenterOptions { - eles: CollectionElements | Selector; // to which the viewport will be selected. + eles: CollectionArgument | Selector; // to which the viewport will be selected. } - interface AnimateOptionsCommon { + interface AnimationOptions { /** A zoom level to which the graph will be animated. */ - zoom?: number; + zoom?: ZoomOptions; /** A panning position to which the graph will be animated. */ pan?: Position; /** A relative panning position to which the graph will be animated. */ @@ -892,11 +914,13 @@ declare namespace cytoscape { fit?: AnimationFitOptions; /** An object containing centring options from which the graph will be animated. */ center?: CenterOptions; + /** easing - A transition-timing-function easing style string that shapes the animation progress curve. */ + easing?: Css.TransitionTimingFunction; /** duration - The duration of the animation in milliseconds. */ duration?: number; } - interface AnimateOptions extends AnimateOptionsCommon { + interface AnimateOptions extends AnimationOptions { /** queue - A boolean indicating whether to queue the animation. */ queue?: boolean; /** complete - A function to call when the animation is done. */ @@ -904,14 +928,6 @@ declare namespace cytoscape { /** step - A function to call each time the animation steps. */ step?(): void; } - interface AnimationOptions extends AnimateOptionsCommon { - /** queue - A transition-timing-function easing style string that shapes the animation progress curve. */ - easing?: boolean; - /** complete - A function to call when the animation is done. */ - complete?(): void; - /** step - A function to call each time the animation steps. */ - step?(): void; - } interface CoreAnimation { /** @@ -934,7 +950,7 @@ declare namespace cytoscape { * Get an animation of the viewport. * http://js.cytoscape.org/#cy.animation */ - animation(options: AnimationOptions): any; + animation(options: AnimationOptions): AnimationManipulation; /** * Add a delay between animations for the viewport. @@ -948,7 +964,7 @@ declare namespace cytoscape { * Get a delay animation of the viewport. * http://js.cytoscape.org/#cy.delayAnimation */ - delayAnimation(duration: number): void; + delayAnimation(duration: number): AnimationManipulation; /** * Stop all viewport animations that are currently running. @@ -979,7 +995,7 @@ declare namespace cytoscape { * An analogue to run a layout on a subset of the graph exists as eles.layout(). * http://js.cytoscape.org/#cy.layout */ - layout(layout: LayoutOptions): LayoutManipulation; + layout(layout: LayoutOptions): Layouts; /** * Get a new layout, which can be used to algorithmically * position the nodes in the graph. @@ -992,14 +1008,18 @@ declare namespace cytoscape { * Note that you must call layout.run() in order for it to affect the graph. * An analogue to make a layout on a subset of the graph exists as eles.makeLayout(). */ - makeLayout(options: LayoutOptions): LayoutManipulation; + makeLayout(options: LayoutOptions): Layouts; + createLayout(options: LayoutOptions): Layouts; } /** * Get the entry point to modify the visual style of the graph after initialisation. * http://js.cytoscape.org/#core/style */ - interface ElementStylesheet extends StylesheetStyle { + interface ElementStylesheetStyle extends StylesheetStyle { + json(): any; + } + interface ElementStylesheetCSS extends StylesheetCSS { json(): any; } @@ -1007,11 +1027,11 @@ declare namespace cytoscape { /** * Get the current style object. */ - style(): ElementStylesheet | string; + style(): ElementStylesheetStyle | ElementStylesheetCSS; /** * Assign a new stylesheet to replace the existing one. */ - style(sheet: Stylesheet): Stylesheet; + style(sheet: Stylesheet | Stylesheet[] | string): Stylesheet; } /** @@ -1036,10 +1056,6 @@ declare namespace cytoscape { * http://js.cytoscape.org/#core/export */ interface ExportOptions { - /** - * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. - */ - output?: "base64uri" | "base64" | "blob"; /** * The background colour of the image (transparent by default). */ @@ -1061,6 +1077,18 @@ declare namespace cytoscape { */ maxHeight?: number; } + interface ExportStringOptions extends ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "base64uri" | "base64"; + } + interface ExportBlobOptions extends ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "blob"; + } interface ExportJpgOptions extends ExportOptions { /** @@ -1070,27 +1098,35 @@ declare namespace cytoscape { */ quality?: number; } + interface ExportJpgStringOptions extends ExportJpgOptions, ExportStringOptions { + } + interface ExportJpgBlobOptions extends ExportJpgOptions, ExportBlobOptions { + } interface CoreExport { /** * Export the current graph view as a PNG image in Base64 representation. */ - png(options?: ExportOptions): string; + png(options?: ExportStringOptions): string; + png(options?: ExportBlobOptions): Blob; /** * Export the current graph view as a JPG image in Base64 representation. */ - jpg(options?: ExportOptions): string; + jpg(options?: ExportJpgStringOptions): string; + jpg(options?: ExportJpgBlobOptions): Blob; /** * Export the current graph view as a JPG image in Base64 representation. */ - jpeg(options?: ExportOptions): string; + jpeg(options?: ExportJpgStringOptions): string; + jpeg(options?: ExportJpgBlobOptions): Blob; /** * Export the graph as JSON, the same format used at initialisation. */ - json(): string; + json(): object; + json(json: object): this; } /** @@ -1100,19 +1136,22 @@ declare namespace cytoscape { * The input can be any element (node and edge) collection. * http://js.cytoscape.org/#collection */ - interface Collection extends Singular, + interface Collection + extends CollectionGraphManipulation, CollectionEvents, CollectionData, CollectionPosition, CollectionLayout, CollectionSelection, CollectionStyle, CollectionAnimation, - CollectionComparision, CollectionIteration, - CollectionBuildingUnion, CollectionAlgorithms { } + CollectionComparision, CollectionIteration, + CollectionBuildingFiltering, CollectionAlgorithms { } /** * ele --> Cy.Singular * a collection of a single element (node or edge) + * NB: every singular collection is a general collection too (but not vice versa)! */ - interface Singular extends + interface Singular + extends Collection, SingularGraphManipulation, SingularData, SingularPosition, SingularSelection, SingularStyle, SingularAnimation { } @@ -1127,7 +1166,8 @@ declare namespace cytoscape { /** * The output is a collection of node and edge elements OR single element. */ - type CollectionElements = EdgeCollection | NodeCollection | SingularElement; + type CollectionArgument = Collection | EdgeCollection | NodeCollection | SingularElementArgument; + type CollectionReturnValue = Collection & EdgeCollection & NodeCollection & SingularElementReturnValue; /** * edges -> Cy.EdgeCollection @@ -1135,7 +1175,7 @@ declare namespace cytoscape { * * The output is a collection of edge elements OR single edge. */ - interface EdgeCollection extends Collection, EdgeSingular, + interface EdgeCollection extends Collection, EdgeCollectionTraversing { } /** * nodes -> Cy.NodeCollection @@ -1143,25 +1183,24 @@ declare namespace cytoscape { * * The output is a collection of node elements OR single node. */ - interface NodeCollection extends Collection, NodeSingular, + interface NodeCollection extends Collection, NodeCollectionMetadata, NodeCollectionPosition, NodeCollectionTraversing, NodeCollectionCompound { } - interface SingularElement extends EdgeSingular, NodeSingular { - // Intentionally empty. - } + type SingularElementArgument = EdgeSingular | NodeSingular; + type SingularElementReturnValue = EdgeSingular & NodeSingular; /** * edge --> Cy.EdgeSingular * a collection of a single edge */ - interface EdgeSingular extends Singular, - EdgeSingularData, EdgeSingularTraversing { } + interface EdgeSingular extends Singular, EdgeCollection, + EdgeSingularData, EdgeSingularPoints, EdgeSingularTraversing { } /** * node --> Cy.NodeSingular * a collection of a single node */ - interface NodeSingular extends Singular, + interface NodeSingular extends Singular, NodeCollection, NodeSingularMetadata, NodeSingularPosition, NodeSingularCompound { } /** @@ -1172,24 +1211,24 @@ declare namespace cytoscape { * Remove the elements from the graph. * http://js.cytoscape.org/#eles.remove */ - remove(): CollectionElements; + remove(): CollectionReturnValue; /** * Put removed elements back into the graph. * http://js.cytoscape.org/#eles.restore */ - restore(): CollectionElements; + restore(): CollectionReturnValue; /** * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. * http://js.cytoscape.org/#eles.clone */ - clone(): CollectionElements; + clone(): CollectionReturnValue; /** * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. * http://js.cytoscape.org/#eles.clone */ - copy(): CollectionElements; + copy(): CollectionReturnValue; /** * Effectively move edges to different nodes. The modified (actually new) elements are returned. @@ -1207,6 +1246,10 @@ declare namespace cytoscape { * http://js.cytoscape.org/#collection/graph-manipulation */ interface SingularGraphManipulation { + /** + * Get the core instance that owns the element. + */ + cy(): Core; /** * Get whether the element has been removed from the graph. * http://js.cytoscape.org/#ele.removed @@ -1226,9 +1269,18 @@ declare namespace cytoscape { /** * http://js.cytoscape.org/#eles.on */ - on(events: EventNames, selector: string, data: any, handler: EventHandler): void; - on(events: EventNames, selector: string, handler: EventHandler): void; - on(events: EventNames, handler: EventHandler): void; + on(events: EventNames, selector: string, data: any, handler: EventHandler): this; + on(events: EventNames, selector: string, handler: EventHandler): this; + on(events: EventNames, handler: EventHandler): this; + bind(events: EventNames, selector: string, data: any, handler: EventHandler): this; + bind(events: EventNames, selector: string, handler: EventHandler): this; + bind(events: EventNames, handler: EventHandler): this; + listen(events: EventNames, selector: string, data: any, handler: EventHandler): this; + listen(events: EventNames, selector: string, handler: EventHandler): this; + listen(events: EventNames, handler: EventHandler): this; + addListener(events: EventNames, selector: string, data: any, handler: EventHandler): this; + addListener(events: EventNames, selector: string, handler: EventHandler): this; + addListener(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.promiseOn * alias: pon @@ -1244,25 +1296,29 @@ declare namespace cytoscape { * @param event The event object. * http://js.cytoscape.org/#eles.one */ - one(events: EventNames, selector: string, data: any, handler: EventHandler): void; - one(events: EventNames, selector: string, handler: EventHandler): void; - one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, selector: string, data: any, handler: EventHandler): this; + one(events: EventNames, selector: string, handler: EventHandler): this; + one(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.once */ - once(events: EventNames, selector: string, data: any, handler: EventHandler): void; - once(events: EventNames, selector: string, handler: EventHandler): void; - once(events: EventNames, handler: EventHandler): void; + once(events: EventNames, selector: string, data: any, handler: EventHandler): this; + once(events: EventNames, selector: string, handler: EventHandler): this; + once(events: EventNames, handler: EventHandler): this; /** * http://js.cytoscape.org/#eles.off * alias unbind, unlisten, removeListener */ - off(events: EventNames, selector?: string, handler?: EventHandler): void; + off(events: EventNames, selector?: string, handler?: EventHandler): this; + unbind(events: EventNames, selector?: string, handler?: EventHandler): this; + unlisten(events: EventNames, selector?: string, handler?: EventHandler): this; + removeListener(events: EventNames, selector?: string, handler?: EventHandler): this; /** * http://js.cytoscape.org/#eles.trigger * alias: emit */ - trigger(events: EventNames, extra?: string[]): void; + trigger(events: EventNames, extra?: string[]): this; + emit(events: EventNames, extra?: string[]): this; } /** @@ -1279,8 +1335,8 @@ declare namespace cytoscape { * http://js.cytoscape.org/#eles.removeData * @param names A space-separated list of fields to delete. */ - removeData(names?: string): CollectionElements; - removeAttr(names?: string): CollectionElements; + removeData(names?: string): CollectionReturnValue; + removeAttr(names?: string): CollectionReturnValue; /** * Get an array of the plain JavaScript object @@ -1307,12 +1363,28 @@ declare namespace cytoscape { * @param name The name of the field to set. * @param value The value to set for the field. */ - data(name: string, value: any): void; + data(name: string, value: any): this; /** * Update multiple data fields at once via an object. * @param obj The object containing name- value pairs to update data fields. */ - data(obj: any): void; + data(obj: any): this; + /** + * Get a particular data field for the element. + * @param name The name of the field to get. + */ + attr(name?: string): any; + /** + * Set a particular data field for the element. + * @param name The name of the field to set. + * @param value The value to set for the field. + */ + attr(name: string, value: any): this; + /** + * Update multiple data fields at once via an object. + * @param obj The object containing name- value pairs to update data fields. + */ + attr(obj: any): this; /** * Get or set the scratchpad at a particular namespace, @@ -1324,7 +1396,8 @@ declare namespace cytoscape { * @param namespace A namespace string. * @param value The value to set at the specified namespace. */ - scratch(namespace?: string, value?: any): Scratchpad; + scratch(namespace?: string): Scratchpad; + scratch(namespace: string, value: any): this; /** * Remove scratchpad data. @@ -1332,7 +1405,7 @@ declare namespace cytoscape { * http://js.cytoscape.org/#ele.removeScratch * @param namespace A namespace string. */ - removeScratch(namespace: string): void; + removeScratch(namespace: string): this; /** * A shortcut to get the ID of an element. @@ -1360,13 +1433,13 @@ declare namespace cytoscape { * Get whether the element is a node. * http://js.cytoscape.org/#ele.isNode */ - isNode(): boolean; + isNode(): this is NodeSingular; /** * Get whether the element is an edge. * http://js.cytoscape.org/#ele.isEdge */ - isEdge(): boolean; + isEdge(): this is EdgeSingular; } /** * http://js.cytoscape.org/#collection/data @@ -1461,17 +1534,65 @@ declare namespace cytoscape { * Get the (model) position of a node. */ position(): Position; + /** + * Get the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + position(dimension: PositionDimension): number; /** * Set the value of a specified position dimension. * @param dimension The position dimension to set. * @param value The value to set to the dimension. */ - position(dimension: PositionDimension, value?: Position): void; + position(dimension: PositionDimension, value: number): this; /** * Set the position using name-value pairs in the specified object. * @param pos An object specifying name-value pairs representing dimensions to set. */ - position(pos: Position): void; + position(pos: Position): this; + /** + * Get the (model) position of a node. + */ + modelPosition(): Position; + /** + * Get the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + modelPosition(dimension: PositionDimension): number; + /** + * Set the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + modelPosition(dimension: PositionDimension, value: number): this; + /** + * Set the position using name-value pairs in the specified object. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + modelPosition(pos: Position): this; + /** + * Get the (model) position of a node. + */ + point(): Position; + /** + * Get the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + point(dimension: PositionDimension): number; + /** + * Set the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + point(dimension: PositionDimension, value: number): this; + /** + * Set the position using name-value pairs in the specified object. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + point(pos: Position): this; /** * Get or set the rendered (on-screen) position of a node. @@ -1484,8 +1605,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ renderedPosition(dimension?: PositionDimension): Position; - renderedPosition(dimension: PositionDimension, value: Position): void; - renderedPosition(pos: { [name: string]: number }): void; + renderedPosition(dimension: PositionDimension, value: Position): this; + renderedPosition(pos: { [name: string]: number }): this; /** * Set the value of a specified rendered position dimension. @@ -1494,8 +1615,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ renderedPoint(dimension?: PositionDimension): Position; - renderedPoint(dimension: PositionDimension, value: Position): void; - renderedPoint(pos: { [name: string]: number }): void; + renderedPoint(dimension: PositionDimension, value: Position): this; + renderedPoint(pos: { [name: string]: number }): this; /** * @@ -1508,8 +1629,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ relativePosition(dimension?: PositionDimension): Position; - relativePosition(dimension: PositionDimension, value: Position): void; - relativePosition(pos: { [name: string]: number }): void; + relativePosition(dimension: PositionDimension, value: Position): this; + relativePosition(pos: { [name: string]: number }): this; /** * Get the value of a specified relative position dimension. @@ -1518,8 +1639,8 @@ declare namespace cytoscape { * @param pos An object specifying name-value pairs representing dimensions to set. */ relativePoint(dimension?: PositionDimension): Position; - relativePoint(dimension: PositionDimension, value: Position): void; - relativePoint(pos: { [name: string]: number }): void; + relativePoint(dimension: PositionDimension, value: Position): this; + relativePoint(pos: { [name: string]: number }): this; /** * Get whether a node is currently grabbed, meaning the user has hold of the node. @@ -1542,45 +1663,55 @@ declare namespace cytoscape { * @param ele The element being iterated over for which the function should return a position to set. * @param ix The index of the element when iterating over the elements in the collection. */ - type ElementPositionFunction = (ele: CollectionElements, ix: number) => void; - type ElementCollectionFunction = (ele: CollectionElements, ix: number, eles: CollectionElements) => void; + type ElementPositionFunction = (ele: NodeSingular, ix: number) => Position; + type ElementCollectionFunction = (ele: NodeSingular, ix: number, eles: CollectionArgument) => Position; /** * http://js.cytoscape.org/#collection/position--dimensions */ interface NodeCollectionPosition { + /** + * Shift the positions of the nodes by a given model position vector. + * @param dimension The position dimension to shift. + * @param value The value to shift the dimension. + */ + shift(dimension: PositionDimension, value?: number): this; + /** + * Shift the positions of the nodes by a given model position vector. + * @param pos An object specifying name-value pairs representing dimensions to shift. + */ + shift(pos: Position): this; + /** * Set the positions via a function. * @param handler A callback function that returns the position to set for each element. * @param pos An object specifying name-value pairs representing dimensions to set. * http://js.cytoscape.org/#nodes.positions */ - positions(handler: ElementPositionFunction | Position): void; - - modelPositions(handler: ElementPositionFunction | Position): void; - - points(handler: ElementPositionFunction | Position): void; + positions(handler: ElementPositionFunction | Position): this; + modelPositions(handler: ElementPositionFunction | Position): this; + points(handler: ElementPositionFunction | Position): this; /** * Allow the user to grab the nodes. * http://js.cytoscape.org/#nodes.grabify */ - grabify(): void; + grabify(): this; /** * Disallow the user to grab the nodes. * http://js.cytoscape.org/#nodes.ungrabify */ - ungrabify(): void; + ungrabify(): this; /** * Lock the nodes such that their positions can not be changed. * http://js.cytoscape.org/#nodes.lock */ - lock(): void; + lock(): this; /** * Unlock the nodes such that their positions can be changed. * http://js.cytoscape.org/#nodes.unlock */ - unlock(): void; + unlock(): this; } /** * http://js.cytoscape.org/#collection/position--dimensions @@ -1647,11 +1778,13 @@ declare namespace cytoscape { * http://js.cytoscape.org/#eles.boundingBox */ boundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + boundingbox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; /** * Get the bounding box of the elements in rendered coordinates. * @param options An object containing options for the function. */ renderedBoundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + renderedBoundingbox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; } /** @@ -1668,9 +1801,9 @@ declare namespace cytoscape { * * @param options The layout options. */ - layout(options: LayoutOptions): CollectionElements; - makeLayout(options: LayoutOptions): CoreLayout; - createLayout(options: LayoutOptions): CoreLayout; + layout(options: LayoutOptions): Layouts; + makeLayout(options: LayoutOptions): Layouts; + createLayout(options: LayoutOptions): Layouts; } /** @@ -1683,8 +1816,8 @@ declare namespace cytoscape { animationDuration?: number; // easing of animation, if enabled animationEasing?: number; - // collection of elements involved in the layout; set by cy.layout() or eles.layout() - eles: CollectionElements; + // collection of elements involved in the layout; set by cy.layout() or eles.layout(s) + eles: CollectionArgument; // whether to fit the viewport to the graph fit?: boolean; // padding to leave between graph and viewport @@ -1749,23 +1882,23 @@ declare namespace cytoscape { * Make the elements selected (NB other elements outside the collection are not affected). * http://js.cytoscape.org/#eles.select */ - select(): void; + select(): this; /** * Make the elements not selected (NB other elements outside the collection are not affected). * http://js.cytoscape.org/#eles.unselect */ - unselect(): void; - deselect(): void; + unselect(): this; + deselect(): this; /** * Make the selection states of the elements mutable. * http://js.cytoscape.org/#eles.selectify */ - selectify(): void; + selectify(): this; /** * Make the selection states of the elements immutable. * http://js.cytoscape.org/#eles.unselectify */ - unselectify(): void; + unselectify(): this; } /** @@ -1781,41 +1914,80 @@ declare namespace cytoscape { * http://js.cytoscape.org/#eles.addClass * @param classes A space-separated list of class names to add to the elements. */ - addClass(classes: ClassNames): void; + addClass(classes: ClassNames): this; /** * Remove classes from elements. * @param classes A space-separated list of class names to remove from the elements. * http://js.cytoscape.org/#eles.removeClass */ - removeClass(classes: ClassNames): void; + removeClass(classes: ClassNames): this; /** * Toggle whether the elements have the specified classes. * @param classes A space-separated list of class names to toggle on the elements. * @param toggle [optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. * http://js.cytoscape.org/#eles.toggleClass */ - toggleClass(classes: ClassNames, toggle?: boolean): void; + toggleClass(classes: ClassNames, toggle?: boolean): this; /** * Replace the current list of classes on the elements with the specified list. * @param classes A space-separated list of class names that replaces the current class list. * http://js.cytoscape.org/#eles.classes * Note: can be used to clear all classes (no arguments). */ - classes(classes?: ClassNames): void; + classes(classes?: ClassNames): this; /** * Add classes to the elements, and then remove the classes after a specified duration. * @param classes A space-separated list of class names to flash on the elements. * @param duration [optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. * http://js.cytoscape.org/#eles.flashClass */ - flashClass(classes: ClassNames, duration?: number): void; + flashClass(classes: ClassNames, duration?: number): this; /** - * Get or set a particular style property value. - * @param name The name of the visual style property to get. + * Set a particular style property value. + * @param name The name of the visual style property to set. * @param value The value to which the property is set. */ - style(name?: string, value?: any): any; + style(name: string, value: any): this; + /** + * Get a particular style property value. + * @param name The name of the visual style property to get. + */ + style(name: string): any; + /** + * Set several particular style property values. + * @param obj An object of style property name-value pairs to set. + */ + style(obj: object): this; + /** + * Get a name-value pair object containing visual style properties and their values for the element. + */ + style(): {[index: string]: any}; + /** + * Set a particular style property value. + * @param name The name of the visual style property to set. + * @param value The value to which the property is set. + */ + css(name: string, value: any): this; + /** + * Get a particular style property value. + * @param name The name of the visual style property to get. + */ + css(name: string): any; + /** + * Set several particular style property values. + * @param obj An object of style property name-value pairs to set. + */ + css(obj: object): this; + /** + * Get a name-value pair object containing visual style properties and their values for the element. + */ + css(): {[index: string]: any}; + /** + * Remove all or specific style overrides. + * @param names A space-separated list of property names to remove overrides + */ + removeStyle(names?: string): this; } /** @@ -1894,19 +2066,15 @@ declare namespace cytoscape { /** A function to call each time the animation steps. */ step?(): void; /** A transition-timing-function easing style string that shapes the animation progress curve. */ - easing?(): void; + easing?: Css.TransitionTimingFunction; } - interface ElementAnimateOptionPos { + interface ElementAnimateOptionPos extends ElementAnimateOptionsBase { /** A position to which the elements will be animated. */ - position?: Position; - /** A rendered position to which the elements will be animated. */ - renderedPosition?: Position; + position: Position; } - interface ElementAnimateOptionRen { - /** A position to which the elements will be animated. */ - position?: Position; + interface ElementAnimateOptionRen extends ElementAnimateOptionsBase { /** A rendered position to which the elements will be animated. */ - renderedPosition?: Position; + renderedPosition: Position; } interface CollectionAnimation { /** @@ -1914,28 +2082,28 @@ declare namespace cytoscape { * @param options An object containing the details of the animation. * http://js.cytoscape.org/#eles.animate */ - animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen): void; + animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen, params?: ElementAnimateOptionsBase): this; /** * Add a delay between animations for the elements. * @param duration How long the delay should be in milliseconds. * @param complete A function to call when the delay is complete. * http://js.cytoscape.org/#eles.delay */ - delay(duration: number, complete: () => void): void; + delay(duration: number, complete: () => void): this; /** * Stop all animations that are currently running. * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. * http://js.cytoscape.org/#eles.stop */ - stop(clearQueue: boolean, jumpToEnd: boolean): void; + stop(clearQueue: boolean, jumpToEnd: boolean): this; /** * Remove all queued animations for the elements. * http://js.cytoscape.org/#eles.clearQueue */ - clearQueue(): void; + clearQueue(): this; } - interface SingularAnimationOptions { + interface SingularAnimationOptionsBase { /** A position to which the elements will be animated. */ position: Position; /** A rendered position to which the elements will be animated. */ @@ -1945,7 +2113,15 @@ declare namespace cytoscape { /** The duration of the animation in milliseconds. */ duration: number; /** A transition-timing-function easing style string that shapes the animation progress curve. */ - easing(): void; + easing: Css.TransitionTimingFunction; + } + interface SingularAnimationOptionsPos extends SingularAnimationOptionsBase { + /** A position to which the elements will be animated. */ + position: Position; + } + interface SingularAnimationOptionsRen extends SingularAnimationOptionsBase { + /** A rendered position to which the elements will be animated. */ + renderedPosition: Position; } interface SingularAnimation { /** @@ -1956,14 +2132,14 @@ declare namespace cytoscape { * Get an animation for the element. * @param options An object containing the details of the animation. */ - animation(options: SingularAnimationOptions): void; + animation(options: SingularAnimationOptionsRen | SingularAnimationOptionsPos): AnimationManipulation; /** * Get a delay animation for the element. * @param duration How long the delay should be in milliseconds. * http://js.cytoscape.org/#ele.delayAnimation */ - delayAnimation(duration: number): void; + delayAnimation(duration: number): AnimationManipulation; } /** @@ -1977,27 +2153,36 @@ declare namespace cytoscape { * * @param eles The other elements to compare to. */ - same(eles: Collection): boolean; + same(eles: CollectionArgument): boolean; /** * Determine whether this collection contains any of the same elements as another collection. * * @param eles The other elements to compare to. */ - anySame(eles: Collection): boolean; + anySame(eles: CollectionArgument): boolean; + + /** + * Determine whether this collection contains all of the elements of another collection. + */ + contains(eles: CollectionArgument): boolean; + /** + * Determine whether this collection contains all of the elements of another collection. + */ + has(eles: CollectionArgument): boolean; /** * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. * * @param eles The other elements to compare to. */ - allAreNeighbors(eles: Collection): boolean; + allAreNeighbors(eles: CollectionArgument): boolean; /** * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. * * @param eles The other elements to compare to. */ - allAreNeighbours(eles: Collection): boolean; + allAreNeighbours(eles: CollectionArgument): boolean; /** * Determine whether any element in this collection matches a selector. @@ -2021,7 +2206,7 @@ declare namespace cytoscape { * eles - The collection of elements being tested. * @param thisArg [optional] The value for this within the test function. */ - some(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + some(test: (ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean, thisArg?: any): boolean; /** * Determine whether all elements in this collection satisfy the specified test function. @@ -2032,13 +2217,13 @@ declare namespace cytoscape { * eles - The collection of elements being tested. * @param thisArg [optional] The value for this within the test function. */ - every(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + every(test: (ele: CollectionArgument, i: number, eles: CollectionArgument) => boolean, thisArg?: any): boolean; } /** * http://js.cytoscape.org/#collection/iteration */ - interface CollectionIteration { + interface CollectionIteration { /** * Get the number of elements in the collection. */ @@ -2070,8 +2255,8 @@ declare namespace cytoscape { * eles - The collection of elements being iterated. * @param thisArg [optional] The value for this within the iterating function. */ - each(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; - forEach(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; + each(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): this; + forEach(each: (ele: TIn, i: number, eles: this) => void | boolean, thisArg?: any): this; /** * Get an element at a particular index in the collection. @@ -2080,21 +2265,21 @@ declare namespace cytoscape { * * @param index The index of the element to get. */ - eq(index: number): CollectionElements; + eq(index: number): TOut; /** * Get an element at a particular index in the collection. * * @param index The index of the element to get. */ - [index: number]: CollectionElements; + [index: number]: TOut; /** * Get the first element in the collection. */ - first(): CollectionElements; + first(): TOut; /** * Get the last element in the collection. */ - last(): CollectionElements; + last(): TOut; /** * Get a subset of the elements in the collection based on specified indices. @@ -2106,7 +2291,12 @@ declare namespace cytoscape { * If omitted, all elements from the start position and to the end of the array will be selected. * Use negative numbers to select from the end of an array. */ - slice(start?: number, end?: number): CollectionElements; + slice(start?: number, end?: number): this; + + /** + * Get the collection as an array, maintaining the order of the elements. + */ + toArray(): TOut[]; } /** @@ -2118,7 +2308,7 @@ declare namespace cytoscape { * @param eles The elements or array of elements to add or elements in the graph matching the selector. * http://js.cytoscape.org/#eles.union */ - type CollectionBuildingUnionFunc = (eles: Collection | Collection[] | Selector) => CollectionElements; + type CollectionBuildingUnionFunc = (eles: CollectionArgument | CollectionArgument[] | Selector) => CollectionReturnValue; /** * Get a new collection, resulting from the collection without some specified elements. @@ -2126,7 +2316,7 @@ declare namespace cytoscape { * @param eles The elements that will not be in the resultant collection. * Elements from the calling collection matching this selector will not be in the resultant collection. */ - type CollectionBuildingDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + type CollectionBuildingDifferenceFunc = (eles: CollectionArgument | Selector) => CollectionReturnValue; /** * Get the elements in both this collection and another specified collection. @@ -2135,7 +2325,7 @@ declare namespace cytoscape { * A selector representing the elements to intersect with. * All elements in the graph matching the selector are used as the passed collection. */ - type CollectionBuildingIntersectionFunc = (eles: Collection | Selector) => CollectionElements; + type CollectionBuildingIntersectionFunc = (eles: CollectionArgument | Selector) => CollectionReturnValue; /** * Get the elements that are in the calling collection or the passed collection but not in both. @@ -2144,51 +2334,63 @@ declare namespace cytoscape { * A selector representing the elements to apply the symmetric difference with. * All elements in the graph matching the selector are used as the passed collection. */ - type CollectionSymmetricDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + type CollectionSymmetricDifferenceFunc = (eles: CollectionArgument | Selector) => CollectionReturnValue; /** * http://js.cytoscape.org/#collection/building--filtering */ - interface CollectionBuildingUnion { + interface CollectionBuildingFiltering { + /** + * Get an element in the collection from its ID in a very performant way. + * @param id The ID of the element to get. + */ + getElementById(id: string): TOut; + /** + * Get an element in the collection from its ID in a very performant way. + * @param id The ID of the element to get. + */ + $id(id: string): TOut; + /** * Get a new collection, resulting from adding the collection with another one * http://js.cytoscape.org/#eles.union */ union: CollectionBuildingUnionFunc; - // [index: "u"]: CollectionBuildingUnionFunc; + u: CollectionBuildingUnionFunc; add: CollectionBuildingUnionFunc; - // [index: "+"]: CollectionBuildingUnionFunc; + '+': CollectionBuildingUnionFunc; or: CollectionBuildingUnionFunc; - // [index: "|"]: CollectionBuildingUnionFunc; + '|': CollectionBuildingUnionFunc; /** * Get a new collection, resulting from the collection without some specified elements. * http://js.cytoscape.org/#eles.difference */ difference: CollectionBuildingDifferenceFunc; - // [index: "\\"]: CollectionBuildingDifferenceFunc; + subtract: CollectionBuildingDifferenceFunc; + '\\': CollectionBuildingDifferenceFunc; not: CollectionBuildingDifferenceFunc; - // [index: "!"]: CollectionBuildingDifferenceFunc; + '!': CollectionBuildingDifferenceFunc; relativeComplement: CollectionBuildingDifferenceFunc; - // [index: "-"]: CollectionBuildingDifferenceFunc; + '-': CollectionBuildingDifferenceFunc; /** * Get all elements in the graph that are not in the calling collection. * http://js.cytoscape.org/#eles.absoluteComplement */ - absoluteComplement(): CollectionElements; - abscomp(): CollectionElements; - complement(): CollectionElements; + absoluteComplement(): CollectionReturnValue; + abscomp(): CollectionReturnValue; + complement(): CollectionReturnValue; /** * Get the elements in both this collection and another specified collection. * http://js.cytoscape.org/#eles.intersection */ - intersection: CollectionSymmetricDifferenceFunc; - intersect: CollectionSymmetricDifferenceFunc; - and: CollectionSymmetricDifferenceFunc; - // [index: "n"]: CollectionSymmetricDifferenceFunc; - // [index: "&"]: CollectionSymmetricDifferenceFunc; - // [index: "."]: CollectionSymmetricDifferenceFunc; + intersection: CollectionBuildingIntersectionFunc; + intersect: CollectionBuildingIntersectionFunc; + and: CollectionBuildingIntersectionFunc; + n: CollectionBuildingIntersectionFunc; + '&': CollectionBuildingIntersectionFunc; + '.': CollectionBuildingIntersectionFunc; /** * Get the elements that are in the calling collection @@ -2198,11 +2400,9 @@ declare namespace cytoscape { symmetricDifference: CollectionSymmetricDifferenceFunc; symdiff: CollectionSymmetricDifferenceFunc; xor: CollectionSymmetricDifferenceFunc; - // [index: "^"]: CollectionSymmetricDifferenceFunc; - // [index: "(+)"]: CollectionSymmetricDifferenceFunc; - // [index: "(-)"]: CollectionSymmetricDifferenceFunc; - - // [index: string]: CollectionBuildingDifferenceFunc |CollectionBuildingUnionFunc | CollectionBuildingDifferenceFunc | CollectionSymmetricDifferenceFunc; + '^': CollectionSymmetricDifferenceFunc; + '(+)': CollectionSymmetricDifferenceFunc; + '(-)': CollectionSymmetricDifferenceFunc; /** * Perform a traditional left/right diff on the two collections. @@ -2216,12 +2416,62 @@ declare namespace cytoscape { * both - is the set of elements in both collections. * http://js.cytoscape.org/#eles.diff */ - diff(selector: Selector | Collection): { - left: CollectionElements, - right: CollectionElements, - both: CollectionElements + diff(selector: Selector | CollectionArgument): { + left: CollectionReturnValue, + right: CollectionReturnValue, + both: CollectionReturnValue }; + /** + * Perform a in-place merge of the given elements into the calling collection. + * @param eles The elements to merge in-place or a selector representing the elements to merge. + * All elements in the graph matching the selector are used as the passed collection. + * + * This function modifies the calling collection instead of returning a new one. + * Use of this function should be considered for performance in some cases, but otherwise should be avoided. Consider using eles.union() instead. + * Use this function only on new collections that you create yourself, using cy.collection(). + * This ensures that you do not unintentionally modify another collection. + * + * Examples + * With a collection: + * @example + * var col = cy.collection(); // new, empty collection + * var j = cy.$('#j'); + * var e = cy.$('#e'); + * col.merge( j ).merge( e ); + * + * With a selector: + * @example + * var col = cy.collection(); // new, empty collection + * col.merge('#j').merge('#e'); + */ + merge(eles: CollectionArgument | Selector): this; + /** + * Perform an in-place operation on the calling collection to remove the given elements. + * @param eles The elements to remove in-place or a selector representing the elements to remove . + * All elements in the graph matching the selector are used as the passed collection. + * + * This function modifies the calling collection instead of returning a new one. + * Use of this function should be considered for performance in some cases, but otherwise should be avoided. Consider using eles.filter() or eles.remove() instead. + * Use this function only on new collections that you create yourself, using cy.collection(). + * This ensures that you do not unintentionally modify another collection. + * + * Examples + * With a collection: + * @example + * var col = cy.collection(); // new, empty collection + * var e = cy.$('#e'); + * col.merge( cy.nodes() ); + * col.unmerge( e ); + * + * With a selector: + * @example + * var col = cy.collection(); // new, empty collection + * col.merge( cy.nodes() ); + * col.unmerge('#e'); + */ + unmerge(eles: CollectionArgument | Selector): this; + /** * Get a new collection containing elements that are accepted by the specified filter. * @@ -2231,21 +2481,21 @@ declare namespace cytoscape { * ele - The element being considered. * http://js.cytoscape.org/#eles.filter */ - filter(selector: Selector | ((ele: Singular, i: number, eles: CollectionElements) => boolean)): CollectionElements; + filter(selector: Selector | ((ele: TIn, i: number, eles: CollectionArgument) => boolean)): CollectionReturnValue; /** * Get the nodes that match the specified selector. * * @param selector The selector to match against. * http://js.cytoscape.org/#eles.filter */ - nodes(selector: Selector): NodeCollection; + nodes(selector?: Selector): NodeCollection; /** * Get the edges that match the specified selector. * * @param selector The selector to match against. * http://js.cytoscape.org/#eles.filter */ - edges(selector: Selector): EdgeCollection; + edges(selector?: Selector): EdgeCollection; /** * Get a new collection containing the elements sorted by the @@ -2257,7 +2507,7 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.sort */ - sort(sort: (ele1: CollectionElements, ele2: CollectionElements) => number): CollectionElements; + sort(sort: (ele1: TIn, ele2: TIn) => number): CollectionReturnValue; /** * Get an array containing values mapped from the collection. @@ -2270,7 +2520,7 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.map */ - map(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): any[]; + map(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): T[]; /** * Reduce a single value by applying a @@ -2280,13 +2530,15 @@ declare namespace cytoscape { * given the previous value and the current element. * prevVal The value accumulated from previous elements. * ele The current element. - * ix The index of the current element. + * i The index of the current element. * eles The collection of elements being reduced. - * + * @param initialValue The initial value for reducing + * It is used also for type inference of output, but the type can be + * also stated explicitly as generic * http://js.cytoscape.org/#eles.reduce */ - reduce(fn: (prevVal: any, ele: CollectionElements, - ix: number, eles: CollectionElements) => any): number[]; + reduce(fn: (prevVal: T, ele: TIn, + i: number, eles: CollectionArgument) => T, initialValue: T): T; /** * Find a minimum value in a collection. @@ -2299,15 +2551,15 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.min */ - min(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + min(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): { /** * The minimum value found. */ - value: any, + value: T, /** * The element that corresponds to the minimum value. */ - ele: CollectionElements + ele: SingularElementReturnValue }; /** @@ -2321,15 +2573,15 @@ declare namespace cytoscape { * * http://js.cytoscape.org/#eles.max */ - max(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + max(fn: (ele: TIn, i: number, eles: CollectionArgument) => T, thisArg?: any): { /** - * The maximum value found. + * The minimum value found. */ - value: any, + value: T, /** - * The element that corresponds to the maximum value. + * The element that corresponds to the minimum value. */ - ele: CollectionElements + ele: SingularElementReturnValue }; } @@ -2351,7 +2603,7 @@ declare namespace cytoscape { * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - neighborhood(selector?: Selector): CollectionElements; + neighborhood(selector?: Selector): CollectionReturnValue; /** * Get the open neighbourhood of the elements. @@ -2362,7 +2614,7 @@ declare namespace cytoscape { * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - openNeighborhood(selector?: Selector): CollectionElements; + openNeighborhood(selector?: Selector): CollectionReturnValue; /** * Get the closed neighbourhood of the elements. * @@ -2372,13 +2624,54 @@ declare namespace cytoscape { * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - closedNeighborhood(selector?: Selector): CollectionElements; + closedNeighborhood(selector?: Selector): CollectionReturnValue; /** * Get the connected components, considering only the elements in the calling collection. * An array of collections is returned, with each collection representing a component. */ - components(): Collection; + components(): CollectionReturnValue[]; + } + /** + * http://js.cytoscape.org/#collection/edge-points + */ + interface EdgeSingularPoints { + /** + * Get an array of control point model positions for a {@code curve-style: bezier) or {@code curve-style: unbundled-bezier} edge. + * + * While the control points may be specified relatively in the CSS, + * this function returns the absolute model positions of the control points. + * The points are specified in the order of source-to-target direction. + * This function works for bundled beziers, but it is not applicable to the middle, straight-line edge in the bundle. + */ + controlPoints(): Position[]; + /** + * Get an array of segment point model positions (i.e. bend points) for a {@code curve-style: segments} edge. + * + * While the segment points may be specified relatively in the stylesheet, + * this function returns the absolute model positions of the segment points. + * The points are specified in the order of source-to-target direction. + */ + segmentPoints(): Position[]; + /** + * Get the model position of where the edge ends, towards the source node. + */ + sourceEndpoint(): Position; + /** + * Get the model position of where the edge ends, towards the target node. + */ + targetEndpoint(): Position; + /** + * Get the model position of the midpoint of the edge. + * + * The midpoint is, by default, where the edge’s label is centred. It is also the position towards which mid arrows point. + * For curve-style: unbundled-bezier edges, the midpoint is the middle extremum if the number of control points is odd. + * For an even number of control points, the midpoint is where the two middle-most control points meet. + * This is the middle inflection point for bilaterally symmetric or skew symmetric edges, for example. + * For curve-style: segments edges, the midpoint is the middle segment point if the number of segment points is odd. + * For an even number of segment points, the overall midpoint is the midpoint of the middle-most line segment (i.e. the mean of the middle two segment points). + */ + midpoint(): Position; } interface EdgeSingularTraversing { /** @@ -2386,14 +2679,14 @@ declare namespace cytoscape { * @param selector An optional selector that is used to filter the resultant collection. * http://js.cytoscape.org/#edge.source */ - source(selector?: Selector): NodeCollection; + source(selector?: Selector): NodeSingular; /** * Get target node of this edge. * @param selector An optional selector that is used to filter the resultant collection. * http://js.cytoscape.org/#edge.target */ - target(selector?: Selector): NodeCollection; + target(selector?: Selector): NodeSingular; } interface EdgeCollectionTraversing { // http://js.cytoscape.org/#collection/traversing @@ -2457,7 +2750,7 @@ declare namespace cytoscape { * @param eles The other collection. * @param selector The other collection, specified as a selector which is matched against all elements in the graph. */ - edgesWith(eles: Collection | Selector): EdgeCollection; + edgesWith(eles: CollectionArgument | Selector): EdgeCollection; /** * Get the edges coming from the collection (i.e. the source) going to another collection (i.e. the target). @@ -2465,7 +2758,7 @@ declare namespace cytoscape { * @param eles The other collection. * @param selector The other collection, specified as a selector which is matched against all elements in the graph. */ - edgesTo(eles: Collection | Selector): EdgeCollection; + edgesTo(eles: CollectionArgument | Selector): EdgeCollection; /** * Get the edges connected to the nodes in the collection. @@ -2493,28 +2786,28 @@ declare namespace cytoscape { * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - outgoers(selector?: Selector): EdgeCollection; + outgoers(selector?: Selector): CollectionReturnValue; /** * Recursively get edges (and their targets) coming out of the nodes in the collection (i.e. the outgoers, the outgoers' outgoers, ...). * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - successors(selector?: Selector): EdgeCollection; + successors(selector?: Selector): CollectionReturnValue; /** * Get edges (and their sources) coming into the nodes in the collection. * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - incomers(selector?: Selector): EdgeCollection; + incomers(selector?: Selector): CollectionReturnValue; /** * Recursively get edges (and their sources) coming into the nodes in the collection (i.e. the incomers, the incomers' incomers, ...). * * @param selector [optional] An optional selector that is used to filter the resultant collection. */ - predecessors(selector?: Selector): EdgeCollection; + predecessors(selector?: Selector): CollectionReturnValue; } /** @@ -2526,18 +2819,18 @@ declare namespace cytoscape { /** * The handler returns true when it finds the desired node, and it returns false to cancel the search. - * i - The index indicating this node is the ith visited node. - * depth - How many edge hops away this node is from the root nodes. * v - The current node. * e - The edge connecting the previous node to the current node. * u - The previous node. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. */ - type SearchVisitFunction = (i: number, depth: number, v: NodeCollection, e: EdgeCollection, u: NodeCollection) => boolean; + type SearchVisitFunction = (v: NodeCollection, e: EdgeCollection, u: NodeCollection, i: number, depth: number) => boolean | void; interface SearchFirstOptions { /** * The root nodes (selector or collection) to start the search from. */ - roots: Selector | Collection; + roots: Selector | CollectionArgument; /** * A handler function that is called when a node is visited in the search. */ @@ -2552,7 +2845,7 @@ declare namespace cytoscape { * The path of the search. * - The path returned includes edges such that if path[i] is a node, then path[i - 1] is the edge used to get to that node. */ - path: CollectionElements; + path: CollectionArgument; /** * The node found by the search * - If no node was found, then found is empty. @@ -2568,7 +2861,7 @@ declare namespace cytoscape { /** * The root node (selector or collection) where the algorithm starts. */ - root: Selector | Collection; + root: Selector | CollectionArgument; /** * A function that returns the positive numeric weight for this edge. @@ -2596,14 +2889,14 @@ declare namespace cytoscape { * The path starts with the source node and includes the edges between the nodes in the path such that if pathTo(node)[i] is an edge, * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] is the next node in the path. */ - pathTo(node: NodeSingular): Collection; + pathTo(node: NodeSingular): CollectionReturnValue; } /** * http://js.cytoscape.org/#eles.aStar */ interface SearchAStarOptions { - root: Selector | Collection; - goal: Selector | Collection; + root: Selector | CollectionArgument; + goal: Selector | CollectionArgument; weight?: WeightFn; heuristic?(node: NodeCollection): number; directed?: boolean; @@ -2614,7 +2907,7 @@ declare namespace cytoscape { interface SearchAStarResult { found: boolean; distance: number; - path: Collection; + path: CollectionReturnValue; } /** @@ -2641,7 +2934,7 @@ declare namespace cytoscape { * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] * is the next node in the path. */ - path(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): Collection; + path(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): CollectionReturnValue; } /** @@ -2670,7 +2963,7 @@ declare namespace cytoscape { * function that computes the shortest path from root node to the argument node * (either objects or selector string) */ - pathTo(node: NodeSingular | Selector): Collection; + pathTo(node: NodeSingular | Selector): CollectionReturnValue; /** * function that computes the shortest distance from root node to argument node @@ -2704,7 +2997,7 @@ declare namespace cytoscape { */ interface SearchPageRankResult { /** function that computes the rank of a given node (either object or selector string) */ - rank(node: NodeCollection): void; + rank(node: NodeCollection): number; } /** @@ -2914,7 +3207,7 @@ declare namespace cytoscape { * returning the minimum spanning tree, assuming undirected edges. * http://js.cytoscape.org/#eles.kruskal */ - kruskal(handler: (edge: EdgeCollection) => number): void; + kruskal(handler: (edge: EdgeCollection) => number): CollectionReturnValue; /** * Finds the minimum cut in a graph using the Karger-Stein algorithm. * The optimal result is found with a high probability, but without guarantee. @@ -4368,13 +4661,13 @@ declare namespace cytoscape { * Start running the layout * http://js.cytoscape.org/#layout.run */ - run(): void; - start(): void; + run(): this; + start(): this; /** * Stop running the (asynchronous/discrete) layout * http://js.cytoscape.org/#layout.stop */ - stop(): void; + stop(): this; } interface LayoutEvents { /** @@ -4387,10 +4680,14 @@ declare namespace cytoscape { * @param handler The handler function that is called * when one of the specified events occurs. */ - on(events: EventNames, data: any, handler: EventHandler): void; - bind(events: EventNames, data: any, handler: EventHandler): void; - listen(events: EventNames, data: any, handler: EventHandler): void; - addListener(events: EventNames, data: any, handler: EventHandler): void; + on(events: EventNames, handler: EventHandler): this; + on(events: EventNames, data: any, handler: EventHandler): this; + bind(events: EventNames, handler: EventHandler): this; + bind(events: EventNames, data: any, handler: EventHandler): this; + listen(events: EventNames, handler: EventHandler): this; + listen(events: EventNames, data: any, handler: EventHandler): this; + addListener(events: EventNames, handler: EventHandler): this; + addListener(events: EventNames, data: any, handler: EventHandler): this; /** * Get a promise that is resolved with the first of any of @@ -4406,8 +4703,8 @@ declare namespace cytoscape { * @param data [optional] A plain object which is passed to the handler in the event object argument. * @param handler The handler function that is called when one of the specified events occurs. */ - one(events: EventNames, handler: EventHandler): void; - one(events: EventNames, data: any, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): this; + one(events: EventNames, data: any, handler: EventHandler): this; /** * Remove event handlers on the layout. @@ -4416,10 +4713,10 @@ declare namespace cytoscape { * @param events A space separated list of event names. * @param handler [optional] A reference to the handler function to remove. */ - off(events: EventNames, handler?: EventHandler): void; - unbind(events: EventNames, handler?: EventHandler): void; - unlisten(events: EventNames, handler?: EventHandler): void; - removeListener(events: EventNames, handler?: EventHandler): void; + off(events: EventNames, handler?: EventHandler): this; + unbind(events: EventNames, handler?: EventHandler): this; + unlisten(events: EventNames, handler?: EventHandler): this; + removeListener(events: EventNames, handler?: EventHandler): this; /** * Trigger one or more events on the layout. @@ -4427,7 +4724,7 @@ declare namespace cytoscape { * @param events A space separated list of event names to trigger. * @param extraParams [optional] An array of additional parameters to pass to the handler. */ - trigger(events: EventNames, extraParams?: any[]): void; + trigger(events: EventNames, extraParams?: any[]): this; } /** @@ -4448,7 +4745,7 @@ declare namespace cytoscape { * If the animation is complete, it restarts from the beginning. * http://js.cytoscape.org/#ani.play */ - play(): void; + play(): this; /** * Get whether the animation is currently playing. * http://js.cytoscape.org/#ani.playing diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index 65b1f5c392..16b372993d 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -13,8 +13,10 @@ import * as d3Hierarchy from 'd3-hierarchy'; // ----------------------------------------------------------------------- let num: number; +let numOrUndefined: number | undefined; let size: [number, number]; -let idString: string; +let sizeOrNull: [number, number] | null; +let idString: string | undefined; // ----------------------------------------------------------------------- // Hierarchy @@ -47,16 +49,20 @@ let hierarchyRootDatum: HierarchyDatum = { ] }; -let hierarchyNodeArray: Array>; +let hierarchyNodeArray: Array> = []; +let hierarchyNodeArrayOrUndefined: Array> | undefined; let hierarchyNode: d3Hierarchy.HierarchyNode; -let hierarchyPointNodeArray: Array>; +let hierarchyPointNodeArray: Array> = []; +let hierarchyPointNodeArrayOrUndefined: Array> | undefined; let hierarchyPointNode: d3Hierarchy.HierarchyPointNode; -let hierarchyRectangularNodeArray: Array>; +let hierarchyRectangularNodeArray: Array> = []; +let hierarchyRectangularNodeArrayOrUndefined: Array> | undefined; let hierarchyRectangularNode: d3Hierarchy.HierarchyRectangularNode; -let hierarchyCircularNodeArray: Array>; +let hierarchyCircularNodeArray: Array> = []; +let hierarchyCircularNodeArrayOrUndefined: Array> | undefined; let hierarchyCircularNode: d3Hierarchy.HierarchyCircularNode; // Create Hierarchy Layout Root Node ===================================== @@ -65,6 +71,10 @@ let hierarchyRootNode: d3Hierarchy.HierarchyNode; hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum); +hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { + return d.children; +}); + hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { return d.children || null; }); @@ -79,10 +89,11 @@ num = hierarchyRootNode.height; // children, parent ------------------------------------------------------ -hierarchyNodeArray = hierarchyRootNode.children; +hierarchyNodeArrayOrUndefined = hierarchyRootNode.children; -let parentNode: d3Hierarchy.HierarchyNode; +let parentNode: d3Hierarchy.HierarchyNode | null; parentNode = hierarchyNodeArray.length ? hierarchyNodeArray[0].parent : null; +parentNode = hierarchyNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -93,17 +104,17 @@ idString = hierarchyRootNode.id; const ancestors: Array> = hierarchyRootNode.ancestors(); const descendants: Array> = hierarchyRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyNodeArray = hierarchyRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyNode = descendants[descendants.length - 1]; const path: Array> = hierarchyRootNode.path(hierarchyNode); -// links() and HierarchyLink<...> ------------------------------------------ +// links() and HierarchyLink<...> ---------------------------------------- let links: Array>; @@ -115,26 +126,26 @@ link = links[0]; hierarchyNode = link.source; hierarchyNode = link.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- hierarchyRootNode = hierarchyRootNode.sum((d) => d.val); -num = hierarchyRootNode.value; +numOrUndefined = hierarchyRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- hierarchyRootNode = hierarchyRootNode.count(); -num = hierarchyRootNode.value; +numOrUndefined = hierarchyRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ hierarchyRootNode = hierarchyRootNode.sort((a, b) => { console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- hierarchyRootNode = hierarchyRootNode.each((node) => { console.log('Raw value of node:', node.data.val); // node type is HierarchyNode @@ -151,7 +162,7 @@ hierarchyRootNode = hierarchyRootNode.eachBefore((node) => { console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedHierarchyNode: d3Hierarchy.HierarchyNode; copiedHierarchyNode = hierarchyRootNode.copy(); @@ -161,12 +172,12 @@ copiedHierarchyNode = hierarchyRootNode.copy(); // ----------------------------------------------------------------------- interface HierarchyDatumWithParentId extends HierarchyDatum { - parentId: string; + parentId: string | null; } interface TabularHierarchyDatum { name: string; - parentId: string; + parentId: string | null; val: number; } @@ -178,7 +189,7 @@ tabularData = [ { name: 'n121', parentId: 'n12', val: 30 } ]; -let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: TabularHierarchyDatum[]) => (string | null | '' | undefined); +let idStringAccessor: (d: TabularHierarchyDatum, i: number, data: TabularHierarchyDatum[]) => (string | null | '' | undefined); // Create Stratify Operator --------------------------------------------- @@ -189,6 +200,10 @@ stratificatorizer = d3Hierarchy.stratify(); // id(...) +stratificatorizer = stratificatorizer.id((d) => { + return d.name; // d is of type TabularHierarchyDatum +}); + stratificatorizer = stratificatorizer.id((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array @@ -199,6 +214,10 @@ idStringAccessor = stratificatorizer.id(); // parentId(...) +stratificatorizer = stratificatorizer.parentId((d) => { + return d.parentId; // d is of type TabularHierarchyDatum +}); + stratificatorizer = stratificatorizer.parentId((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array @@ -209,7 +228,8 @@ idStringAccessor = stratificatorizer.parentId(); // Use Stratify Operator ------------------------------------------------ -const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const pId: string | null = stratifiedRootNode.data.parentId; // ----------------------------------------------------------------------- // Cluster @@ -225,16 +245,14 @@ clusterLayout = d3Hierarchy.cluster(); // size() ---------------------------------------------------------------- -clusterLayout = clusterLayout.size(null); clusterLayout = clusterLayout.size([200, 200]); -size = clusterLayout.size(); +sizeOrNull = clusterLayout.size(); // nodeSize() ------------------------------------------------------------ -clusterLayout = clusterLayout.nodeSize(null); clusterLayout = clusterLayout.nodeSize([10, 10]); -size = clusterLayout.nodeSize(); +sizeOrNull = clusterLayout.nodeSize(); // separation() ---------------------------------------------------------- @@ -266,10 +284,11 @@ num = clusterRootNode.height; // children, parent ------------------------------------------------------ -hierarchyPointNodeArray = clusterRootNode.children; +hierarchyPointNodeArrayOrUndefined = clusterRootNode.children; -let parentPointNode: d3Hierarchy.HierarchyPointNode; +let parentPointNode: d3Hierarchy.HierarchyPointNode | null; parentPointNode = hierarchyPointNodeArray.length ? hierarchyPointNodeArray[0].parent : null; +parentPointNode = hierarchyPointNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -280,17 +299,17 @@ idString = clusterRootNode.id; const pointNodeAncestors: Array> = clusterRootNode.ancestors(); const pointNodeDescendants: Array> = clusterRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyPointNodeArray = clusterRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyPointNode = pointNodeDescendants[pointNodeDescendants.length - 1]; const clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); -// links() and HierarchyPointLink<...> ------------------------------------------ +// links() and HierarchyPointLink<...> ----------------------------------- let pointLinks: Array>; @@ -302,27 +321,27 @@ pointLink = pointLinks[0]; hierarchyPointNode = pointLink.source; hierarchyPointNode = pointLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- clusterRootNode = clusterRootNode.sum((d) => d.val); -num = clusterRootNode.value; +numOrUndefined = clusterRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- clusterRootNode = clusterRootNode.count(); -num = clusterRootNode.value; +numOrUndefined = clusterRootNode.value; -// sort --------------------------------------------------------------------- +// sort ------------------------------------------------------------------ clusterRootNode = clusterRootNode.sort((a, b) => { console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- clusterRootNode = clusterRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode @@ -339,7 +358,7 @@ clusterRootNode = clusterRootNode.eachBefore((node) => { console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedClusterNode: d3Hierarchy.HierarchyPointNode; copiedClusterNode = clusterRootNode.copy(); @@ -348,26 +367,24 @@ copiedClusterNode = clusterRootNode.copy(); // Tree // ----------------------------------------------------------------------- -// Create tree layout generator ======================================= +// Create tree layout generator ========================================== let treeLayout: d3Hierarchy.TreeLayout; treeLayout = d3Hierarchy.tree(); -// Configure tree layout generator ==================================== +// Configure tree layout generator ======================================= // size() ---------------------------------------------------------------- -treeLayout = treeLayout.size(null); treeLayout = treeLayout.size([200, 200]); -size = treeLayout.size(); +sizeOrNull = treeLayout.size(); // nodeSize() ------------------------------------------------------------ -treeLayout = treeLayout.nodeSize(null); treeLayout = treeLayout.nodeSize([10, 10]); -size = treeLayout.nodeSize(); +sizeOrNull = treeLayout.nodeSize(); // separation() ---------------------------------------------------------- @@ -416,18 +433,17 @@ tilingFn = treemapLayout.tile(); // size() ---------------------------------------------------------------- -treemapLayout = treemapLayout.size(null); treemapLayout = treemapLayout.size([400, 200]); size = treemapLayout.size(); -// round() ------------------------------------------------------------ +// round() --------------------------------------------------------------- treemapLayout = treemapLayout.round(true); let roundFlag: boolean = treemapLayout.round(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- treemapLayout = treemapLayout.padding(1); treemapLayout = treemapLayout.padding((node) => { @@ -437,7 +453,7 @@ treemapLayout = treemapLayout.padding((node) => { numberRectangularNodeAccessor = treemapLayout.padding(); -// paddingInner() ---------------------------------------------------------------- +// paddingInner() -------------------------------------------------------- treemapLayout = treemapLayout.paddingInner(1); treemapLayout = treemapLayout.paddingInner((node) => { @@ -447,7 +463,7 @@ treemapLayout = treemapLayout.paddingInner((node) => { numberRectangularNodeAccessor = treemapLayout.paddingInner(); -// paddingOuter() ---------------------------------------------------------------- +// paddingOuter() -------------------------------------------------------- treemapLayout = treemapLayout.paddingOuter(1); treemapLayout = treemapLayout.paddingOuter((node) => { @@ -457,7 +473,7 @@ treemapLayout = treemapLayout.paddingOuter((node) => { numberRectangularNodeAccessor = treemapLayout.paddingOuter(); -// paddingTop() ---------------------------------------------------------------- +// paddingTop() ---------------------------------------------------------- treemapLayout = treemapLayout.paddingTop(1); treemapLayout = treemapLayout.paddingTop((node) => { @@ -467,7 +483,7 @@ treemapLayout = treemapLayout.paddingTop((node) => { numberRectangularNodeAccessor = treemapLayout.paddingTop(); -// paddingRight() ---------------------------------------------------------------- +// paddingRight() -------------------------------------------------------- treemapLayout = treemapLayout.paddingRight(1); treemapLayout = treemapLayout.paddingRight((node) => { @@ -477,7 +493,7 @@ treemapLayout = treemapLayout.paddingRight((node) => { numberRectangularNodeAccessor = treemapLayout.paddingRight(); -// paddingBottom() ---------------------------------------------------------------- +// paddingBottom() ------------------------------------------------------- treemapLayout = treemapLayout.paddingBottom(1); treemapLayout = treemapLayout.paddingBottom((node) => { @@ -487,7 +503,7 @@ treemapLayout = treemapLayout.paddingBottom((node) => { numberRectangularNodeAccessor = treemapLayout.paddingBottom(); -// paddingLeft() ---------------------------------------------------------------- +// paddingLeft() --------------------------------------------------------- treemapLayout = treemapLayout.paddingLeft(1); treemapLayout = treemapLayout.paddingLeft((node) => { @@ -527,7 +543,7 @@ tilingFactoryFn = d3Hierarchy.treemapResquarify.ratio(2); treemapLayout.tile(d3Hierarchy.treemapResquarify.ratio(2)); -// Use HierarchyRectangularNode ================================================ +// Use HierarchyRectangularNode ========================================== // x and y coordinates --------------------------------------------------- @@ -544,10 +560,11 @@ num = treemapRootNode.height; // children, parent ------------------------------------------------------ -hierarchyRectangularNodeArray = treemapRootNode.children; +hierarchyRectangularNodeArrayOrUndefined = treemapRootNode.children; -let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode; +let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode | null; parentRectangularNode = hierarchyRectangularNodeArray.length ? hierarchyRectangularNodeArray[0].parent : null; +parentRectangularNode = hierarchyRectangularNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -558,17 +575,17 @@ idString = treemapRootNode.id; const rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); const rectangularNodeDescendants: Array> = treemapRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyRectangularNodeArray = treemapRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyRectangularNode = rectangularNodeDescendants[rectangularNodeDescendants.length - 1]; const treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); -// links() and HierarchyRectangularLink<...> ------------------------------------------ +// links() and HierarchyRectangularLink<...> ----------------------------- let rectangularLinks: Array>; @@ -580,26 +597,26 @@ rectangularLink = rectangularLinks[0]; hierarchyRectangularNode = rectangularLink.source; hierarchyRectangularNode = rectangularLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- treemapRootNode = treemapRootNode.sum((d) => d.val); -num = treemapRootNode.value; +numOrUndefined = treemapRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- treemapRootNode = treemapRootNode.count(); -num = treemapRootNode.value; -// sort --------------------------------------------------------------------- +numOrUndefined = treemapRootNode.value; +// sort ------------------------------------------------------------------ treemapRootNode = treemapRootNode.sort((a, b) => { console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- treemapRootNode = treemapRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode @@ -616,7 +633,7 @@ treemapRootNode = treemapRootNode.eachBefore((node) => { console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedTreemapNode: d3Hierarchy.HierarchyRectangularNode; copiedTreemapNode = treemapRootNode.copy(); @@ -625,34 +642,33 @@ copiedTreemapNode = treemapRootNode.copy(); // Partition // ----------------------------------------------------------------------- -// Create partition layout generator ======================================= +// Create partition layout generator ===================================== let partitionLayout: d3Hierarchy.PartitionLayout; partitionLayout = d3Hierarchy.partition(); -// Configure partition layout generator ==================================== +// Configure partition layout generator ================================== // size() ---------------------------------------------------------------- -partitionLayout = partitionLayout.size(null); partitionLayout = partitionLayout.size([400, 200]); size = partitionLayout.size(); -// round() ------------------------------------------------------------ +// round() --------------------------------------------------------------- partitionLayout = partitionLayout.round(true); roundFlag = partitionLayout.round(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- partitionLayout = partitionLayout.padding(1); num = partitionLayout.padding(); -// Use partition layout generator ========================================== +// Use partition layout generator ======================================== let partitionRootNode: d3Hierarchy.HierarchyRectangularNode; @@ -662,54 +678,57 @@ partitionRootNode = partitionLayout(stratifiedRootNode); // Pack // ----------------------------------------------------------------------- -let numberCircularNodeAccessor: (node: d3Hierarchy.HierarchyCircularNode) => number; +type CircularAccessor = (node: d3Hierarchy.HierarchyCircularNode) => number; +let numberCircularNodeAccessor: CircularAccessor; +let numberCircularNodeAccessorOrNull: CircularAccessor | null; -// Create pack layout generator ======================================= +// Create pack layout generator ========================================== let packLayout: d3Hierarchy.PackLayout; packLayout = d3Hierarchy.pack(); -// Configure pack layout generator ==================================== +// Configure pack layout generator ======================================= // size() ---------------------------------------------------------------- -packLayout = packLayout.size(null); packLayout = packLayout.size([400, 400]); size = packLayout.size(); -// radius() ------------------------------------------------------------ +// radius() -------------------------------------------------------------- + +packLayout = packLayout.radius(null); packLayout = packLayout.radius((node) => { console.log('Radius property of node before completing accessor: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode - return node.value; + return node.value!; }); -numberCircularNodeAccessor = packLayout.radius(); +numberCircularNodeAccessorOrNull = packLayout.radius(); -// padding() ---------------------------------------------------------------- +// padding() ------------------------------------------------------------- packLayout = packLayout.padding(1); packLayout = packLayout.padding((node) => { console.log('Radius property of node: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode - return node.value > 10 ? 2 : 1; + return node.value! > 10 ? 2 : 1; }); numberCircularNodeAccessor = packLayout.padding(); -// Use partition layout generator ========================================== +// Use partition layout generator ======================================== let packRootNode: d3Hierarchy.HierarchyCircularNode; packRootNode = packLayout(stratifiedRootNode); -// Use HierarchyCircularNode ================================================ +// Use HierarchyCircularNode ============================================= -// x and y coordinates and radius r ------------------------------------------ +// x and y coordinates and radius r -------------------------------------- num = packRootNode.x; num = packRootNode.y; @@ -723,10 +742,11 @@ num = packRootNode.height; // children, parent ------------------------------------------------------ -hierarchyCircularNodeArray = packRootNode.children; +hierarchyCircularNodeArrayOrUndefined = packRootNode.children; -let parentCircularNode: d3Hierarchy.HierarchyCircularNode; +let parentCircularNode: d3Hierarchy.HierarchyCircularNode | null; parentCircularNode = hierarchyCircularNodeArray.length ? hierarchyCircularNodeArray[0].parent : null; +parentCircularNode = hierarchyCircularNodeArray[0].parent; // id -------------------------------------------------------------------- @@ -737,17 +757,17 @@ idString = packRootNode.id; const circularNodeAncestors: Array> = packRootNode.ancestors(); const circularNodeDescendants: Array> = packRootNode.descendants(); -// leaves() --------------------------------------------------------------- +// leaves() -------------------------------------------------------------- hierarchyCircularNodeArray = packRootNode.leaves(); -// path() ------------------------------------------------------------------- +// path() ---------------------------------------------------------------- hierarchyCircularNode = circularNodeDescendants[circularNodeDescendants.length - 1]; const packPath: Array> = packRootNode.path(hierarchyCircularNode); -// links() and HierarchyRectangularLink<...> ------------------------------------------ +// links() and HierarchyRectangularLink<...> ----------------------------- let circularLinks: Array>; @@ -759,26 +779,27 @@ circularLink = circularLinks[0]; hierarchyCircularNode = circularLink.source; hierarchyCircularNode = circularLink.target; -// sum() and value ---------------------------------------------------------- +// sum() and value ------------------------------------------------------- packRootNode = packRootNode.sum((d) => d.val); -num = packRootNode.value; +numOrUndefined = packRootNode.value; -// count() and value ---------------------------------------------------------- +// count() and value ----------------------------------------------------- packRootNode = packRootNode.count(); -num = packRootNode.value; -// sort --------------------------------------------------------------------- +numOrUndefined = packRootNode.value; + +// sort ------------------------------------------------------------------ packRootNode = packRootNode.sort((a, b) => { console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode - return b.height - a.height || b.value - a.value; + return b.height - a.height || b.value! - a.value!; }); -// each(), eachAfter(), eachBefore() ---------------------------------------- +// each(), eachAfter(), eachBefore() ------------------------------------- packRootNode = packRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode @@ -795,7 +816,7 @@ packRootNode = packRootNode.eachBefore((node) => { console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -// copy() -------------------------------------------------------------------- +// copy() ---------------------------------------------------------------- let copiedPackNode: d3Hierarchy.HierarchyCircularNode; copiedPackNode = packRootNode.copy(); diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index 440a779217..0ec823cc78 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -1,65 +1,208 @@ // Type definitions for D3JS d3-hierarchy module 1.1 // Project: https://github.com/d3/d3-hierarchy/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.1.1 +// Last module patch version validated against: 1.1.6 // ----------------------------------------------------------------------- // Hierarchy // ----------------------------------------------------------------------- export interface HierarchyLink { + /** + * The source of the link. + */ source: HierarchyNode; + + /** + * The target of the link. + */ target: HierarchyNode; } export interface HierarchyNode { - data: Datum; - readonly depth: number; - readonly height: number; - parent: HierarchyNode | null; - children?: Array>; /** - * Aggregated numeric value as calculated by sum(value) or count(), - * if previously invoked. + * The associated data, as specified to the constructor. + */ + data: Datum; + + /** + * Zero for the root node, and increasing by one for each descendant generation. + */ + readonly depth: number; + + /** + * Zero for leaf nodes, and the greatest distance from any descendant leaf for internal nodes. + */ + readonly height: number; + + /** + * The parent node, or null for the root node. + */ + parent: this | null; + + /** + * An array of child nodes, if any; undefined for leaf nodes. + */ + children?: this[]; + + /** + * Aggregated numeric value as calculated by `sum(value)` or `count()`, if previously invoked. */ readonly value?: number; + /** - * Optional Node Id string set by StratifyOperator, if - * hierarchical data was created from tabular data using stratify() + * Optional node id string set by `StratifyOperator`, if hierarchical data was created from tabular data using stratify(). */ readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyNode): Array>; + + /** + * Returns the array of ancestors nodes, starting with this node, then followed by each parent up to the root. + */ + ancestors(): this[]; + + /** + * Returns the array of descendant nodes, starting with this node, then followed by each child in topological order. + */ + descendants(): this[]; + + /** + * Returns the array of leaf nodes in traversal order; leaves are nodes with no children. + */ + leaves(): this[]; + + /** + * Returns the shortest path through the hierarchy from this node to the specified target node. + * The path starts at this node, ascends to the least common ancestor of this node and the target node, and then descends to the target node. + * + * @param target The target node. + */ + path(target: this): this[]; + + /** + * Returns an array of links for this node, where each link is an object that defines source and target properties. + * The source of each link is the parent node, and the target is a child node. + */ links(): Array>; + + /** + * Evaluates the specified value function for this node and each descendant in post-order traversal, and returns this node. + * The `node.value` property of each node is set to the numeric value returned by the specified function plus the combined value of all descendants. + * + * @param value The value function is passed the node’s data, and must return a non-negative number. + */ sum(value: (d: Datum) => number): this; + + /** + * Computes the number of leaves under this node and assigns it to `node.value`, and similarly for every descendant of node. + * If this node is a leaf, its count is one. Returns this node. + */ count(): this; - sort(compare: (a: HierarchyNode, b: HierarchyNode) => number): this; - each(func: (node: HierarchyNode) => void): this; - eachAfter(func: (node: HierarchyNode) => void): this; - eachBefore(func: (node: HierarchyNode) => void): this; - copy(): HierarchyNode; + + /** + * Sorts the children of this node, if any, and each of this node’s descendants’ children, + * in pre-order traversal using the specified compare function, and returns this node. + * + * @param compare The compare function is passed two nodes a and b to compare. + * If a should be before b, the function must return a value less than zero; + * if b should be before a, the function must return a value greater than zero; + * otherwise, the relative order of a and b are not specified. See `array.sort` for more. + */ + sort(compare: (a: this, b: this) => number): this; + + /** + * Invokes the specified function for node and each descendant in breadth-first order, + * such that a given node is only visited if all nodes of lesser depth have already been visited, + * as well as all preceding nodes of the same depth. + * + * @param func The specified function is passed the current node. + */ + each(func: (node: this) => void): this; + + /** + * Invokes the specified function for node and each descendant in post-order traversal, + * such that a given node is only visited after all of its descendants have already been visited. + * + * @param func The specified function is passed the current node. + */ + eachAfter(func: (node: this) => void): this; + + /** + * Invokes the specified function for node and each descendant in pre-order traversal, + * such that a given node is only visited after all of its ancestors have already been visited. + * + * @param func The specified function is passed the current node. + */ + eachBefore(func: (node: this) => void): this; + + /** + * Return a deep copy of the subtree starting at this node. The returned deep copy shares the same data, however. + * The returned node is the root of a new tree; the returned node’s parent is always null and its depth is always zero. + */ + copy(): this; } -export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode; +/** + * Constructs a root node from the specified hierarchical data. + * + * @param data The root specified data. + * @param children The specified children accessor function invoked for each datum, starting with the root data. + * Must return an array of data representing the children, and return null or undefined if the current datum has no children. + * If children is not specified, it defaults to: `(d) => d.children`. + */ +export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null | undefined)): HierarchyNode; // ----------------------------------------------------------------------- // Stratify // ----------------------------------------------------------------------- -// TODO: Review the comment in the API documentation related to 'reserved properties': id, parentId, children. If this is referring to the element on node, it should be 'parent'? - export interface StratifyOperator { + /** + * Generates a new hierarchy from the specified tabular data. Each node in the returned object has a shallow copy of the properties + * from the corresponding data object, excluding the following reserved properties: id, parentId, children. + * + * @param data The root specified data. + * @throws Error on missing id, ambiguous id, cycle, multiple roots or no root. + */ (data: Datum[]): HierarchyNode; + + /** + * Returns the current id accessor, which defaults to: `(d) => d.id`. + */ id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); - id(id: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; + /** + * Sets the id accessor to the given function. + * The id accessor is invoked for each element in the input data passed to the stratify operator. + * The returned string is then used to identify the node's relationships in conjunction with the parent id. + * For leaf nodes, the id may be undefined, null or the empty string; otherwise, the id must be unique. + * + * @param id The id accessor. + */ + id(id: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this; + + /** + * Returns the current parent id accessor, which defaults to: `(d) => d.parentId`. + */ parentId(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); - parentId(parentId: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; + /** + * Sets the parent id accessor to the given function. + * The parent id accessor is invoked for each element in the input data passed to the stratify operator. + * The returned string is then used to identify the node's relationships in conjunction with the id. + * For the root node, the parent id should be undefined, null or the empty string. + * There must be exactly one root node in the input data, and no circular relationships. + * + * @param parentId The parent id accessor. + */ + parentId(parentId: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this; } +/** + * Constructs a new stratify operator with the default settings. + */ export function stratify(): StratifyOperator; // ----------------------------------------------------------------------- @@ -67,52 +210,86 @@ export function stratify(): StratifyOperator; // ----------------------------------------------------------------------- export interface HierarchyPointLink { + /** + * The source of the link. + */ source: HierarchyPointNode; + + /** + * The target of the link. + */ target: HierarchyPointNode; } -export interface HierarchyPointNode { +export interface HierarchyPointNode extends HierarchyNode { + /** + * The x-coordinate of the node. + */ x: number; + + /** + * The y-coordinate of the node. + */ y: number; - data: Datum; - readonly depth: number; - readonly height: number; - parent: HierarchyPointNode | null; - children?: Array>; + /** - * Aggregated numeric value as calculated by sum(value) or count(), - * if previously invoked. + * Returns an array of links for this node, where each link is an object that defines source and target properties. + * The source of each link is the parent node, and the target is a child node. */ - readonly value?: number; - /** - * Optional Node Id string set by StratifyOperator, if - * hierarchical data was created from tabular data using stratify() - */ - readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyPointNode): Array>; links(): Array>; - sum(value: (d: Datum) => number): this; - count(): this; - sort(compare: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this; - each(func: (node: HierarchyPointNode) => void): this; - eachAfter(func: (node: HierarchyPointNode) => void): this; - eachBefore(func: (node: HierarchyPointNode) => void): this; - copy(): HierarchyPointNode; } export interface ClusterLayout { + /** + * Lays out the specified root hierarchy. + * You may want to call `root.sort` before passing the hierarchy to the cluster layout. + * + * @param root The specified root hierarchy. + */ (root: HierarchyNode): HierarchyPointNode; + + /** + * Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead. + */ size(): [number, number] | null; + /** + * Sets this cluster layout’s size to the specified [width, height] array and returns the cluster layout. + * The size represent an arbitrary coordinate system; for example, to produce a radial layout, + * a size of [360, radius] corresponds to a breadth of 360° and a depth of radius. + * + * @param size The specified two-element size array. + */ size(size: [number, number]): this; + + /** + * Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead. + */ nodeSize(): [number, number] | null; + /** + * Sets this cluster layout’s node size to the specified [width, height] array and returns this cluster layout. + * When a node size is specified, the root node is always positioned at <0, 0>. + * + * @param size The specified two-element size array. + */ nodeSize(size: [number, number]): this; + + /** + * Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`. + */ separation(): (a: HierarchyPointNode, b: HierarchyPointNode) => number; + /** + * Sets the separation accessor to the specified function and returns this cluster layout. + * The separation accessor is used to separate neighboring leaves. + * + * @param separation The separation function is passed two leaves a and b, and must return the desired separation. + * The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent. + */ separation(separation: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this; } +/** + * Creates a new cluster layout with default settings. + */ export function cluster(): ClusterLayout; // ----------------------------------------------------------------------- @@ -120,15 +297,56 @@ export function cluster(): ClusterLayout; // ----------------------------------------------------------------------- export interface TreeLayout { + /** + * Lays out the specified root hierarchy. + * You may want to call `root.sort` before passing the hierarchy to the tree layout. + * + * @param root The specified root hierarchy. + */ (root: HierarchyNode): HierarchyPointNode; + + /** + * Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead. + */ size(): [number, number] | null; + /** + * Sets this tree layout’s size to the specified [width, height] array and returns the tree layout. + * The size represent an arbitrary coordinate system; for example, to produce a radial layout, + * a size of [360, radius] corresponds to a breadth of 360° and a depth of radius. + * + * @param size The specified two-element size array. + */ size(size: [number, number]): this; + + /** + * Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead. + */ nodeSize(): [number, number] | null; + /** + * Sets this tree layout’s node size to the specified [width, height] array and returns this tree layout. + * When a node size is specified, the root node is always positioned at <0, 0>. + * + * @param size The specified two-element size array. + */ nodeSize(size: [number, number]): this; + + /** + * Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`. + */ separation(): (a: HierarchyPointNode, b: HierarchyPointNode) => number; + /** + * Sets the separation accessor to the specified function and returns this tree layout. + * The separation accessor is used to separate neighboring nodes. + * + * @param separation The separation function is passed two nodes a and b, and must return the desired separation. + * The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent. + */ separation(separation: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this; } +/** + * Creates a new tree layout with default settings. + */ export function tree(): TreeLayout; // ----------------------------------------------------------------------- @@ -136,91 +354,283 @@ export function tree(): TreeLayout; // ----------------------------------------------------------------------- export interface HierarchyRectangularLink { + /** + * The source of the link. + */ source: HierarchyRectangularNode; + + /** + * The target of the link. + */ target: HierarchyRectangularNode; } -export interface HierarchyRectangularNode { +export interface HierarchyRectangularNode extends HierarchyNode { + /** + * The left edge of the rectangle. + */ x0: number; + + /** + * The top edge of the rectangle + */ y0: number; + + /** + * The right edge of the rectangle. + */ x1: number; + + /** + * The bottom edge of the rectangle. + */ y1: number; - data: Datum; - readonly depth: number; - readonly height: number; - parent: HierarchyRectangularNode | null; - children?: Array>; + /** - * Aggregated numeric value as calculated by sum(value) or count(), - * if previously invoked. + * Returns an array of links for this node, where each link is an object that defines source and target properties. + * The source of each link is the parent node, and the target is a child node. */ - readonly value?: number; - /** - * Optional Node Id string set by StratifyOperator, if - * hierarchical data was created from tabular data using stratify() - */ - readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyRectangularNode): Array>; links(): Array>; - sum(value: (d: Datum) => number): this; - count(): this; - sort(compare: (a: HierarchyRectangularNode, b: HierarchyRectangularNode) => number): this; - each(func: (node: HierarchyRectangularNode) => void): this; - eachAfter(func: (node: HierarchyRectangularNode) => void): this; - eachBefore(func: (node: HierarchyRectangularNode) => void): this; - copy(): HierarchyRectangularNode; } export interface TreemapLayout { + /** + * Lays out the specified root hierarchy. + * You must call `root.sum` before passing the hierarchy to the treemap layout. + * You probably also want to call `root.sort` to order the hierarchy before computing the layout. + * + * @param root The specified root hierarchy. + */ (root: HierarchyNode): HierarchyRectangularNode; + + /** + * Returns the current tiling method, which defaults to `d3.treemapSquarify` with the golden ratio. + */ tile(): (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number) => void; + /** + * Sets the tiling method to the specified function and returns this treemap layout. + * + * @param tile The specified tiling function. + */ tile(tile: (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number) => void): this; + + /** + * Returns the current size, which defaults to [1, 1]. + */ size(): [number, number]; + /** + * Sets this treemap layout’s size to the specified [width, height] array and returns this treemap layout. + * + * @param size The specified two-element size array. + */ size(size: [number, number]): this; + + /** + * Returns the current rounding state, which defaults to false. + */ round(): boolean; + /** + * Enables or disables rounding according to the given boolean and returns this treemap layout. + * + * @param round The specified boolean flag. + */ round(round: boolean): this; + + /** + * Returns the current inner padding function. + */ padding(): (node: HierarchyRectangularNode) => number; + /** + * Sets the inner and outer padding to the specified number and returns this treemap layout. + * + * @param padding The specified padding value. + */ padding(padding: number): this; + /** + * Sets the inner and outer padding to the specified function and returns this treemap layout. + * + * @param padding The specified padding function. + */ padding(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current inner padding function, which defaults to the constant zero. + */ paddingInner(): (node: HierarchyRectangularNode) => number; + /** + * Sets the inner padding to the specified number and returns this treemap layout. + * The inner padding is used to separate a node’s adjacent children. + * + * @param padding The specified inner padding value. + */ paddingInner(padding: number): this; + /** + * Sets the inner padding to the specified function and returns this treemap layout. + * The function is invoked for each node with children, being passed the current node. + * The inner padding is used to separate a node’s adjacent children. + * + * @param padding The specified inner padding function. + */ paddingInner(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current top padding function. + */ paddingOuter(): (node: HierarchyRectangularNode) => number; + /** + * Sets the top, right, bottom and left padding to the specified function and returns this treemap layout. + * + * @param padding The specified padding outer value. + */ paddingOuter(padding: number): this; + /** + * Sets the top, right, bottom and left padding to the specified function and returns this treemap layout. + * + * @param padding The specified padding outer function. + */ paddingOuter(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current top padding function, which defaults to the constant zero. + */ paddingTop(): (node: HierarchyRectangularNode) => number; + /** + * Sets the top padding to the specified number and returns this treemap layout. + * The top padding is used to separate the top edge of a node from its children. + * + * @param padding The specified top padding value. + */ paddingTop(padding: number): this; + /** + * Sets the top padding to the specified function and returns this treemap layout. + * The function is invoked for each node with children, being passed the current node. + * The top padding is used to separate the top edge of a node from its children. + * + * @param padding The specified top padding function. + */ paddingTop(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current right padding function, which defaults to the constant zero. + */ paddingRight(): (node: HierarchyRectangularNode) => number; + /** + * Sets the right padding to the specified number and returns this treemap layout. + * The right padding is used to separate the right edge of a node from its children. + * + * @param padding The specified right padding value. + */ paddingRight(padding: number): this; + /** + * Sets the right padding to the specified function and returns this treemap layout. + * The function is invoked for each node with children, being passed the current node. + * The right padding is used to separate the right edge of a node from its children. + * + * @param padding The specified right padding function. + */ paddingRight(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current bottom padding function, which defaults to the constant zero. + */ paddingBottom(): (node: HierarchyRectangularNode) => number; + /** + * Sets the bottom padding to the specified number and returns this treemap layout. + * The bottom padding is used to separate the bottom edge of a node from its children. + * + * @param padding The specified bottom padding value. + */ paddingBottom(padding: number): this; + /** + * Sets the bottom padding to the specified function and returns this treemap layout. + * The function is invoked for each node with children, being passed the current node. + * The bottom padding is used to separate the bottom edge of a node from its children. + * + * @param padding The specified bottom padding function. + */ paddingBottom(padding: (node: HierarchyRectangularNode) => number): this; + + /** + * Returns the current left padding function, which defaults to the constant zero. + */ paddingLeft(): (node: HierarchyRectangularNode) => number; + /** + * Sets the left padding to the specified number and returns this treemap layout. + * The left padding is used to separate the left edge of a node from its children. + * + * @param padding The specified left padding value. + */ paddingLeft(padding: number): this; + /** + * Sets the left padding to the specified function and returns this treemap layout. + * The function is invoked for each node with children, being passed the current node. + * The left padding is used to separate the left edge of a node from its children. + * + * @param padding The specified left padding function. + */ paddingLeft(padding: (node: HierarchyRectangularNode) => number): this; } +/** + * Creates a new treemap layout with default settings. + */ export function treemap(): TreemapLayout; -// Tiling functions --------------------------------------------------------------------------------- +// Tiling functions ------------------------------------------------------ +/** + * Recursively partitions the specified nodes into an approximately-balanced binary tree, + * choosing horizontal partitioning for wide rectangles and vertical partitioning for tall rectangles. + */ export function treemapBinary(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; + +/** + * Divides the rectangular area specified by x0, y0, x1, y1 horizontally according the value of each of the specified node’s children. + * The children are positioned in order, starting with the left edge (x0) of the given rectangle. + * If the sum of the children’s values is less than the specified node’s value (i.e., if the specified node has a non-zero internal value), + * the remaining empty space will be positioned on the right edge (x1) of the given rectangle. + */ export function treemapDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; + +/** + * Divides the rectangular area specified by x0, y0, x1, y1 vertically according the value of each of the specified node’s children. + * The children are positioned in order, starting with the top edge (y0) of the given rectangle. + * If the sum of the children’s values is less than the specified node’s value (i.e., if the specified node has a non-zero internal value), + * the remaining empty space will be positioned on the bottom edge (y1) of the given rectangle. + */ export function treemapSlice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; + +/** + * If the specified node has odd depth, delegates to treemapSlice; otherwise delegates to treemapDice. + */ export function treemapSliceDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; // TODO: Test Factory code export interface RatioSquarifyTilingFactory { (node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; + + /** + * Specifies the desired aspect ratio of the generated rectangles. + * Note that the orientation of the generated rectangles (tall or wide) is not implied by the ratio. + * Furthermore, the rectangles ratio are not guaranteed to have the exact specified aspect ratio. + * If not specified, the aspect ratio defaults to the golden ratio, φ = (1 + sqrt(5)) / 2, per Kong et al. + * + * @param ratio The specified ratio value greater than or equal to one. + */ ratio(ratio: number): RatioSquarifyTilingFactory; } +/** + * Implements the squarified treemap algorithm by Bruls et al., which seeks to produce rectangles of a given aspect ratio. + */ export const treemapSquarify: RatioSquarifyTilingFactory; + +/** + * Like `d3.treemapSquarify`, except preserves the topology (node adjacencies) of the previous layout computed by `d3.treemapResquarify`, + * if there is one and it used the same target aspect ratio. This tiling method is good for animating changes to treemaps because + * it only changes node sizes and not their relative positions, thus avoiding distracting shuffling and occlusion. + * The downside of a stable update, however, is a suboptimal layout for subsequent updates: only the first layout uses the Bruls et al. squarified algorithm. + */ export const treemapResquarify: RatioSquarifyTilingFactory; // ----------------------------------------------------------------------- @@ -228,15 +638,53 @@ export const treemapResquarify: RatioSquarifyTilingFactory; // ----------------------------------------------------------------------- export interface PartitionLayout { + /** + * Lays out the specified root hierarchy. + * You must call `root.sum` before passing the hierarchy to the partition layout. + * You probably also want to call `root.sort` to order the hierarchy before computing the layout. + * + * @param root The specified root hierarchy. + */ (root: HierarchyNode): HierarchyRectangularNode; + + /** + * Returns the current size, which defaults to [1, 1]. + */ size(): [number, number]; + /** + * Sets this partition layout’s size to the specified [width, height] array and returns this partition layout. + * + * @param size The specified two-element size array. + */ size(size: [number, number]): this; + + /** + * Returns the current rounding state, which defaults to false. + */ round(): boolean; + /** + * Enables or disables rounding according to the given boolean and returns this partition layout. + * + * @param round The specified boolean flag. + */ round(round: boolean): this; + + /** + * Returns the current padding, which defaults to zero. + */ padding(): number; + /** + * Sets the padding to the specified number and returns this partition layout. + * The padding is used to separate a node’s adjacent children. + * + * @param padding The specified padding value. + */ padding(padding: number): this; } +/** + * Creates a new partition layout with the default settings. + */ export function partition(): PartitionLayout; // ----------------------------------------------------------------------- @@ -244,54 +692,110 @@ export function partition(): PartitionLayout; // ----------------------------------------------------------------------- export interface HierarchyCircularLink { + /** + * The source of the link. + */ source: HierarchyCircularNode; + + /** + * The target of the link. + */ target: HierarchyCircularNode; } -export interface HierarchyCircularNode { +export interface HierarchyCircularNode extends HierarchyNode { + /** + * The x-coordinate of the circle’s center. + */ x: number; + + /** + * The y-coordinate of the circle’s center. + */ y: number; + + /** + * The radius of the circle. + */ r: number; - data: Datum; - readonly depth: number; - readonly height: number; - parent: HierarchyCircularNode | null; - children?: Array>; + /** - * Aggregated numeric value as calculated by sum(value) or count(), - * if previously invoked. + * Returns an array of links for this node, where each link is an object that defines source and target properties. + * The source of each link is the parent node, and the target is a child node. */ - readonly value?: number; - /** - * Optional Node Id string set by StratifyOperator, if - * hierarchical data was created from tabular data using stratify() - */ - readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyCircularNode): Array>; links(): Array>; - sum(value: (d: Datum) => number): this; - count(): this; - sort(compare: (a: HierarchyCircularNode, b: HierarchyCircularNode) => number): this; - each(func: (node: HierarchyCircularNode) => void): this; - eachAfter(func: (node: HierarchyCircularNode) => void): this; - eachBefore(func: (node: HierarchyCircularNode) => void): this; - copy(): HierarchyCircularNode; } export interface PackLayout { + /** + * Lays out the specified root hierarchy. + * You must call `root.sum` before passing the hierarchy to the pack layout. + * You probably also want to call `root.sort` to order the hierarchy before computing the layout. + * + * @param root The specified root hierarchy. + */ (root: HierarchyNode): HierarchyCircularNode; + + /** + * Returns the current radius accessor, which defaults to null. + */ radius(): null | ((node: HierarchyCircularNode) => number); - radius(radius: (node: HierarchyCircularNode) => number): this; + /** + * Sets the pack layout’s radius accessor to the specified function and returns this pack layout. + * If the radius accessor is null, the radius of each leaf circle is derived from the leaf `node.value` (computed by `node.sum`); + * the radii are then scaled proportionally to fit the layout size. + * If the radius accessor is not null, the radius of each leaf circle is specified exactly by the function. + * + * @param radius The specified radius accessor. + */ + radius(radius: null | ((node: HierarchyCircularNode) => number)): this; + + /** + * Returns the current size, which defaults to [1, 1]. + */ size(): [number, number]; + /** + * Sets this pack layout’s size to the specified [width, height] array and returns this pack layout. + * + * @param size The specified two-element size array. + */ size(size: [number, number]): this; + + /** + * Returns the current padding accessor, which defaults to the constant zero. + */ padding(): (node: HierarchyCircularNode) => number; + /** + * Sets this pack layout’s padding accessor to the specified number and returns this pack layout. + * Returns the current padding accessor, which defaults to the constant zero. + * + * When siblings are packed, tangent siblings will be separated by approximately the specified padding; + * the enclosing parent circle will also be separated from its children by approximately the specified padding. + * If an explicit radius is not specified, the padding is approximate because a two-pass algorithm + * is needed to fit within the layout size: the circles are first packed without padding; + * a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding. + * + * @param padding The specified padding value. + */ padding(padding: number): this; + /** + * Sets this pack layout’s padding accessor to the specified function and returns this pack layout. + * Returns the current padding accessor, which defaults to the constant zero. + * + * When siblings are packed, tangent siblings will be separated by approximately the specified padding; + * the enclosing parent circle will also be separated from its children by approximately the specified padding. + * If an explicit radius is not specified, the padding is approximate because a two-pass algorithm + * is needed to fit within the layout size: the circles are first packed without padding; + * a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding. + * + * @param padding The specified padding function. + */ padding(padding: (node: HierarchyCircularNode) => number): this; } +/** + * Creates a new pack layout with the default settings. + */ export function pack(): PackLayout; // ----------------------------------------------------------------------- @@ -299,8 +803,19 @@ export function pack(): PackLayout; // ----------------------------------------------------------------------- export interface PackCircle { + /** + * The radius of the circle. + */ r: number; + + /** + * The x-coordinate of the circle’s center. + */ x?: number; + + /** + * The y-coordinate of the circle’s center. + */ y?: number; } @@ -309,6 +824,19 @@ export interface PackCircle { // For invocation of packEnclose the x and y coordinates are mandatory. It seems easier to just comment // on the mandatory nature, then to create separate interfaces and having to deal with recasting. +/** + * Packs the specified array of circles, each of which must have a `circle.r` property specifying the circle’s radius. + * The circles are positioned according to the front-chain packing algorithm by Wang et al. + * + * @param circles The specified array of circles to pack. + */ export function packSiblings(circles: Datum[]): Datum[]; +/** + * Computes the smallest circle that encloses the specified array of circles, each of which must have + * a `circle.r` property specifying the circle’s radius, and `circle.x` and `circle.y` properties specifying the circle’s center. + * The enclosing circle is computed using the Matoušek-Sharir-Welzl algorithm. (See also Apollonius’ Problem.) + * + * @param circles The specified array of circles to pack. + */ export function packEnclose(circles: Datum[]): { r: number, x: number, y: number }; diff --git a/types/d3-hierarchy/tsconfig.json b/types/d3-hierarchy/tsconfig.json index 7fbc1fb5df..da64c5832c 100644 --- a/types/d3-hierarchy/tsconfig.json +++ b/types/d3-hierarchy/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/d3-quadtree/d3-quadtree-tests.ts b/types/d3-quadtree/d3-quadtree-tests.ts index eda00fe130..8180bc0f44 100644 --- a/types/d3-quadtree/d3-quadtree-tests.ts +++ b/types/d3-quadtree/d3-quadtree-tests.ts @@ -13,19 +13,21 @@ import * as d3Quadtree from 'd3-quadtree'; // --------------------------------------------------------------------------- // custom type guard -function isLeaf(a: any): a is d3Quadtree.QuadtreeLeaf { - return a.data !== undefined; +function isLeaf(a: d3Quadtree.QuadtreeInternalNode | d3Quadtree.QuadtreeLeaf): a is d3Quadtree.QuadtreeLeaf { + return a.length === undefined; } let num: number; -let extent: [[number, number], [number, number]]; +let num4: 4; +let undef: undefined; +let extent: [[number, number], [number, number]] | undefined; interface TestDatum { x: number; y: number; } -let testDatum: TestDatum; +let testDatum: TestDatum | undefined; let testData: TestDatum[] = [ { x: 10, y: 20 }, @@ -83,7 +85,6 @@ quadtree = d3Quadtree.quadtree(testData); // explicitly typed to Test // test without data quadtree = d3Quadtree.quadtree(); -// quadtree = d3Quadtree.quadtree(); fails, wrong underlying data type // Configure Quadtree ======================================================== @@ -111,12 +112,14 @@ quadtree = quadtree.cover(50, 90); // add(...) ------------------------------------------------------------------ quadtree = quadtree.add({ x: 35, y: 35 }); -// quadtree = quadtree.add({x: 35}); // fails, incompatible data type +// $ExpectError +quadtree = quadtree.add({x: 35}); // fails, incompatible data type // addAll(...) --------------------------------------------------------------- quadtree = quadtree.addAll(testData); -// quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type +// $ExpectError +quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type // remove(...) --------------------------------------------------------------- @@ -191,9 +194,10 @@ quadtree = quadtree.visit((node, x0, y0, x1, y1) => { } }); -// quadtree = quadtree.visit(function (node, x0, y0, x1, y1) { -// return 10; // fails wrong return type -// }); +// $ExpectError +quadtree = quadtree.visit((node, x0, y0, x1, y1) => { + return 10; // fails wrong return type +}); // visitAfter() --------------------------------------------------------------- @@ -232,3 +236,15 @@ quadNode = internalNode[0]; quadNode = internalNode[1]; quadNode = internalNode[2]; quadNode = internalNode[3]; + +num = internalNode.length; +num4 = internalNode.length; + +quadtree = quadtree.visit((node, x0, y0, x1, y1) => { + if (isLeaf(node)) { + undef = node.length; + } else { + num = node.length; + num4 = node.length; + } +}); diff --git a/types/d3-quadtree/index.d.ts b/types/d3-quadtree/index.d.ts index 8128c9e306..8e66ba411c 100644 --- a/types/d3-quadtree/index.d.ts +++ b/types/d3-quadtree/index.d.ts @@ -1,17 +1,34 @@ // Type definitions for D3JS d3-quadtree module 1.0 // Project: https://github.com/d3/d3-quadtree/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -// Last module patch version validated against: 1.0.1 +// Last module patch version validated against: 1.0.3 /** * Leaf node of the quadtree. */ export interface QuadtreeLeaf { + /** + * The data associated with this point, as passed to quadtree.add. + */ data: T; + + /** + * The next datum in this leaf, if any. + */ next?: QuadtreeLeaf; + + /** + * The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes. + */ + length?: undefined; } + /** * Internal nodes of the quadtree are represented as four-element arrays in left-to-right, top-to-bottom order: * @@ -22,32 +39,170 @@ export interface QuadtreeLeaf { * * A child quadrant may be undefined if it is empty. */ -export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> { } +export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> { + /** + * The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes. + */ + length: 4; +} export interface Quadtree { + /** + * Returns the current x-accessor, which defaults to: `x(d) => d[0]`. + */ x(): (d: T) => number; + /** + * Sets the current x-coordinate accessor and returns the quadtree. + * The x-accessors must be consistent, returning the same value given the same input. + * + * @param x The x-coordinate accessor. + */ x(x: (d: T) => number): this; + + /** + * Returns the current y-accessor, which defaults to: `y(d) => d[1]`. + */ y(): (d: T) => number; + /** + * Sets the current y-coordinate accessor and returns the quadtree. + * The y-accessors must be consistent, returning the same value given the same input. + * + * @param y The y-coordinate accessor. + */ y(y: (d: T) => number): this; + + /** + * Returns the quadtree's current extent `[[x0, y0], [x1, y1]]`, + * where `x0` and `y0` are the inclusive lower bounds and `x1` and `y1` are the inclusive upper bounds, + * or `undefined` if the quadtree has no extent. + */ extent(): [[number, number], [number, number]] | undefined; + /** + * Expands the quadtree to cover the specified points `[[x0, y0], [x1, y1]]` and returns the quadtree. + * The extent may also be expanded by calling `quadtree.cover` or `quadtree.add`. + * + * @param extend The specified points to cover. + */ extent(extend: [[number, number], [number, number]]): this; + + /** + * Expands the quadtree to cover the specified point ⟨x,y⟩, and returns the quadtree. + * * If the quadtree’s extent already covers the specified point, this method does nothing. + * * If the quadtree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the root node as necessary. + * * If the quadtree is empty, the extent is initialized to the extent `[[⌊x⌋, ⌊y⌋], [⌈x⌉, ⌈y⌉]]`. + * Rounding is necessary such that if the extent is later doubled, the boundaries of existing quadrants do not change due to floating point error. + * + * @param x The x-coordinate for the specified point to cover. + * @param y The y-coordinate for the specified point to cover. + */ cover(x: number, y: number): this; + + /** + * Adds the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree. + * If the new point is outside the current extent of the quadtree, the quadtree is automatically expanded to cover the new point. + * + * @param datum The specified datum to add. + */ add(datum: T): this; + + /** + * Adds the specified array of data to the quadtree, deriving each element’s coordinates ⟨x,y⟩ using the current x- and y-accessors, and return this quadtree. + * This is approximately equivalent to calling quadtree.add repeatedly. + * However, this method results in a more compact quadtree because the extent of the data is computed first before adding the data. + * + * @param data The specified array of data to add. + */ addAll(data: T[]): this; + + /** + * Removes the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree. + * If the specified datum does not exist in this quadtree, this method does nothing. + * + * @param datum The specified datum to remove. + */ remove(datum: T): this; + + /** + * Removes the specified data to the quadtree, deriving their coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree. + * If a specified datum does not exist in this quadtree, it is ignored. + * + * @param data The specified array of data to remove. + */ removeAll(data: T[]): this; + + /** + * Returns a copy of the quadtree. All nodes in the returned quadtree are identical copies of the corresponding node in the quadtree; + * however, any data in the quadtree is shared by reference and not copied. + */ copy(): Quadtree; + + /** + * Returns the root node of the quadtree. + */ root(): QuadtreeInternalNode | QuadtreeLeaf; + + /** + * Returns an array of all data in the quadtree. + */ data(): T[]; + + /** + * Returns the total number of data in the quadtree. + */ size(): number; + + /** + * Returns the datum closest to the position ⟨x,y⟩ with the given search radius. If radius is not specified, it defaults to infinity. + * If there is no datum within the search area, returns undefined. + * + * @param x The x-coordinate for the search position. + * @param y The y-coordinate for the search position. + * @param radius The optional search radius. + */ find(x: number, y: number, radius?: number): T | undefined; - // TODO: Review below, when validating to strictNullChecks. - // tslint:disable-next-line:void-return - visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): this; + + /** + * Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node, + * where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree. + * + * If the callback returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited. + * This can be used to quickly visit only parts of the tree. + * Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right. + * In cases such as search, visiting siblings in a specific order may be faster. + * + * @param callback The callback invoked for each node. + */ + visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void | boolean): this; + + /** + * Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node, + * where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree. + * + * @param callback The callback invoked for each node. + */ visitAfter(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void): this; } -export function quadtree(): Quadtree<[number, number]>; -export function quadtree(data: Array<[number, number]>): Quadtree<[number, number]>; -export function quadtree(): Quadtree; -export function quadtree(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree; +/** + * Creates a new, empty quadtree with an empty extent and the default x- and y-accessors. + * + * The generic refers to the data type. If omitted, the default setting assumes that, + * the data used with the quadtree are two-element arrays. + * The first element corresponds to the x-dimension, the second to the y-dimension. + * When using another type, The x- and y-accessors must be specified. + */ +export function quadtree(): Quadtree; +/** + * Creates a new quadtree with the specified array of data. + * If `x` and `y` are also specified, sets the x- and y- accessors to the specified functions before adding the specified array of data to the quadtree, otherwise use the default x- and y-accessors. + * + * The generic refers to the data type. If omitted, the default setting assumes that, + * the data used with the quadtree are two-element arrays. + * The first element corresponds to the x-dimension, the second to the y-dimension. + * When using another type, The x- and y-accessors must be specified. + * + * @param data The specified array of data to add. + * @param x The x-coordinate accessor. + * @param y The y-coordinate accessor. + */ +export function quadtree(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree; diff --git a/types/d3-quadtree/tsconfig.json b/types/d3-quadtree/tsconfig.json index cbbb70a658..0f4239c3a6 100644 --- a/types/d3-quadtree/tsconfig.json +++ b/types/d3-quadtree/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts index 54ddb5ea11..b99c81e39a 100644 --- a/types/d3-selection/d3-selection-tests.ts +++ b/types/d3-selection/d3-selection-tests.ts @@ -796,7 +796,7 @@ newDiv2 = body.append(function(d, i, g) { const index: number = i; const group: HTMLBodyElement[] | d3Selection.ArrayLike = g; console.log('Body element foo property: ', d.foo); // data of type BodyDatum - return this.ownerDocument.createElement('div'); // this-type HTMLBodyElement + return this.ownerDocument!.createElement('div'); // this-type HTMLBodyElement }); // newDiv2 = body.append(function(d) { @@ -828,7 +828,7 @@ const typeValueFunction = function( i: number, g: HTMLBodyElement[] | d3Selection.ArrayLike ) { - return this.ownerDocument.createElement('p'); // this-type HTMLParagraphElement + return this.ownerDocument!.createElement('p'); // this-type HTMLParagraphElement }; const beforeValueFunction = function( diff --git a/types/d3-selection/index.d.ts b/types/d3-selection/index.d.ts index d1e127dfdf..d9988636fd 100644 --- a/types/d3-selection/index.d.ts +++ b/types/d3-selection/index.d.ts @@ -22,7 +22,7 @@ export type BaseType = Element | EnterElement | Document | Window | null; */ export interface ArrayLike { length: number; - item(index: number): T; + item(index: number): T | null; [index: number]: T; } diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index e668d152f8..8ad3e4809a 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -1184,7 +1184,7 @@ interface SymbolDatum { let customSymbol: d3Shape.SymbolType; customSymbol = { - draw(context: CanvasPathMethods, size: number): void { + draw(context: d3Shape.CanvasPath_D3Shape, size: number): void { // draw custom symbol using canvas path methods } }; diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index 47e5c10feb..83222d0ff0 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -7,6 +7,27 @@ import { Path } from 'd3-path'; +// ----------------------------------------------------------------------------------- +// Shared Types and Interfaces +// ----------------------------------------------------------------------------------- + +/** + * @deprecated + * This interface is used to bridge the gap between two incompatible versions of TypeScript (see [#25944](https://github.com/Microsoft/TypeScript/pull/25944)). + * Use `CanvasPathMethods` instead with TS <= 3.0 and `CanvasPath` with TS >= 3.1. + */ +export interface CanvasPath_D3Shape { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + // ----------------------------------------------------------------------------------- // Arc Generator // ----------------------------------------------------------------------------------- @@ -2264,13 +2285,13 @@ export function linkRadial(): LinkRadial number): this; } +/** + * Represents the union of the Selection and Transition types for any usages that operate on both. + * Typically used for functions which take in either a selection or transition and set or update attributes. + */ +export type SelectionOrTransition = Selection | Transition; + /** * Returns a new transition with the specified name. If a name is not specified, null is used. * The new transition is only exclusive with other transitions of the same name. diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index 8051898b8b..819f344422 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -166,7 +166,7 @@ svgZoom = svgZoom.touchable(true); svgZoom = svgZoom.touchable(function(d, i, group) { const that: SVGRectElement = this; const datum: SVGDatum = d; - const g: SVGRectElement[] | NodeListOf = group; + const g: SVGRectElement[] | ArrayLike = group; return "ontouchstart" in this && datum.height > 0; }); diff --git a/types/d3/v3/index.d.ts b/types/d3/v3/index.d.ts index 9a2f9ae34a..9f32212f6b 100644 --- a/types/d3/v3/index.d.ts +++ b/types/d3/v3/index.d.ts @@ -3277,7 +3277,7 @@ declare namespace d3 { round(round: boolean): Treemap; sticky(): boolean; - sticky(sticky: boolean): boolean; + sticky(sticky: boolean): Treemap; mode(): string; mode(mode: "squarify"): Treemap; diff --git a/types/dat.gui/index.d.ts b/types/dat.gui/index.d.ts index 967b5ae13b..5c20fd51fe 100644 --- a/types/dat.gui/index.d.ts +++ b/types/dat.gui/index.d.ts @@ -51,8 +51,7 @@ export class GUI { __folders: GUI[]; domElement: HTMLElement; - add(target: Object, propName:string): GUIController; - add(target: Object, propName:string, min: number, max: number): GUIController; + add(target: Object, propName:string, min?: number, max?: number, step?: number): GUIController; add(target: Object, propName:string, status: boolean): GUIController; add(target: Object, propName:string, items:string[]): GUIController; add(target: Object, propName:string, items:number[]): GUIController; @@ -64,6 +63,7 @@ export class GUI { destroy(): void; addFolder(propName:string): GUI; + removeFolder(subFolder:GUI):void; open(): void; close(): void; diff --git a/types/datatables.net-scroller/datatables.net-scroller-tests.ts b/types/datatables.net-scroller/datatables.net-scroller-tests.ts new file mode 100644 index 0000000000..cb93306ba0 --- /dev/null +++ b/types/datatables.net-scroller/datatables.net-scroller-tests.ts @@ -0,0 +1,13 @@ +$(document).ready(() => { + const config: DataTables.Settings = { + // Scroller extension options + scroller: { + trace: true, + rowHeight: 30, + serverWait: 1000, + displayBuffer: 10, + boundaryScale: 0.6, + loadingIndicator: true + } + }; +}); diff --git a/types/datatables.net-scroller/index.d.ts b/types/datatables.net-scroller/index.d.ts new file mode 100644 index 0000000000..fe97507712 --- /dev/null +++ b/types/datatables.net-scroller/index.d.ts @@ -0,0 +1,106 @@ +// Type definitions for datatables.net-scroller 1.4 +// Project: https://datatables.net +// Definitions by: Konstantin Rohde +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * Select extension options + */ + scroller?: boolean | ScrollerSettings; + } + + interface ScrollerSettings { + /* + * Indicate if Scroller show show trace information on the console or not. + */ + trace?: boolean; + + /* + * Scroller will attempt to automatically calculate the height of rows for it's internal + * calculations. However the height that is used can be overridden using this parameter. + */ + rowHeight?: number | string; + + /* + * When using server-side processing, Scroller will wait a small amount of time to allow + * the scrolling to finish before requesting more data from the server. + */ + serverWait?: number; + + /* + * The display buffer is what Scroller uses to calculate how many rows it should pre-fetch + * for scrolling. + */ + displayBuffer?: number; + + /* + * Scroller uses the boundary scaling factor to decide when to redraw the table - which it + * typically does before you reach the end of the currently loaded data set (in order to + * allow the data to look continuous to a user scrolling through the data). + */ + boundaryScale?: number; + + /* + * Show (or not) the loading element in the background of the table. Note that you should + * include the dataTables.scroller.css file for this to be displayed correctly. + */ + loadingIndicator?: boolean; + } + + interface Api { + scroller: ScrollerMethodsModel; + } + + interface ScrollerMethodsModel { + /* + * Calculate and store information about how many rows are to be displayed + * in the scrolling viewport, based on current dimensions in the browser's + * rendering. + */ + measure(redraw?: boolean): Api; + /* + * Get information about current displayed record range. + */ + page(): PageInfo; + /* + * Get Scroller Api + */ + scroller(): ScrollerMethods; + } + + interface ScrollerMethods extends Api { + /* + * Calculate the pixel position from the top of the scrolling container for + * a given row + */ + rowToPixels(rowIdx: number, intParse?: boolean, virtual?: boolean): number; + /* + * Calculate the row number that will be found at the given pixel position + * (y-scroll). + */ + pixelsToRow(pixels: number, intParse?: boolean, virtual?: boolean): number; + scrollToRow(rowIdx: number, animate?: boolean): Api; + } + + /* + * start: {int}, // the 0-indexed record at the top of the viewport + * end: {int}, // the 0-indexed record at the bottom of the viewport + */ + interface PageInfo { + start: number; + end: number; + } + + interface RowMethods { + /** + * Scroll to a row + */ + scrollTo(animate?: boolean): Api; + } +} diff --git a/types/react-dnd-html5-backend/tsconfig.json b/types/datatables.net-scroller/tsconfig.json similarity index 84% rename from types/react-dnd-html5-backend/tsconfig.json rename to types/datatables.net-scroller/tsconfig.json index dca11ac9e1..29e1854557 100644 --- a/types/react-dnd-html5-backend/tsconfig.json +++ b/types/datatables.net-scroller/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "react-dnd-html5-backend-tests.ts" + "datatables.net-scroller-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/datatables.net-scroller/tslint.json b/types/datatables.net-scroller/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-scroller/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index 423dcaf4c9..de739a673a 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -1002,6 +1002,9 @@ const static_6 = new $.fn.dataTable.Api("selector"); const version: boolean = $.fn.dataTable.versionCheck("1.10.0"); const isDataTable: boolean = $.fn.dataTable.isDataTable("selector"); +const isDataTable_3: boolean = $.fn.dataTable.isDataTable(dt.row("selector").node()); +const isDataTable_2: boolean = $.fn.dataTable.isDataTable($("selector")); +const isDataTable_4: boolean = $.fn.dataTable.isDataTable($("selector").dataTable().api()); const escapeRegex: string = $.fn.dataTable.util.escapeRegex(""); const throttle_1 = $.fn.dataTable.util.throttle((data) => { @@ -1070,3 +1073,92 @@ const util_1: boolean = dt.any(); const util_2: number = dt.count(); //#endregion "Methods-Util" + +//#region "ExtSettings" + +const ext_classes_settings: DataTables.ExtClassesSettings = { +}; +const ext_classes_settings_full: DataTables.ExtClassesSettings = { + sFilter: "", + sFilterInput: "", + sFooterTH: "", + sHeaderTH: "", + sInfo: "", + sJUIFooter: "", + sJUIHeader: "", + sLength: "", + sLengthSelect: "", + sNoFooter: "", + sPageButton: "", + sPageButtonActive: "", + sPageButtonDisabled: "", + sPaging: "", + sProcessing: "", + sRowEmpty: "", + sScrollBody: "", + sScrollFoot: "", + sScrollFootInner: "", + sScrollHead: "", + sScrollHeadInner: "", + sScrollWrapper: "", + sSortable: "", + sSortableAsc: "", + sSortableDesc: "", + sSortableNone: "", + sSortAsc: "", + sSortColumn: "", + sSortDesc: "", + sSortIcon: "", + sSortJUI: "", + sSortJUIAsc: "", + sSortJUIAscAllowed: "", + sSortJUIDesc: "", + sSortJUIDescAllowed: "", + sSortJUIWrapper: "", + sStripeEven: "", + sStripeOdd: "", + sTable: "", + sWrapper: "" +}; + +const ext_type_settings: DataTables.ExtTypeSettings = { + detect: [], + search: {}, + order: {} +}; +ext_type_settings.detect.push((d: string, s: DataTables.Settings) => { + return null; +}); +ext_type_settings.detect.push((d: string, s: DataTables.Settings) => { + return ""; +}); + +const ext_settings: DataTables.ExtSettings = { + aTypes: [], + afnFiltering: [], + afnSortData: {}, + aoFeatures: [], + builder: "", + classes: ext_classes_settings, + errMode: "", + feature: [], + fnVersionCheck: (version: string) => "", + iApiIndex: 0, + internal: {}, + legacy: {}, + oApi: {}, + oJUIClasses: {}, + oPagination: {}, + oSort: {}, + oStdClasses: ext_classes_settings, + ofnSearch: {}, + order: {}, + pager: {}, + renderer: {}, + sVersion: "", + search: [], + selector: {}, + type: ext_type_settings +}; + + //#endregion "ExtSettings" diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index a8f63a999e..ed87028502 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1094,13 +1094,13 @@ declare namespace DataTables { (): JQueryDataTables; /** - * Check is a table node is a DataTable or not + * Check if a table node is a DataTable already or not. * * Usage: * $.fn.dataTable.isDataTable("selector"); - * @param table Selector string for table + * @param table The table to check. */ - isDataTable(table: string): boolean; + isDataTable(table: string | Node | JQuery | Api): boolean; /** * Helpers for `columns.render`. @@ -2026,7 +2026,10 @@ declare namespace DataTables { sVersion: string; search: any[]; selector: object; - type: object; + /** + * Type based plug-ins. + */ + type: ExtTypeSettings; } interface ExtClassesSettings { @@ -2208,4 +2211,36 @@ declare namespace DataTables { sJUIFooter?: string; } //#endregion "ext internal" + + interface ExtTypeSettings { + /** + * Type detection functions for plug-in development. + * + * @see https://datatables.net/manual/plug-ins/type-detection + */ + detect: FunctionExtTypeSettingsDetect[]; + /** + * Type based ordering functions for plug-in development. + * + * @see https://datatables.net/manual/plug-ins/sorting + * @default {} + */ + order: object; + /** + * Type based search formatting for plug-in development. + * + * @default {} + * @example + * $.fn.dataTable.ext.type.search['title-numeric'] = function ( d ) { + * return d.replace(/\n/g," ").replace( /<.*?>/g, "" ); + * } + */ + search: object; + } + + /** + * @param data Data from the column cell to be analysed. + * @param DataTables settings object. + */ + type FunctionExtTypeSettingsDetect = (data: any, settings: Settings) => (string | null); } diff --git a/types/dav/dav-tests.ts b/types/dav/dav-tests.ts new file mode 100644 index 0000000000..b4218494cd --- /dev/null +++ b/types/dav/dav-tests.ts @@ -0,0 +1,250 @@ +import * as dav from "dav"; + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ); + + dav.createAccount({ server: 'http://dav.example.com', xhr }) + .then((account) => { + account.calendars.forEach(() => { + }); + }); + const client = new dav.Client(xhr); + + client.createAccount({ + server: 'http://dav.example.com', + accountType: 'carddav' + }).then((account) => { + account.addressBooks.forEach(() => { + }); + }); +})(); + +(() => { + const client = new dav.Client( + new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ), + { + baseUrl: 'https://mail.mozilla.com' + } + ); + + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: '12345' + }); + + client.send(req, '/calendars/123.ics') + .then(() => { }); +})(); + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'xxx', + password: 'xxx' + }) + ); + + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: '12345' + }); + + xhr.send(req, 'https://mail.mozilla.com/calendars/123.ics') + .then(() => { + }); +})(); + +dav.debug.enabled = true; + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ + username: 'Killer BOB', + password: 'blacklodge' + }) + ); + + const client = new dav.Client(xhr, { baseUrl: 'https://mail.mozilla.com' }); + + const url = 'https://mail.mozilla.com/'; + const req = dav.request.basic({ + method: 'PUT', + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + etag: 'abc123' + }); + + const sandbox = dav.createSandbox(); + client.send(req, url, { sandbox }); + xhr.send(req, url, { sandbox }); + + client.createAccount({ sandbox: {}, server: 'http://dav.example.com' }); + dav.createAccount({ + sandbox: {}, + server: 'http://dav.example.com', + xhr + }); + + let calendar = new dav.Calendar(); + client.createCalendarObject(calendar, { + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + filename: 'test.ics' + }); + dav.createCalendarObject( + calendar, + { + data: 'BEGIN:VCALENDAR\nEND:VCALENDAR', + filename: 'test.ics', + xhr + }); + + let object = new dav.CalendarObject(); + client.updateCalendarObject(object); + dav.updateCalendarObject( + object, + { + xhr + } + ); + + object = new dav.CalendarObject(); + client.deleteCalendarObject(object); + dav.deleteCalendarObject( + object, + { + xhr + } + ); + + calendar = new dav.Calendar(); + client.syncCalendar(calendar, { syncMethod: 'webdav' }); + dav.syncCalendar( + calendar, + { + syncMethod: 'webdav', + xhr + } + ); + + let account = new dav.Account(); + client.syncCaldavAccount(account, { syncMethod: 'webdav' }); + dav.syncCaldavAccount( + account, + { + syncMethod: 'webdav', + xhr + } + ); + + let addressBook = new dav.AddressBook(); + client.createCard(addressBook, { + data: 'BEGIN:VCARD\nEND:VCARD', + filename: 'test.vcf' + }); + dav.createCard(addressBook, + { + data: 'BEGIN:VCARD\nEND:VCARD', + filename: 'test.vcf', + xhr + }); + + let vcard = new dav.VCard(); + client.updateCard(vcard); + dav.updateCard( + vcard, + { + xhr + } + ); + vcard = new dav.VCard(); + client.deleteCard(vcard); + dav.deleteCard( + vcard, + { + xhr + }); + + addressBook = new dav.AddressBook(); + client.syncAddressBook(addressBook, { + syncMethod: 'basic' + }); + + dav.syncAddressBook( + addressBook, + { + syncMethod: 'basic', + xhr + }); + + account = new dav.Account(); + client.syncCarddavAccount(account, { syncMethod: 'basic' }); + + dav.syncCarddavAccount( + account, + { + syncMethod: 'basic', + xhr + }); +})(); + +(() => { + const xhr = new dav.transport.Basic( + new dav.Credentials({ username: 'admin', password: 'admin' }) + ); + + const req: dav.Request = { + method: 'GET', + transformRequest: (xhr: any) => xhr + }; + + const sandbox = dav.createSandbox(); + xhr.send(req, 'http://127.0.0.1:1337', { sandbox }); + sandbox.requestList; + + xhr.send(req, 'http://127.0.0.1:1337'); +})(); + +(() => { + const credentials = new dav.Credentials({ + clientId: '605300196874-1ki833poa7uqabmh3hq' + + '6u1onlqlsi54h.apps.googleusercontent.com', + clientSecret: 'jQTKlOhF-RclGaGJot3HIcVf', + redirectUrl: 'https://oauth.gaiamobile.org/authenticated', + tokenUrl: 'https://accounts.google.com/o/oauth2/token', + authorizationCode: 'gareth' + }); + + const xhr = new dav.transport.OAuth2(credentials); + + const req = { method: 'GET' }; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = '1/oPHTPFgECWFPrs7KgHdis24u6Xl4E4EnRrkkiwLfzdk'; + credentials.expiration = Date.now() - 1; + + xhr.send(req, 'http://127.0.0.1:1337', { + retry: false + }); + + credentials.accessToken = 'Little Bear'; + credentials.refreshToken = 'spicy tamales'; + const expiration = credentials.expiration = Date.now() + 60 * 60 * 1000; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = 'raspberry pie'; + credentials.expiration = Date.now() + 60 * 60 * 1000; + + credentials.accessToken = 'EXPIRED'; + credentials.refreshToken = 'soda'; +})(); diff --git a/types/dav/index.d.ts b/types/dav/index.d.ts new file mode 100644 index 0000000000..063cc38e60 --- /dev/null +++ b/types/dav/index.d.ts @@ -0,0 +1,804 @@ +// Type definitions for dav 1.7 +// Project: https://github.com/lambdabaa/dav/ +// Definitions by: ToastHawaii +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export let version: string; + +/** + * Perform an initial download of a caldav or carddav account's data. + * @param options + * @returns a Promise which will be fulfilled with a dav.Account object. + */ +export function createAccount(options: CreateAccountOptions): Promise; + +export interface CreateAccountOptions { + /** + * one of 'caldav' or 'carddav'. Defaults to 'caldav'. + */ + accountType?: "caldav" | "carddav"; + + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * whether or not to load dav collections. + */ + loadCollections?: boolean; + + /** + * whether or not to load dav objects. + */ + loadObjects?: boolean; + + /** + * request sandox. + */ + sandbox?: Sandbox | {}; + + /** + * some url for server (needn't be base url). + */ + server: string; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + + xhr?: transport.Transport; +} + +/** + * Create a calendar object on the parameter calendar. + * @param calendar the calendar to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been created. + */ +export function createCalendarObject(calendar: Calendar, options: CreateCalendarObjectOptions): Promise; + +export interface CreateCalendarObjectOptions { + /** + * rfc 5545 VCALENDAR object. + */ + data: string; + + /** + * name for the calendar ics file. + */ + filename: string; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Persist updates to the parameter calendar object to the server. + * @param calendarObject updated calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been updated. + */ +export function updateCalendarObject(calendarObject: CalendarObject, options: UpdateCalendarObjectOptions): Promise; + +export interface UpdateCalendarObjectOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Delete the parameter calendar object on the server. + * @param calendarObject target calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been deleted. + */ +export function deleteCalendarObject(calendarObject: CalendarObject, options: DeleteCalendarObjectOptions): Promise; + +export interface DeleteCalendarObjectOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the parameter calendar. + * @param calendar the calendar to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Calendar object once sync is complete. + */ +export function syncCalendar(calendar: Calendar, options: SyncCalendarOptions): Promise; + +export interface SyncCalendarOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the account's calendars. + * @param account the calendar account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Account object once sync is complete. + */ +export function syncCaldavAccount(account: Account, options: SyncCaldavAccountOptions): Promise; + +export interface SyncCaldavAccountOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Create a vcard object on the parameter address book. + * @param addressBook the address book to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been created. + */ +export function createCard(addressBook: AddressBook, options: CreateCardOptions): Promise; + +export interface CreateCardOptions { + /** + * VCARD object. + */ + data: string; + /** + * name for the vcard vcf file. + */ + filename: string; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Persist updates to the parameter vcard object to the server. + * @param card updated vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been updated. + */ +export function updateCard(card: VCard, options: UpdateCardOptions): Promise; + +export interface UpdateCardOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Delete the parameter vcard object on the server. + * @param card target vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been deleted. + */ +export function deleteCard(card: VCard, options: DeleteCardOptions): Promise; + +export interface DeleteCardOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the parameter address books. + * @param addressBook the address book to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated AddressBook object once sync is complete. + */ +export function syncAddressBook(addressBook: AddressBook, options: SyncAddressBookOptions): Promise; + +export interface SyncAddressBookOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * either 'basic' or 'webdav'.If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Fetch changes from the remote server to the account's address books. + * @param account the address book account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated Account object once sync is complete. + */ +export function syncCarddavAccount(account: Account, options: SyncCarddavAccountOptions): Promise; + +export interface SyncCarddavAccountOptions { + /** + * list of caldav filters to send with request. + */ + filters?: object[]; + + /** + * request sandbox. + */ + sandbox?: Sandbox; + + /** + * either 'basic' or 'webdav'. If unspecified, will try to do webdav sync + * and failover to basic sync if rfc 6578 is not supported by the server. + */ + syncMethod?: "basic" | "webdav"; + + /** + * VTIMEZONE calendar object. + */ + timezone?: string; + + /** + * request sender. + */ + xhr?: transport.Transport; +} + +/** + * Create a request sandbox. + */ +export class Sandbox { + constructor(); + + requestList: any[]; + + add(request: any): void; + + /** + * abort sandboxed requests as a group. + */ + abort(): void; +} + +/** + * @deprecated + */ +export function createSandbox(): Sandbox; + +export namespace transport { + class Transport { + /** + * @param credentials user authorization. + */ + constructor(credentials: Credentials); + + send(request: Request, url: string, options?: TransportOptions): Promise; + } + + interface TransportOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + + retry?: boolean; + } + + class Basic extends Transport { + /** + * Create a new Basic object. This sends dav requests using http basic authentication. + * @param credentials user authorization. + */ + constructor(credentials: Credentials); + + /** + * + * @param request object with request info. + * @param url + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(request: Request, url: string, options?: TransportOptions): Promise; + } + + /** + * Create a new OAuth2 object.This sends dav requests authorized via rfc 6749 oauth2. + * @param credentials user authorization. + */ + class OAuth2 extends Transport { + constructor(credentials: Credentials); + + /** + * + * @param request object with request info. + * @param url + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(request: Request, url: string, options?: TransportOptions): Promise; + } +} + +export namespace request { + /** + * + * @param options + * @returns + */ + function addressBookQuery(options: AddressBookQueryOptions): string; + + interface AddressBookQueryOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + } + + /** + * + * @param options + * @returns + */ + function basic(options: BasicOptions): Request; + + interface BasicOptions { + /** + * put request body. + */ + data: string; + + /** + * http method. + */ + method: string; + + /** + * cached calendar object etag. + */ + etag: string; + } + + /** + * + * @param options + * @returns + */ + function calendarQuery(options: CalendarQueryOptions): string; + + interface CalendarQueryOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of filters to send with request. + */ + filters: object[]; + + /** + * list of props to request. + */ + props: object[]; + + /** + * VTIMEZONE calendar object. + */ + timezone: string; + } + + /** + * + * @param options + * @returns + */ + function propfind(options: PropfindOptions): string; + + interface PropfindOptions { + /** + * value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + } + + /** + * + * @param options + * @returns + */ + function syncCollection(options: SyncCollectionOptions): string; + + interface SyncCollectionOptions { + /** + * option value for Depth header. + */ + depth?: string; + + /** + * list of props to request. + */ + props: object[]; + + /** + * indicates scope of the sync report request. + */ + syncLevel: number; + + /** + * synchronization token provided by the server. + */ + syncToken: string; + } +} + +export class Client { + /** + * Create a new Client object. The client interface allows consumers to set + * their credentials and transport once and then make authorized requests + * without passing them to each request. Each of the other, public API + * methods should be available on Client objects. + * @param xhr request sender. + * @param options + */ + constructor(xhr: transport.Transport, options?: ClientOptions); + + /** + * Send a request using this client's transport (and perhaps baseUrl). + * @param req dav request. + * @param options + * @return a promise that will be resolved with an xhr request after + * its readyState is 4 or the result of applying an optional request + * `transformResponse` function to the xhr object after its readyState + * is 4. + */ + send(req: Request, uri: string, options?: ClientSendOptions): Promise; + + /** + * Perform an initial download of a caldav or carddav account's data. + * @param options + * @returns a Promise which will be fulfilled with a dav.Account object. + */ + createAccount(options?: CreateAccountOptions): Promise; + + /** + * Create a calendar object on the parameter calendar. + * @param calendar the calendar to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been created. + */ + createCalendarObject(calendar: Calendar, options?: CreateCalendarObjectOptions): Promise; + + /** + * Persist updates to the parameter calendar object to the server. + * @param calendarObject updated calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been updated. + */ + updateCalendarObject(calendarObject: CalendarObject, options?: UpdateCalendarObjectOptions): Promise; + + /** + * Delete the parameter calendar object on the server. + * @param calendarObject target calendar object. + * @param options + * @returns a Promise which will be fulfilled when the calendar has been deleted. + */ + deleteCalendarObject(calendarObject: CalendarObject, options?: DeleteCalendarObjectOptions): Promise; + + /** + * Fetch changes from the remote server to the parameter calendar. + * @param calendar the calendar to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Calendar object once sync is complete. + */ + syncCalendar(calendar: Calendar, options?: SyncCalendarOptions): Promise; + + /** + * Fetch changes from the remote server to the account's calendars. + * @param account the calendar account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated dav.Account object once sync is complete. + */ + syncCaldavAccount(account: Account, options?: SyncCaldavAccountOptions): Promise; + + /** + * Create a vcard object on the parameter address book. + * @param addressBook the address book to put the object on. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been created. + */ + createCard(addressBook: AddressBook, options?: CreateCardOptions): Promise; + + /** + * Persist updates to the parameter vcard object to the server. + * @param card updated vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been updated. + */ + updateCard(card: VCard, options?: UpdateCardOptions): Promise; + + /** + * + * Delete the parameter vcard object on the server. + * @param card target vcard object. + * @param options + * @returns a Promise which will be fulfilled when the vcard has been deleted. + */ + deleteCard(card: VCard, options?: DeleteCardOptions): Promise; + + /** + * Fetch changes from the remote server to the parameter address books. + * @param addressBook the address book to fetch changes for. + * @param options + * @returns a Promise which will be fulfilled with an updated AddressBook object once sync is complete. + */ + syncAddressBook(addressBook: AddressBook, options?: SyncAddressBookOptions): Promise; + + /** + * Fetch changes from the remote server to the account's address books. + * @param account the address book account to sync. + * @param options + * @returns a Promise which will be fulfilled with an updated Account object once sync is complete. + */ + syncCarddavAccount(account: Account, options?: SyncCarddavAccountOptions): Promise; +} + +export interface ClientOptions { + /** + * root url to resolve relative request urls with. + */ + baseUrl: string; +} + +export interface ClientSendOptions { + /** + * request sandbox. + */ + sandbox?: Sandbox; + /** + * relative url for request. + */ + url?: string; +} + +export type Partial = { + [P in keyof T]?: T[P]; +}; + +export class Account { + constructor(options?: AccountOptions); + server: string; + credentials: Credentials; + rootUrl: string; + principalUrl: string; + homeUrl: string; + calendars: Calendar[]; + addressBooks: AddressBook[]; +} + +export type AccountOptions = Partial; + +export class Credentials { + constructor(options?: CredentialsOptions); + + /** + * username (perhaps email) for calendar user. + */ + username: string; + + /** + * plaintext password for calendar user. + */ + password: string; + + /** + * oauth client id. + */ + clientId: string; + + /** + * oauth client secret. + */ + clientSecret: string; + + /** + * oauth code. + */ + authorizationCode: string; + + /** + * oauth redirect url. + */ + redirectUrl: string; + + /** + * oauth token url. + */ + tokenUrl: string; + + /** + * oauth access token. + */ + accessToken: string; + + /** + * oauth refresh token. + */ + refreshToken: string; + + /** + * unix time for access token expiration. + */ + expiration: number; +} +export type CredentialsOptions = Partial; + +export class DAVCollection { + constructor(options: DAVCollectionOptions); + data: string; + objects: T[]; + account: Account; + ctag: string; + description: string; + displayName: string; + reports: string[]; + resourcetype: string; + syncToken: string; + url: string; +} +export type DAVCollectionOptions = Partial>; + +export class AddressBook extends DAVCollection { + constructor(options?: AddressBookOptions); +} +export type AddressBookOptions = Partial; + +export class Calendar extends DAVCollection { + constructor(options?: CalendarOptions); + + components: string[]; + timezone: string; +} +export type CalendarOptions = Partial; + +export class DAVObject { + constructor(options: DAVObjectOptions); + data: string; + etag: string; + url: string; +} +export type DAVObjectOptions = Partial; + +export class CalendarObject extends DAVObject { + constructor(options?: CalendarObjectOptions); + calendar: Calendar; + calendarData: string; +} +export type CalendarObjectOptions = Partial; + +export class VCard extends DAVObject { + constructor(options?: VCardOptions); + addressBook: AddressBook; + addressData: string; +} + +export type VCardOptions = Partial; + +export class Request { + constructor(options?: RequestOptions); + method: string; + requestData?: string; + transformRequest?: (xhr: any) => any; + transformResponse?: (xhr: any) => any; + onerror?: (error: Error) => any; +} + +export type RequestOptions = Partial; + +export namespace debug { + let enabled: boolean; +} + +export namespace ns { + const CALENDAR_SERVER = 'http://calendarserver.org/ns/'; + const CALDAV_APPLE = 'http://apple.com/ns/ical/'; + const CALDAV = 'urn:ietf:params:xml:ns:caldav'; + const CARDDAV = 'urn:ietf:params:xml:ns:carddav'; + const DAV = 'DAV:'; +} diff --git a/types/dav/tsconfig.json b/types/dav/tsconfig.json new file mode 100644 index 0000000000..344edfe56a --- /dev/null +++ b/types/dav/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dav-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dav/tslint.json b/types/dav/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/dav/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/db-migrate-base/index.d.ts b/types/db-migrate-base/index.d.ts index a881fa6a06..c1c9189a50 100644 --- a/types/db-migrate-base/index.d.ts +++ b/types/db-migrate-base/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/db-migrate-base // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/db-migrate-pg/index.d.ts b/types/db-migrate-pg/index.d.ts index 09cba26317..71726463e4 100644 --- a/types/db-migrate-pg/index.d.ts +++ b/types/db-migrate-pg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/db-migrate/pg // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as pg from "pg"; import * as DbMigrateBase from "db-migrate-base"; diff --git a/types/dc/dc-tests.ts b/types/dc/dc-tests.ts index 643594276d..7e1a49727e 100644 --- a/types/dc/dc-tests.ts +++ b/types/dc/dc-tests.ts @@ -1,3 +1,8 @@ +import * as CrossFilter from 'crossfilter'; +import * as d3 from "d3"; +import * as dc from "dc"; + + interface IYelpData { city: string; review_count: number; diff --git a/types/dc/index.d.ts b/types/dc/index.d.ts index 4ba0e5e4ab..9100acdc26 100644 --- a/types/dc/index.d.ts +++ b/types/dc/index.d.ts @@ -5,10 +5,6 @@ // matthias jobst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// this makes only sense together with d3 and crossfilter so you need the d3.d.ts and crossfilter.d.ts files - -/// - import * as d3 from "d3"; export = dc; diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index 6281802d36..007ccc30a4 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -1,16 +1,20 @@ -import * as ddTrace from 'dd-trace'; +import * as tracer from 'dd-trace'; import SpanContext = require('dd-trace/src/opentracing/span_context'); -const tracer = ddTrace.init({ +tracer.init({ service: 'MyLovelyService', hostname: 'localhost', port: 8126, + logger: { + debug: msg => { }, + error: err => { } + } }); tracer .trace('web.request', { service: 'my_service', - childOf: new SpanContext({ traceId: 1337, spanId: 42 }), + childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // Childof must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 tags: { env: 'dev' } @@ -19,3 +23,13 @@ tracer span.setTag('my_tag', 'my_value'); span.finish(); }); + +const parentScope = tracer.scopeManager().active(); +const span = tracer.startSpan('memcached', { + childOf: parentScope && parentScope.span(), + tags: { + 'service.name': 'my-memcached', + 'resource.name': 'get', + 'span.type': 'memcached', + }, +}); diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index 7ce1e89b09..a6bbe7dde9 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for dd-trace-js 0.2 +// Type definitions for dd-trace-js 0.5 // Project: https://github.com/DataDog/dd-trace-js // Definitions by: Colin Bradley +// Eloy Durán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import Tracer = require('./src/opentracing/tracer'); -import Span = require('./src/opentracing/span'); -import SpanContext = require('./src/opentracing/span_context'); +import { Tracer, Span, SpanContext } from "opentracing"; +import DatadogSpanContext = require('./src/opentracing/span_context'); declare var trace: TraceProxy; export = trace; @@ -42,6 +42,11 @@ declare class TraceProxy extends Tracer { * @returns The current span or null if outside a trace context. */ currentSpan(): Span | null; + + /** + * Get the scope manager to manager context propagation for the tracer. + */ + scopeManager(): ScopeManager; } interface TracerOptions { @@ -91,6 +96,16 @@ interface TracerOptions { * @default true */ plugins?: boolean; + + /** + * Custom logger to be used by the tracer (if debug = true), + * should support debug() and error() methods + * see https://datadog.github.io/dd-trace-js/#custom-logging__anchor + */ + logger?: { + debug: (message: string) => void + error: (err: Error) => void + }; } interface ExperimentalOptions { @@ -129,11 +144,44 @@ interface TraceOptions { /** * The parent span or span context for the new span. Generally this is not needed as it will be * fetched from the current context. + * If creating your own, this must be an instance of DatadogSpanContext from ./src/opentracing/span_context + * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 */ - childOf?: Span | SpanContext; + childOf?: Span | SpanContext | DatadogSpanContext; /** * Global tags that should be assigned to every span. */ - tags?: { [key: string]: any; } | string; + tags?: { [key: string]: any } | string; +} + +declare class ScopeManager { + /** + * Get the current active scope or null if there is none. + * + * @todo The dd-trace source returns null, but opentracing's childOf span + * option is typed as taking undefined or a scope, so using undefined + * here instead. + */ + active(): Scope | undefined; + + /** + * Activate a new scope wrapping the provided span. + * + * @param span The span for which to activate the new scope. + * @param finishSpanOnClose Whether to automatically finish the span when the scope is closed. + */ + activate(span: Span, finishSpanOnClose?: boolean): Scope; +} + +declare class Scope { + /** + * Get the span wrapped by this scope. + */ + span(): Span; + + /** + * Close the scope, and finish the span if the scope was created with `finishSpanOnClose` set to true. + */ + close(): void; } diff --git a/types/dd-trace/package.json b/types/dd-trace/package.json new file mode 100644 index 0000000000..90deb3c97b --- /dev/null +++ b/types/dd-trace/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "opentracing": ">=0.14.1" + } +} diff --git a/types/dd-trace/src/opentracing/reference.d.ts b/types/dd-trace/src/opentracing/reference.d.ts deleted file mode 100644 index 57def49166..0000000000 --- a/types/dd-trace/src/opentracing/reference.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import Span = require('./span'); -import SpanContext = require('./span_context'); - -declare class Reference { - /** - * @return The Reference type (e.g., REFERENCE_CHILD_OF or - * REFERENCE_FOLLOWS_FROM). - */ - type(): string; - - /** - * @return The SpanContext being referred to (e.g., the - * parent in a REFERENCE_CHILD_OF Reference). - */ - referencedContext(): SpanContext; - - /** - * Initialize a new Reference instance. - * - * @param type - the Reference type constant (e.g., - * REFERENCE_CHILD_OF or REFERENCE_FOLLOWS_FROM). - * @param referencedContext - the SpanContext being referred - * to. As a convenience, a Span instance may be passed in instead - * (in which case its .context() is used here). - */ - constructor(type: string, referencedContext: SpanContext | Span); -} - -export = Reference; \ No newline at end of file diff --git a/types/dd-trace/src/opentracing/span.d.ts b/types/dd-trace/src/opentracing/span.d.ts deleted file mode 100644 index e61a611efd..0000000000 --- a/types/dd-trace/src/opentracing/span.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import Tracer = require('./tracer'); -import SpanContext = require('./span_context'); - -declare class Span { - /** - * Returns the SpanContext object associated with this Span. - */ - context(): SpanContext; - - /** - * Returns the Tracer object used to create this Span. - */ - tracer(): Tracer; - - /** - * Sets the string name for the logical operation this span represents. - */ - setOperationName(name: string): this; - - /** - * Sets a key:value pair on this Span that also propagates to future - * children of the associated Span. - * - * setBaggageItem() enables powerful functionality given a full-stack - * opentracing integration (e.g., arbitrary application data from a web - * client can make it, transparently, all the way into the depths of a - * storage system), and with it some powerful costs: use this feature with - * care. - * - * IMPORTANT NOTE #1: setBaggageItem() will only propagate baggage items to - * *future* causal descendants of the associated Span. - * - * IMPORTANT NOTE #2: Use this thoughtfully and with care. Every key and - * value is copied into every local *and remote* child of the associated - * Span, and that can add up to a lot of network and cpu overhead. - */ - setBaggageItem(key: string, value: string): this; - - /** - * Returns the value for a baggage item given its key. - * - * @param key - * The key for the given trace attribute. - * @return String value for the given key, or undefined if the key does not - * correspond to a set trace attribute. - */ - getBaggageItem(key: string): string | undefined; - - /** - * Adds a single tag to the span. See `addTags()` for details. - */ - setTag(key: string, value: any): this; - - /** - * Adds the given key value pairs to the set of span tags. - * - * Multiple calls to addTags() results in the tags being the superset of - * all calls. - * - * The behavior of setting the same key multiple times on the same span - * is undefined. - * - * The supported type of the values is implementation-dependent. - * Implementations are expected to safely handle all types of values but - * may choose to ignore unrecognized / unhandle-able values (e.g. objects - * with cyclic references, function objects). - */ - addTags(keyValueMap: { - [key: string]: any; - }): this; - - /** - * Add a log record to this Span, optionally at a user-provided timestamp. - * - * For example: - * - * span.log({ - * size: rpc.size(), // numeric value - * URI: rpc.URI(), // string value - * payload: rpc.payload(), // Object value - * "keys can be arbitrary strings": rpc.foo(), - * }); - * - * span.log({ - * "error.description": someError.description(), - * }, someError.timestampMillis()); - * - * @param keyValuePairs - * An object mapping string keys to arbitrary value types. All - * Tracer implementations should support bool, string, and numeric - * value types, and some may also support Object values. - * @param timestamp - * An optional parameter specifying the timestamp in milliseconds - * since the Unix epoch. Fractional values are allowed so that - * timestamps with sub-millisecond accuracy can be represented. If - * not specified, the implementation is expected to use its notion - * of the current time of the call. - */ - - log(keyValuePairs: { - [key: string]: any; - }, timestamp?: number): this; - - /** - * Sets the end timestamp and finalizes Span state. - * - * With the exception of calls to Span.context() (which are always allowed), - * finish() must be the last call made to any span instance, and to do - * otherwise leads to undefined behavior. - * - * @param finishTime - * Optional finish time in milliseconds as a Unix timestamp. Decimal - * values are supported for timestamps with sub-millisecond accuracy. - * If not specified, the current time (as defined by the - * implementation) will be used. - */ - finish(finishTime?: number): void; -} - -export = Span; diff --git a/types/dd-trace/src/opentracing/span_context.d.ts b/types/dd-trace/src/opentracing/span_context.d.ts index 4e3b532649..d966771c2f 100644 --- a/types/dd-trace/src/opentracing/span_context.d.ts +++ b/types/dd-trace/src/opentracing/span_context.d.ts @@ -1,38 +1,28 @@ -/** - * SpanContext represents Span state that must propagate to descendant Spans - * and across process boundaries. - * - * SpanContext is logically divided into two pieces: the user-level "Baggage" - * (see setBaggageItem and getBaggageItem) that propagates across Span - * boundaries and any Tracer-implementation-specific fields that are needed to - * identify or otherwise contextualize the associated Span instance (e.g., a - * tuple). - */ -declare class SpanContext { +import { SpanContext } from 'opentracing'; + +declare class DatadogSpanContext extends SpanContext { /** - * Use to create references to parent spans. + * Used to create references to parent spans. + * See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99 */ constructor(props: SpanContextLike); +} - public traceId: number; +interface SpanContextLike { + traceId: number; - public spanId: number; + spanId: number; - public parentId?: number | null; + parentId?: number | null; - public sampled?: boolean; + sampled?: boolean; - public baggageItems?: { [key: string]: string }; + baggageItems?: { [key: string]: string }; - public trace?: { + trace?: { started: number[], finished: number[] } } -interface SpanContextLike { - traceId: number; - spanId: number; -} - -export = SpanContext; +export = DatadogSpanContext; diff --git a/types/dd-trace/src/opentracing/span_options.d.ts b/types/dd-trace/src/opentracing/span_options.d.ts deleted file mode 100644 index 054d9024d1..0000000000 --- a/types/dd-trace/src/opentracing/span_options.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import Span = require('./span'); -import Reference = require('./reference'); -import SpanContext = require('./span_context'); - -interface SpanOptions { - /** - * a parent SpanContext (or Span, for convenience) that the newly-started - * span will be the child of (per REFERENCE_CHILD_OF). If specified, - * `references` must be unspecified. - */ - childOf?: Span | SpanContext; - - /** - * an array of Reference instances, each pointing to a causal parent - * SpanContext. If specified, `fields.childOf` must be unspecified. - */ - references?: Reference[]; - - /** - * set of key-value pairs which will be set as tags on the newly created - * Span. Ownership of the object is passed to the created span for - * efficiency reasons (the caller should not modify this object after - * calling startSpan). - */ - tags?: { - [key: string]: any; - }; - - /** - * a manually specified start time for the created Span object. The time - * should be specified in milliseconds as Unix timestamp. Decimal value are - * supported to represent time values with sub-millisecond accuracy. - */ - startTime?: number; -} - -export = SpanOptions; diff --git a/types/dd-trace/src/opentracing/tracer.d.ts b/types/dd-trace/src/opentracing/tracer.d.ts deleted file mode 100644 index a40559dbcd..0000000000 --- a/types/dd-trace/src/opentracing/tracer.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import SpanOptions = require('./span_options'); -import Span = require('./span'); -import SpanContext = require('./span_context'); - -/** - * Tracer is the entry-point between the instrumentation API and the tracing - * implementation. - */ -declare class Tracer { - /** - * Starts and returns a new Span representing a logical unit of work. - * - * For example: - * - * // Start a new (parentless) root Span: - * var parent = Tracer.startSpan('DoWork'); - * - * // Start a new (child) Span: - * var child = Tracer.startSpan('load-from-db', { - * childOf: parent.context(), - * }); - * - * // Start a new async (FollowsFrom) Span: - * var child = Tracer.startSpan('async-cache-write', { - * references: [ - * opentracing.followsFrom(parent.context()) - * ], - * }); - * - * @param name - the name of the operation (REQUIRED). - * @param options - options for the newly created span. - * @return A new Span object. - */ - startSpan(name: string, options?: SpanOptions): Span; - - /** - * Injects the given SpanContext instance for cross-process propagation - * within `carrier`. The expected type of `carrier` depends on the value of - * `format. - * - * OpenTracing defines a common set of `format` values (see - * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has - * an expected carrier type. - * - * Consider this pseudocode example: - * - * var clientSpan = ...; - * ... - * // Inject clientSpan into a text carrier. - * var headersCarrier = {}; - * Tracer.inject(clientSpan.context(), Tracer.FORMAT_HTTP_HEADERS, headersCarrier); - * // Incorporate the textCarrier into the outbound HTTP request header - * // map. - * Object.assign(outboundHTTPReq.headers, headersCarrier); - * // ... send the httpReq - * - * @param spanContext - the SpanContext to inject into the - * carrier object. As a convenience, a Span instance may be passed - * in instead (in which case its .context() is used for the - * inject()). - * @param format - the format of the carrier. - * @param carrier - see the documentation for the chosen `format` - * for a description of the carrier object. - */ - inject(spanContext: SpanContext | Span, format: string, carrier: any): void; - - /** - * Returns a SpanContext instance extracted from `carrier` in the given - * `format`. - * - * OpenTracing defines a common set of `format` values (see - * FORMAT_TEXT_MAP, FORMAT_HTTP_HEADERS, and FORMAT_BINARY), and each has - * an expected carrier type. - * - * Consider this pseudocode example: - * - * // Use the inbound HTTP request's headers as a text map carrier. - * var headersCarrier = inboundHTTPReq.headers; - * var wireCtx = Tracer.extract(Tracer.FORMAT_HTTP_HEADERS, headersCarrier); - * var serverSpan = Tracer.startSpan('...', { childOf : wireCtx }); - * - * @param format - the format of the carrier. - * @param carrier - the type of the carrier object is determined by - * the format. - * @return The extracted SpanContext, or null if no such SpanContext could - * be found in `carrier` - */ - extract(format: string, carrier: any): SpanContext | null; -} - -export = Tracer; diff --git a/types/decompress/decompress-tests.ts b/types/decompress/decompress-tests.ts index 9cb8949d99..5ed96c0b46 100644 --- a/types/decompress/decompress-tests.ts +++ b/types/decompress/decompress-tests.ts @@ -19,3 +19,24 @@ decompress('unicorn.zip', 'dist', { }).then((files: decompress.File[]) => { console.log('done!'); }); + +// Test decompress with no output to filesystem +decompress('unicorn.zip') + .then( + (files: decompress.File[]) => { + console.log(`Decompressed ${files.length} files with no write to filesystem`); + } + ); + +// Test decompress with DecompressOptions as second argument +decompress( + 'unicorn.zip', + { + filter: file => path.extname(file.path) !== '.exe' + } +) + .then( + (files: decompress.File[]) => { + console.log(`Decompressed ${files.length} files with filter options`); + } + ); diff --git a/types/decompress/index.d.ts b/types/decompress/index.d.ts index 745bebcd2e..2c4f464558 100644 --- a/types/decompress/index.d.ts +++ b/types/decompress/index.d.ts @@ -1,13 +1,14 @@ // Type definitions for decompress 4.2 // Project: https://github.com/kevva/decompress#readme // Definitions by: York Yao +// Jesse Bethke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export = decompress; -declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise; +declare function decompress(input: string | Buffer, output?: string | decompress.DecompressOptions, opts?: decompress.DecompressOptions): Promise; declare namespace decompress { interface File { diff --git a/types/deluge/deluge-tests.ts b/types/deluge/deluge-tests.ts new file mode 100644 index 0000000000..2ba8088915 --- /dev/null +++ b/types/deluge/deluge-tests.ts @@ -0,0 +1,23 @@ +import deluge = require("deluge"); +import * as http from 'http'; + +const delugeInstance: deluge.Deluge = deluge("deluge-webui-api-url", "password"); + +delugeInstance.getHosts((error: string, result: deluge.Host[], response: http.ServerResponse) => { +}); + +delugeInstance.connect("id", (error: string, result: boolean, response: http.ServerResponse) => { +}); + +delugeInstance.add("magnet_link", "path", (error: string, result: boolean, response: http.ServerResponse) => { +}); + +delugeInstance.getTorrentRecord((error: string, result: deluge.TorrentRecord, response: http.ServerResponse) => { +}); + +delugeInstance.isConnected((error: string, result: boolean, response: http.ServerResponse) => { +}); + +delugeInstance.setCookies({ "http://www.some-private-tracker.com/": "my_cookie1=xxx;my_cookie2=yyy;" }, + (error: string, result: boolean, response: http.ServerResponse) => { +}); diff --git a/types/deluge/index.d.ts b/types/deluge/index.d.ts new file mode 100644 index 0000000000..8ca69daedd --- /dev/null +++ b/types/deluge/index.d.ts @@ -0,0 +1,122 @@ +// Type definitions for deluge 1.7 +// Project: https://github.com/ginman86/deluge +// Definitions by: Felix Plymouth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as http from "http"; + +export = deluge; + +declare function deluge(deluge_url: string, password: string): deluge.Deluge; + +declare namespace deluge { + interface Host { + id: string; + ip: string; + port: number; + status: string; + } + + interface DelugeStats { + upload_protocol_rate: number; + max_upload: number; + download_protocol_rate: number; + download_rate: number; + has_incoming_connections: boolean; + num_connections: number; + max_download: number; + upload_rate: number; + dht_nodes: number; + free_space: number; + max_num_connections: number; + } + + interface Torrent { + max_download_speed: number; + upload_payload_rate: number; + download_payload_rate: number; + num_peers: number; + ratio: number; + total_peers: number; + state: string; + max_upload_speed: number; + eta: number; + save_path: string; + progress: number; + time_added: number; + tracker_host: string; + total_uploaded: number; + total_done: number; + total_wanted: number; + total_seeds: number; + seeds_peers_ratio: number; + num_seeds: number; + name: string; + is_auto_managed: boolean; + queue: number; + distributed_copies: number; + } + + interface TorrentRecord { + stats: DelugeStats; + connected: boolean; + torrents: { + [key: string]: Torrent; + }; + filters: { + state: Array<[string, number]>; + tracker_host: Array<[string, number]>; + }; + } + + interface DownloadOptions { + file_priorities: any[]; + add_paused: boolean; + compact_allocation: boolean; + download_location: string; + max_connections: number; + max_download_speed: number; + max_upload_slots: number; + max_upload_speed: number; + prioritize_first_last_pieces: boolean; + } + + interface Deluge { + /** + * Add the torrent to Deluge + * @param magnet + * @param dlPath + * @param callback + */ + add(magnet: string, dlPath: string | DownloadOptions, callback: (error: string, result: boolean, response: http.ServerResponse) => void): void; + /** + * Connect the WebUI to the wanted daemon + * @param hostID + * @param callback + */ + connect(hostID: string, callback: (error: string, result: boolean, response: http.ServerResponse) => void): void; + /** + * Get the list of all the hosts that the WebUI can connect to + * @param callback + */ + getHosts(callback: (error: string, result: Host[], response: http.ServerResponse) => void): void; + /** + * Get the list of all torrents and changing data that represents their status in the WebUI + * @param callback + */ + getTorrentRecord(callback: (error: string, result: TorrentRecord, response: http.ServerResponse) => void): void; + /** + * Check if the WebUI is connected to a deamon. Return true or false as result of the callback. + * @param callback + */ + isConnected(callback: (error: string, result: boolean, response: http.ServerResponse) => void): void; + /** + * Set cookies in COOKIE_JAR, cookies is an object with urls as keys, example: + * {'http://example.org/': 'uid=1234;pass=xxxx;'} + * @object cookies + */ + setCookies(cookies: { [key: string]: string }, callback: (error: string, result: boolean, response: http.ServerResponse) => void): void; + } +} diff --git a/types/deluge/tsconfig.json b/types/deluge/tsconfig.json new file mode 100644 index 0000000000..05deb4bcb2 --- /dev/null +++ b/types/deluge/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes" : true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "deluge-tests.ts" + ] +} diff --git a/types/deluge/tslint.json b/types/deluge/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/deluge/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/detect-node/detect-node-tests.ts b/types/detect-node/detect-node-tests.ts new file mode 100644 index 0000000000..01a81a356b --- /dev/null +++ b/types/detect-node/detect-node-tests.ts @@ -0,0 +1,3 @@ +import isNode = require("detect-node"); + +isNode; diff --git a/types/detect-node/index.d.ts b/types/detect-node/index.d.ts new file mode 100644 index 0000000000..38fd280f1e --- /dev/null +++ b/types/detect-node/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for detect-node 2.0 +// Project: https://github.com/iliakan/detect-node +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare const isNode: boolean; +export = isNode; diff --git a/types/detect-node/tsconfig.json b/types/detect-node/tsconfig.json new file mode 100644 index 0000000000..e853bcf92c --- /dev/null +++ b/types/detect-node/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "detect-node-tests.ts"] +} diff --git a/types/detect-node/tslint.json b/types/detect-node/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/detect-node/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/di/di-tests.ts b/types/di/di-tests.ts new file mode 100644 index 0000000000..4cfd3de5e7 --- /dev/null +++ b/types/di/di-tests.ts @@ -0,0 +1,21 @@ +import * as di from "di"; + +const emptyInjector = new di.Injector(); +const moduleSpecifications = [{}]; +const fullInjector = new di.Injector(moduleSpecifications); +const childInjector = new di.Injector(moduleSpecifications, emptyInjector); + +const dep: {} = fullInjector.get('foo'); + +const factory = (context: {}, deps: Array<{}>) => { + return {}; +}; + +const invoked: {} = fullInjector.invoke(factory, {}); + +const oldTimeyClass = {prototype: {}}; + +const instance: {} = fullInjector.instantiate(oldTimeyClass); + +const anotherChildInjector: di.Injector = + fullInjector.createChild(moduleSpecifications); diff --git a/types/di/index.d.ts b/types/di/index.d.ts new file mode 100644 index 0000000000..ea1d596017 --- /dev/null +++ b/types/di/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for di 0.0 +// Project: https://github.com/vojtajina/node-di +// Definitions by: John J Barton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +export class Injector { + get(dep: string): {}; + invoke(fn: (context: {}, deps: Array<{}>) => {}, context: {}): {}; + instantiate({prototype: {}}): {}; + createChild(modules: Array<{}>): Injector; + constructor(modules?: Array<{}>, parent?: Injector); +} diff --git a/types/di/tsconfig.json b/types/di/tsconfig.json new file mode 100644 index 0000000000..c7e591ab5a --- /dev/null +++ b/types/di/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "di-tests.ts" + ] +} diff --git a/types/di/tslint.json b/types/di/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/di/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dialogflow/dialogflow-tests.ts b/types/dialogflow/dialogflow-tests.ts new file mode 100644 index 0000000000..42d905839e --- /dev/null +++ b/types/dialogflow/dialogflow-tests.ts @@ -0,0 +1,10 @@ +import * as dialogflow from "dialogflow"; + +const agentsClient = new dialogflow.AgentsClient(); +const contextsClient = new dialogflow.ContextsClient(); +const entityTypesClient = new dialogflow.EntityTypesClient(); +const intentsClient = new dialogflow.IntentsClient(); +const sessionEntityTypesClient = new dialogflow.SessionEntityTypesClient(); +const sessionsClient = new dialogflow.SessionsClient(); + +// TODO: Add real significant tests diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts new file mode 100644 index 0000000000..c847b662c2 --- /dev/null +++ b/types/dialogflow/index.d.ts @@ -0,0 +1,927 @@ +// Type definitions for dialogflow 0.6 +// Project: https://github.com/dialogflow/dialogflow-nodejs-client-v2#readme +// Definitions by: Daniel Dyla +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export namespace v2 { + class AgentsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + getAgent( + request: GetAgentRequest, + options?: gax.CallOptions, + cb?: (err: Error, agent: Agent) => void + ): Promise<[Agent]>; + searchAgents( + request: SearchAgentRequest, + options?: gax.CallOptions, + cb?: ( + err: Error, + agents: Agent[], + arg3: any, + response: any + ) => void + ): Promise; + searchAgentsStream( + request: SearchAgentRequest, + options?: gax.CallOptions + ): any; + trainAgent( + request: TrainAgentRequest, + options?: gax.CallOptions, + cb?: (err: Error, operation: gax.Operation) => void + ): Promise<[gax.Operation]>; + exportAgent( + request: ExportAgentRequest, + options?: gax.CallOptions, + cb?: (err: Error, operation: gax.Operation) => void + ): Promise<[gax.Operation]>; + importAgent( + request: ImportAgentRequest, + options?: gax.CallOptions, + cb?: (err: Error, operation: gax.Operation) => void + ): Promise<[gax.Operation]>; + restoreAgent( + request: RestoreAgentRequest, + options?: gax.CallOptions, + cb?: (err: Error, operation: gax.Operation) => void + ): Promise<[gax.Operation]>; + } + + class ContextsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listContexts( + request: ListContextsRequest, + options?: gax.CallOptions + ): Promise<[Context[]]>; + listContextsStream( + request: ListContextsRequest, + options?: gax.CallOptions + ): any; + getContext( + request: GetContextRequest, + options?: gax.CallOptions + ): Promise<[Context]>; + createContext( + request: CreateContextReqeust, + options?: gax.CallOptions + ): Promise<[Context]>; + updateContext( + request: UpdateContextRequest, + options?: gax.CallOptions + ): Promise<[Context]>; + deleteContext( + request: DeleteContextRequest, + options?: gax.CallOptions + ): Promise; + deleteAllContexts( + request: DeleteAllContextsRequest, + options?: gax.CallOptions + ): Promise; + + sessionPath(project: string, session: string): string; + contextPath(project: string, session: string, context: string): string; + + matchProjectFromContextName(name: string): string; + matchSessionFromContextName(name: string): string; + matchContextFromContextName(name: string): string; + + matchProjectFromSessionName(name: string): string; + matchSessionFromSessionName(name: string): string; + } + + class EntityTypesClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listEntityTypes( + request: ListEntityTypesRequest, + options?: gax.CallOptions + ): Promise<[EntityType[]]>; + + listEntityTypesStream( + request: ListEntityTypesRequest, + options?: gax.CallOptions + ): any; + + getEntityType( + request: GetEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + createEntityType( + request: CreateEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + updateEntityType( + request: UpdateEntityTypeRequest, + options?: gax.CallOptions + ): Promise<[EntityType]>; + deleteEntityType( + request: DeleteEntityTypeRequest, + options?: gax.CallOptions + ): Promise; + + // TODO: add batch style calls + // batchUpdateEntityTypes + // batchDeleteEntityTypes + // batchCreateEntities + // batchUpdateEntities + // batchDeleteEntities + + projectAgentPath(project: string): string; + entityTypePath(project: string, entityType: string): string; + matchProjectFromProjectAgentName(entityTypeName: string): string; + matchProjectFromEntityTypeName(entityTypeName: string): string; + matchEntityTypeFromEntityTypeName(entityTypeName: string): string; + } + + class IntentsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + listIntents( + request: ListIntentsRequest, + options?: gax.CallOptions + ): Promise<[Intent[]]>; + getIntent( + request: GetIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + createIntent( + request: CreateIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + updateIntent( + request: UpdateIntentRequest, + options?: gax.CallOptions + ): Promise<[Intent]>; + deleteIntent( + request: DeleteIntentRequest, + options?: gax.CallOptions + ): Promise; + + // TODO: add batch style calls + // batchUpdateIntents(request: BatchUpdateIntentsRequest): void; + // batchDeleteIntents(request: BatchDeleteIntentsRequest): void; + + projectAgentPath(project: string): string; + intentPath(project: string, intent: string): string; + agentPath(project: string, agent: string): string; + + matchProjectFromProjectAgentName(projectAgentName: string): string; + matchProjectFromIntentName(intentName: string): string; + matchIntentFromIntentName(intentName: string): string; + matchProjectFromAgentName(agentName: string): string; + matchAgentFromAgentName(agentName: string): string; + } + + class SessionEntityTypesClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + // TODO: add Session Entity Types service methods + } + + class SessionsClient { + constructor(options?: ClientOptions); + + servicePath: string; + port: number; + scopes: string[]; + + getProjectId(): Promise; + getProjectId(callback?: (error: Error, id: string) => string): void; + + detectIntent( + request: DetectIntentRequest, + options?: gax.CallOptions + ): Promise; + streamingDetectIntent(options?: gax.CallOptions): Promise; + + sessionPath(projectId: string, sessionId: string): string; + } +} + +export namespace v2beta1 { + class AgentsClient extends v2.AgentsClient {} + class ContextsClient extends v2.ContextsClient { + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string + ): string; + + environmentContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ): string; + + matchProjectFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchUserFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string + ): string; + + matchProjectFromEnvironmentContextName( + environmentContextName: string + ): string; + matchEnvironmentFromEnvironmentContextName( + environmentContextName: string + ): string; + matchUserFromEnvironmentContextName( + environmentContextName: string + ): string; + matchSessionFromEnvironmentContextName( + environmentContextName: string + ): string; + matchContextFromEnvironmentContextName( + environmentContextName: string + ): string; + } + class EntityTypesClient extends v2.EntityTypesClient {} + class IntentsClient extends v2.IntentsClient {} + class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} + class SessionsClient extends v2.SessionsClient { + environmentSessionPath( + project: string, + environment: string, + user: string, + session: string + ): string; + + matchProjectFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchEnvironmentFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchUserFromEnvironmentSessionName( + environmentSessionName: string + ): string; + matchSessionFromEnvironmentSessionName( + environmentSessionName: string + ): string; + } +} + +export class AgentsClient extends v2.AgentsClient {} +export class ContextsClient extends v2.ContextsClient {} +export class EntityTypesClient extends v2.EntityTypesClient {} +export class IntentsClient extends v2.IntentsClient {} +export class SessionEntityTypesClient extends v2.SessionEntityTypesClient {} +export class SessionsClient extends v2.SessionsClient {} + +export namespace entities { + namespace DateTimeVariants { + interface DateTime { + date_time: string; + } + + interface DateTimePeriod { + startDateTime: DateTime; + endDateTime: DateTime; + } + + interface DatePeriod { + startDate: Date; + endDate: Date; + } + interface TimePeriod { + startTime: string; + endTime: string; + } + } + + type DateTime = + | string + | DateTimeVariants.DatePeriod + | DateTimeVariants.TimePeriod + | DateTimeVariants.DateTime + | DateTimeVariants.DateTimePeriod; + + interface Duration { + unit: string; + amount: number; + } + + type Date = string; + + type Time = string; +} + +export namespace gax { + interface BackoffSettings { + initialRetryDelayMillis: number; + retryDelayMultiplier: number; + maxRetryDelayMillis: number; + initialRpcTimeoutMillis: number; + maxRpcTimeoutMillis: number; + totalTimeoutMillis: number; + } + + interface RetryOptions { + retryCodes: string[]; + backoffSettings: BackoffSettings; + } + + interface CallOptions { + timeout?: number; + retry?: RetryOptions; + autoPaginate?: boolean; + pageToken?: any; + isBundling?: boolean; + longrunning?: BackoffSettings; + promise?: PromiseConstructor; + } + + interface Operation { + grpcOp: longrunning.Operation; + longrunningDescriptor: any; + backoffSettings: BackoffSettings; + callOptions?: CallOptions; + } +} + +export namespace longrunning { + type Operation = + | UnfinishedOperation + | FailedOperation + | SuccessfulOperation; + + interface BaseOperation { + name: string; + metadata: any; + done: boolean; + } + + interface UnfinishedOperation extends BaseOperation { + done: false; + } + + interface FailedOperation extends BaseOperation { + done: true; + error: Status; + } + + interface SuccessfulOperation extends BaseOperation { + done: true; + response: any; + } + + interface Status { + code: number; + message: string; + details: any[]; + } +} + +export interface GetAgentRequest { + parent: string; +} + +export interface SearchAgentRequest { + parent: string; + pageSize?: number; +} + +export interface TrainAgentRequest { + parent: string; +} + +export interface ExportAgentRequest { + parent: string; + agentUri?: string; +} + +export interface ImportAgentRequest { + parent: string; + agentUri?: string; + agentContent?: string; +} + +export interface RestoreAgentRequest { + parent: string; + agentUri?: string; + agentContent?: string; +} + +export interface ListContextsRequest { + parent: string; + pageSize?: number; +} + +export interface GetContextRequest { + name: string; +} + +export interface CreateContextReqeust { + parent: string; + context: Context; +} + +export interface UpdateContextRequest { + context: Context; + updatemask?: any; +} + +export interface DeleteContextRequest { + name: string; +} + +export interface DeleteAllContextsRequest { + parent: string; +} + +export interface ListEntityTypesRequest { + parent: string; + languageCode?: string; + pageSize?: number; +} + +export interface GetEntityTypeRequest { + name: string; + languageCode?: string; +} + +export interface CreateEntityTypeRequest { + parent: string; + entityType: EntityType; +} + +export interface UpdateEntityTypeRequest { + entityType: EntityType; + languageCode?: string; + /** @link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto */ + updateMask?: any; +} + +export interface DeleteEntityTypeRequest { + name: string; +} + +export interface ListIntentsRequest { + parent: string; + languageCode?: string; + intentView?: IntentView; + pageSize?: number; +} + +export interface GetIntentRequest { + name: string; + languageCode?: string; + intentView?: IntentView; +} + +export interface CreateIntentRequest { + parent: string; + intent: Intent; + languageCode?: string; + intentView?: IntentView; +} + +export interface UpdateIntentRequest { + intent: Intent; + languageCode?: string; + updateMask?: any; + intentView?: IntentView; +} + +export interface DeleteIntentRequest { + name: string; +} + +export interface DetectIntentRequest { + session: string; + queryInput: QueryInput; + queryParams?: QueryParams; + inputAudio?: any; +} + +export interface DetectIntentResponse { + responseId: string; + queryResult: QueryResult; + webhookStatus: Status; +} + +export interface QueryResult { + queryText: string; + laugnageCode: string; + speechRecognitionConfidence: number; + action: string; + parameters: any; + allRequiredParamsSent: boolean; + fulfillmentText: string; + fulfillmentMessages: Message[]; + webhookSource: string; + webhookPayload: any; + outputContexts: Context[]; + intent: Intent; + intentDetectionConfidence: number; + diagnosticInfo: any; +} + +export interface Status { + code: StatusCode; + message: string; + details: any[]; +} + +export enum StatusCode { + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + OK = 0, + + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + CANCELLED = 1, + + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2, + + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3, + + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4, + + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + NOT_FOUND = 5, + + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6, + + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7, + + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16, + + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8, + + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9, + + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + ABORTED = 10, + + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11, + + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12, + + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + INTERNAL = 13, + + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14, + + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15 +} + +export interface Agent { + parent: string; + displayName: string; + defaultLanguageCode: string; + supportedLanguageCodes?: string[]; + timeZone: string; + description?: string; + avatarUri?: string; + enableLogging?: boolean; + matchMode?: MatchMode; + classificationThreshold?: number; +} + +export interface Context { + name: string; + lifespanCount?: number; + parameters?: any; +} + +export interface EntityType { + name: string; + entities: EntitySynonyms[]; + displayName: string; + kind: EntityKind; + autoExpansionMode: EntityAutoExpansionMode; +} + +export enum MatchMode { + MATCH_MODE_UNSPECIFIED = "MATCH_MODE_UNSPECIFIED", + MATCH_MODE_HYBRID = "MATCH_MODE_HYBRID", + MATCH_MODE_ML_ONLY = "MATCH_MODE_ML_ONLY" +} + +export interface Credentials { + clientEmail?: string; + privateKey?: string; +} + +export interface ClientOptions { + credentials?: Credentials; + email?: string; + keyFilename?: string; + port?: number; + projectId?: string; + promise?: PromiseConstructor; + servicePath?: string; +} + +export interface EntitySynonyms { + synonyms: string[]; + value: string; +} + +export enum EntityKind { + KIND_MAP = "KIND_MAP", + KIND_LIST = "KIND_LIST" +} + +export enum EntityAutoExpansionMode { + AUTO_EXPANSION_MODE_DEFAULT = "AUTO_EXPANSION_MODE_DEFAULT", + AUTO_EXPANSION_MODE_UNSPECIFIED = "AUTO_EXPANSION_MODE_UNSPECIFIED" +} + +export enum IntentView { + INTENT_VIEW_UNSPECIFIED = "INTENT_VIEW_UNSPECIFIED", + INTENT_VIEW_FULL = "INTENT_VIEW_FULL" +} + +export interface Intent { + name: string; + displayName: string; + webhookState: string; + priority?: number; + isFallback?: boolean; + mlEnabled?: boolean; + inputContextNames?: string[]; + events?: string[]; + trainingPhrases?: TrainingPhrase[]; + action?: string; + outputContexts?: Context[]; + resetContexts?: boolean; + parameters?: Parameter[]; + messages?: Message[]; + defaultResponsePlatforms?: string[]; + rootFollowupIntentName: string; + parentFollowupIntentName: string; + followupIntentInfo?: FollowupIntentInfo[]; +} + +export interface TrainingPhrase { + name: string; + type: string; + parts: Part[]; + timesAddedCount?: number; +} + +export interface Part { + text: string; + entityType?: string; + alias?: string; + userDefined?: boolean; +} + +export interface Parameter { + name: string; + displayName: string; + value?: string; + defaultValue?: string; + entityTypeDisplayName?: string; + mandatory?: boolean; + prompts?: string[]; + isList?: boolean; +} + +export interface FollowupIntentInfo { + followupIntentName: string; + parentFollowupIntentName: string; +} + +export interface Message { + platform?: string; + text?: Text; + card?: Card; + payload?: any; +} + +export interface Text { + text: string[]; +} + +export interface Card { + title?: string; + subtitle?: string; + imageUri?: string; + buttons?: Button[]; +} + +export interface Button { + text?: string; + postback?: string; +} + +export interface EventInput { + name: string; + languageCode: string; + parameters?: any; +} + +export interface TextInput { + text: string; + languageCode: string; +} + +export interface QueryInput { + text?: TextInput; + event?: EventInput; +} + +export interface QueryParams { + timeZone?: string; + geoLocation?: LatLong; + contexts?: Context[]; + resetContexts?: boolean; + sessionEntityTypes?: SessionEntityType[]; + payload?: any; +} + +export interface LatLong { + latitude: number; + longitude: number; +} + +export interface SessionEntityType { + name: string; + entityOverrideMode: string; + entities: Entity[]; +} + +export interface Entity { + value: string; + synonyms: string[]; +} + +export interface WebhookRequest { + session: string; + responseId: string; + + queryResult: QueryResult; + originalDetectIntentRequest?: any; +} + +export interface WebhookResponse { + fulfillmentText?: string; + fulfillmentMessages?: Message[]; + source?: string; + payload?: any; + outputContexts?: Context[]; + followupEventInput?: EventInput; +} diff --git a/types/dialogflow/tsconfig.json b/types/dialogflow/tsconfig.json new file mode 100644 index 0000000000..366cf28866 --- /dev/null +++ b/types/dialogflow/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dialogflow-tests.ts" + ] +} diff --git a/types/dialogflow/tslint.json b/types/dialogflow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dialogflow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dnssd/dnssd-tests.ts b/types/dnssd/dnssd-tests.ts index 14b637d384..0fa7498bb2 100644 --- a/types/dnssd/dnssd-tests.ts +++ b/types/dnssd/dnssd-tests.ts @@ -1,6 +1,6 @@ import * as dnssd from 'dnssd'; -const serviceType = new dnssd.ServiceType(dnssd.tcp('_mqtt'), dnssd.udp('_mqtt')); +const serviceType = dnssd.ServiceType.tcp('_mqtt', '_mqtt._udp'); const advertisement = new dnssd.Advertisement(serviceType, 1883, { name: 'broker' }); const browser: dnssd.Browser = new dnssd.Browser(serviceType); diff --git a/types/dnssd/index.d.ts b/types/dnssd/index.d.ts index 9c66a6d6a4..8ef8aa84fd 100644 --- a/types/dnssd/index.d.ts +++ b/types/dnssd/index.d.ts @@ -1,30 +1,40 @@ -// Type definitions for dnssd 0.3 +// Type definitions for dnssd 0.4 // Project: https://github.com/DeMille/dnssd.js#readme // Definitions by: Angel Merino +// Max Rumpf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// import { EventEmitter } from 'events'; /** Declaration file generated by dts-gen */ -export class Advertisement { - constructor(type: any, port: any, ...args: any[]); +export class Advertisement extends EventEmitter { + constructor(type: string | string[] | ServiceType, port: number, ...args: any[]); - start(): any; + start(): Advertisement; - stop(forceImmediate: any, callback: any): void; + stop(forceImmediate?: boolean, callback?: () => any): void; updateTXT(txtObj: any): void; } +export class Options { + name?: string; + host?: string; + txt?: any; + subtypes?: string[]; + interface?: string; +} + /** * A service entry as returned by serviceUp */ export class Service { fullname: string; // 'InstanceName._googlecast._tcp.local.' name: string; // 'InstanceName' - type: SType; // { name: 'googlecast'; protocol: 'tcp' } + type: ServiceType; // { name: 'googlecast'; protocol: 'tcp' } domain: string; // 'local' host: string; // 'Hostname.local.' port: number; // 8009 @@ -33,47 +43,47 @@ export class Service { txtRaw: any; } -export class SType { +export class ServiceType { + constructor(...args: Array) + constructor(args: ServiceType); + name: string; protocol: string; + subtypes: string[]; + + toString(): string; + + static all(): ServiceType; + + static tcp(...args: string[]): ServiceType; + + static udp(...args: string[]): ServiceType; } export class Browser extends EventEmitter { - constructor(type: any, ...args: any[]); + constructor(type: string | string[] | ServiceType, ...args: any[]); - list(): any; + start(): Browser; - start(): any; + stop(): void; - stop(): any; + list(): any[]; } -export class ServiceType { - constructor(...args: any[]); +export function resolve(name: string, type: string, args: object): Promise; - toString(): any; +export function resolve4(name: string, type: string, args: object): Promise; - static all(): any; +export function resolve6(name: string, type: string, args: object): Promise; - static tcp(...args: any[]): any; +export function resolveSRV(name: string, args: object): Promise; - static udp(...args: any[]): any; -} +export function resolveTXT(name: string, args: object): Promise; -export const resolveA: any; +export function resolveService(name: string, args: object): Promise; -export const resolveAAAA: any; +export function tcp(...args: string[]): ServiceType; -export function all(): any; +export function udp(...args: string[]): ServiceType; -export function resolve(name: any, type: any, ...args: any[]): any; - -export function resolveSRV(name: any, opts: any): any; - -export function resolveService(name: any, ...args: any[]): any; - -export function resolveTXT(name: any, opts: any): any; - -export function tcp(...args: any[]): any; - -export function udp(...args: any[]): any; +export function all(): ServiceType; diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 188643dc28..5c1c1bfae6 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -962,11 +962,11 @@ declare class Dockerode { pull(repoTag: string, options: {}, callback: Callback, auth?: {}): Dockerode.Image; pull(repoTag: string, options: {}, auth?: {}): Promise; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, startOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, callback: Callback): events.EventEmitter; - run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions?: {}, startOptions?: {}): Promise; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], startOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, callback: Callback): events.EventEmitter; + run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions?: {}, startOptions?: {}): Promise; swarmInit(options: {}, callback: Callback): void; swarmInit(options: {}): Promise; diff --git a/types/document-ready/document-ready-tests.ts b/types/document-ready/document-ready-tests.ts new file mode 100644 index 0000000000..17c522f1a3 --- /dev/null +++ b/types/document-ready/document-ready-tests.ts @@ -0,0 +1,4 @@ +import ready = require("document-ready"); +ready(() => { + // on load +}); diff --git a/types/document-ready/index.d.ts b/types/document-ready/index.d.ts new file mode 100644 index 0000000000..6d8c6d7499 --- /dev/null +++ b/types/document-ready/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for document-ready 2.0 +// Project: https://github.com/bendrucker/document-ready#readme +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function ready(callback: () => void): void; +export = ready; diff --git a/types/document-ready/tsconfig.json b/types/document-ready/tsconfig.json new file mode 100644 index 0000000000..15ce7ad650 --- /dev/null +++ b/types/document-ready/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "strictFunctionTypes": true, + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "document-ready-tests.ts" + ] +} diff --git a/types/document-ready/tslint.json b/types/document-ready/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/document-ready/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/documentdb/index.d.ts b/types/documentdb/index.d.ts index e7962ba568..118881a378 100644 --- a/types/documentdb/index.d.ts +++ b/types/documentdb/index.d.ts @@ -802,7 +802,7 @@ export class DocumentClient { * @param [options] - Represents the feed options. * @returns - An instance of queryIterator to handle reading feed. */ - queryDocuments(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator; + queryDocuments(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator; /** * Query the triggers for the collection. diff --git a/types/dom-clipboard-api/dom-clipboard-api-tests.ts b/types/dom-clipboard-api/dom-clipboard-api-tests.ts new file mode 100644 index 0000000000..9b0731d8f4 --- /dev/null +++ b/types/dom-clipboard-api/dom-clipboard-api-tests.ts @@ -0,0 +1,16 @@ +const clipboard = navigator.clipboard; + +let text: string; + +clipboard.writeText('foo'); +clipboard.readText().then((val) => { + text = val; +}); + +const transfer = new DataTransfer(); +transfer.setData('text/plain', 'foo'); + +clipboard.write(transfer); +clipboard.read().then((tf) => { + text = tf.getData('text/plain'); +}); diff --git a/types/dom-clipboard-api/index.d.ts b/types/dom-clipboard-api/index.d.ts new file mode 100644 index 0000000000..1af5f2c60a --- /dev/null +++ b/types/dom-clipboard-api/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for w3c Clipboard API 1.0 +// Project: https://w3c.github.io/clipboard-apis/ +// Definitions by: James Garbutt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Clipboard extends EventTarget { + read(): Promise; + readText(): Promise; + write(data: DataTransfer): Promise; + writeText(data: string): Promise; +} + +interface Navigator { + readonly clipboard: Clipboard; +} diff --git a/types/dom-clipboard-api/tsconfig.json b/types/dom-clipboard-api/tsconfig.json new file mode 100644 index 0000000000..230c5f16f6 --- /dev/null +++ b/types/dom-clipboard-api/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dom-clipboard-api-tests.ts" + ] +} diff --git a/types/react-dnd-html5-backend/tslint.json b/types/dom-clipboard-api/tslint.json similarity index 56% rename from types/react-dnd-html5-backend/tslint.json rename to types/dom-clipboard-api/tslint.json index bf6102640b..495d29983d 100644 --- a/types/react-dnd-html5-backend/tslint.json +++ b/types/dom-clipboard-api/tslint.json @@ -1,7 +1,5 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "no-namespace": false } } diff --git a/types/dom4/index.d.ts b/types/dom4/index.d.ts index 90c9c29966..47a7080a0c 100644 --- a/types/dom4/index.d.ts +++ b/types/dom4/index.d.ts @@ -60,11 +60,11 @@ interface Element extends ParentNode { matches(selectors: string): boolean; } -interface Elements extends ElementTraversal, ParentNode, Array { +interface Elements extends ParentNode, Array { } -interface Document extends ElementTraversal, ParentNode { +interface Document extends ParentNode { } -interface DocumentFragment extends ElementTraversal, ParentNode { +interface DocumentFragment extends ParentNode { } diff --git a/types/domready/domready-tests.ts b/types/domready/domready-tests.ts index 01be4213f4..6c5e126bf3 100644 --- a/types/domready/domready-tests.ts +++ b/types/domready/domready-tests.ts @@ -1,5 +1,5 @@ import domready = require("domready"); -domready(function () { +domready(() => { // dom is loaded! -}) \ No newline at end of file +}); diff --git a/types/domready/index.d.ts b/types/domready/index.d.ts index 9548757894..6f9ea3a0a7 100644 --- a/types/domready/index.d.ts +++ b/types/domready/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for domready +// Type definitions for domready 1.0 // Project: https://github.com/ded/domready // Definitions by: Christian Holm Nielsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function domready(callback: () => any) : void; +declare function domready(callback: () => void): void; export = domready; -export as namespace domready; \ No newline at end of file +export as namespace domready; diff --git a/types/domready/tsconfig.json b/types/domready/tsconfig.json index 1495d185a6..4b4263f4b1 100644 --- a/types/domready/tsconfig.json +++ b/types/domready/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "domready-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/domready/tslint.json b/types/domready/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/domready/tslint.json +++ b/types/domready/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/doubleclick-gpt/doubleclick-gpt-tests.ts b/types/doubleclick-gpt/doubleclick-gpt-tests.ts index 941ad3c260..5865ed02dd 100644 --- a/types/doubleclick-gpt/doubleclick-gpt-tests.ts +++ b/types/doubleclick-gpt/doubleclick-gpt-tests.ts @@ -435,3 +435,6 @@ googletag.pubads().display("/1234567/science", [300, 250], new HTMLElement()); // A named size can be a string or an array of strings. googletag.pubads().display("/1234567/science/physics", [[300, 250], "fluid"], "div-1"); googletag.pubads().display("/1234567/science/physics", [[300, 250], ["fluid"]], "div-1"); + +// Request non-personalized ads +googletag.pubads().setRequestNonPersonalizedAds(1); diff --git a/types/doubleclick-gpt/index.d.ts b/types/doubleclick-gpt/index.d.ts index 10e20cccd1..545f534e79 100644 --- a/types/doubleclick-gpt/index.d.ts +++ b/types/doubleclick-gpt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Publisher Tag v172 +// Type definitions for Google Publisher Tag v199 // Project: https://developers.google.com/doubleclick-gpt/reference // Definitions by: John Wright // Steven Joyce @@ -131,6 +131,7 @@ declare namespace googletag { setForceSafeFrame(forceSafeFrame: boolean): PubAdsService; setLocation(latitudeOrAddress: string | number, opt_longitude?: number, opt_radius?: number): PubAdsService; setPublisherProvidedId(ppid: string): PubAdsService; + setRequestNonPersonalizedAds(nonPersonalizedAds: 0 | 1): PubAdsService; setSafeFrameConfig(config: SafeFrameConfig): PubAdsService; setTagForChildDirectedTreatment(value: number): PubAdsService; setTargeting(key: string, value: string | string[]): PubAdsService; diff --git a/types/downloadjs/downloadjs-tests.ts b/types/downloadjs/downloadjs-tests.ts index 00bb5395ef..da110af46d 100644 --- a/types/downloadjs/downloadjs-tests.ts +++ b/types/downloadjs/downloadjs-tests.ts @@ -7,6 +7,6 @@ download(new Blob(['hello world']), 'dlTextBlob.txt', 'text/plain'); download('/robots.txt'); -download(document.documentElement.outerHTML, 'dlHTML.html', 'text/html'); +download(document.documentElement!.outerHTML, 'dlHTML.html', 'text/html'); download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html'); download('/diff6.png'); diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index 857671d13d..c0c64256fd 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -1,6 +1,5 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; -import { Map } from "immutable"; import { ContentBlock, @@ -48,154 +47,141 @@ class HandleSpan extends React.Component { } class RichEditorExample extends React.Component<{}, { editorState: EditorState }> { - constructor() { - super({}); + static initState() { + const sampleMarkup = + 'Bold text, Italic text

' + + 'Example link

' + + ''; + const blocksFromHTML = convertFromHTML(sampleMarkup); + const state = ContentState.createFromBlockArray(blocksFromHTML.contentBlocks, blocksFromHTML.entityMap); + const decorator = new CompositeDecorator([ + { + strategy: ( + block: ContentBlock, + callback: (start: number, end: number) => void, + contentState: ContentState + ) => { + const text = block.getText(); + let matchArr, start; + while ((matchArr = HANDLE_REGEX.exec(text)) !== null) { + start = matchArr.index; + callback(start, start + matchArr[0].length); + } + }, + component: HandleSpan + } + ]); + return { editorState: EditorState.createWithContent(state, decorator) }; + } + state = RichEditorExample.initState() - const sampleMarkup = - 'Bold text, Italic text

' + - 'Example link

' + - ''; - const blocksFromHTML = convertFromHTML(sampleMarkup); - const state = ContentState.createFromBlockArray( - blocksFromHTML.contentBlocks, - blocksFromHTML.entityMap, - ); - const decorator = new CompositeDecorator([{ - strategy: ( - block: ContentBlock, - callback: (start: number, end: number) => void, - contentState: ContentState - ) => { - const text = block.getText(); - let matchArr, start; - while ((matchArr = HANDLE_REGEX.exec(text)) !== null) { - start = matchArr.index; - callback(start, start + matchArr[0].length); + onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState }); + + keyBindingFn(e: SyntheticKeyboardEvent): string { + if (e.keyCode === KEYCODES.ENTER) { + const { editorState } = this.state; + const contentState = editorState.getCurrentContent(); + const selectionState = editorState.getSelection(); + + // only split headers into header and unstyled if we press 'Enter' + // at the end of a header (without text selected) + if (selectionState.isCollapsed()) { + const endKey = selectionState.getEndKey(); + const endOffset = selectionState.getEndOffset(); + const endBlock = contentState.getBlockForKey(endKey); + if (isHeaderBlock(endBlock) && endOffset === endBlock.getText().length) { + return SPLIT_HEADER_BLOCK; + } + } } - }, - component: HandleSpan, - }]); - this.state = { editorState: EditorState.createWithContent(state, decorator) }; - } - onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState }); + return getDefaultKeyBinding(e); + } - keyBindingFn(e: SyntheticKeyboardEvent): string { - if (e.keyCode === KEYCODES.ENTER) { - const { editorState } = this.state; - const contentState = editorState.getCurrentContent(); - const selectionState = editorState.getSelection(); - - // only split headers into header and unstyled if we press 'Enter' - // at the end of a header (without text selected) - if (selectionState.isCollapsed()) { - const endKey = selectionState.getEndKey(); - const endOffset = selectionState.getEndOffset(); - const endBlock = contentState.getBlockForKey(endKey); - if (isHeaderBlock(endBlock) && endOffset === endBlock.getText().length) { - return SPLIT_HEADER_BLOCK; + handleKeyCommand = (command: string, editorState: EditorState) => { + if (command === SPLIT_HEADER_BLOCK) { + this.onChange(this.splitHeaderToNewBlock()); + return 'handled'; } - } + + const newState = RichUtils.handleKeyCommand(editorState, command); + + if (newState) { + this.onChange(newState); + return 'handled'; + } + + return 'not-handled'; + }; + + toggleBlockType: (blockType: string) => void = (blockType: string) => { + this.onChange(RichUtils.toggleBlockType(this.state.editorState, blockType)); + }; + + toggleInlineStyle: (inlineStyle: string) => void = (inlineStyle: string) => { + this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, inlineStyle)); + }; + + splitHeaderToNewBlock(): EditorState { + const { editorState } = this.state; + const selection = editorState.getSelection(); + + // Add a new block after the cursor + const contentWithBlock = Modifier.splitBlock(editorState.getCurrentContent(), selection); + + // Change the new block type to be normal 'unstyled' text, + const newBlock = contentWithBlock.getBlockAfter(selection.getEndKey()); + const contentWithUnstyledBlock = Modifier.setBlockType( + contentWithBlock, + SelectionState.createEmpty(newBlock.getKey()), + 'unstyled' + ); + + // push the new state with 'insert-characters' to preserve the undo/redo stack + const stateWithNewline = EditorState.push(editorState, contentWithUnstyledBlock, 'insert-characters'); + + // manually move the cursor to the next line (as expected) + const nextState = EditorState.forceSelection(stateWithNewline, SelectionState.createEmpty(newBlock.getKey())); + + return nextState; } - return getDefaultKeyBinding(e); - } + render(): React.ReactElement<{}> { + // If the user changes block type before entering any text, we can + // either style the placeholder or hide it. Let's just hide it now. + let className = 'RichEditor-editor'; + var contentState = this.state.editorState.getCurrentContent(); + if (!contentState.hasText()) { + if ( + contentState + .getBlockMap() + .first() + .getType() !== 'unstyled' + ) { + className += ' RichEditor-hidePlaceholder'; + } + } - handleKeyCommand = (command: string, editorState: EditorState) => { - if (command === SPLIT_HEADER_BLOCK) { - this.onChange(this.splitHeaderToNewBlock()); - return 'handled'; - } - - const newState = RichUtils.handleKeyCommand(editorState, command); - - if (newState) { - this.onChange(newState); - return "handled"; - } - - return "not-handled"; - } - - toggleBlockType: (blockType: string) => void = (blockType: string) => { - this.onChange(RichUtils.toggleBlockType(this.state.editorState, blockType)); - } - - toggleInlineStyle: (inlineStyle: string) => void = (inlineStyle: string) => { - this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, inlineStyle)); - } - - splitHeaderToNewBlock(): EditorState { - const { editorState } = this.state; - const selection = editorState.getSelection(); - - // Add a new block after the cursor - const contentWithBlock = Modifier.splitBlock( - editorState.getCurrentContent(), - selection, - ); - - // Change the new block type to be normal 'unstyled' text, - const newBlock = contentWithBlock.getBlockAfter(selection.getEndKey()); - const contentWithUnstyledBlock = Modifier.setBlockType( - contentWithBlock, - SelectionState.createEmpty(newBlock.getKey()), - 'unstyled', - ); - - // push the new state with 'insert-characters' to preserve the undo/redo stack - const stateWithNewline = EditorState.push( - editorState, - contentWithUnstyledBlock, - 'insert-characters' - ); - - // manually move the cursor to the next line (as expected) - const nextState = EditorState.forceSelection( - stateWithNewline, - SelectionState.createEmpty(newBlock.getKey()), - ); - - return nextState; - } - - render(): React.ReactElement<{}> { - // If the user changes block type before entering any text, we can - // either style the placeholder or hide it. Let's just hide it now. - let className = 'RichEditor-editor'; - var contentState = this.state.editorState.getCurrentContent(); - if (!contentState.hasText()) { - if (contentState.getBlockMap().first().getType() !== 'unstyled') { - className += ' RichEditor-hidePlaceholder'; - } - } - - return ( -
- - -
- -
+ return ( +
+ + +
+
- ); - } +
+ ); + } } // Custom overrides for "code" style. diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 4064c9b8a0..06cb8f55f2 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -9,7 +9,7 @@ // Santiago Vilar // Ulf Schwekendiek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import * as Immutable from 'immutable'; diff --git a/types/dts-generator/index.d.ts b/types/dts-generator/index.d.ts index 5ef99eb2b0..d4d730850c 100644 --- a/types/dts-generator/index.d.ts +++ b/types/dts-generator/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/SitePen/dts-generator#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import ts = require('typescript'); import Bluebird = require('bluebird'); diff --git a/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts b/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts index 0552f0e7c4..27eb651287 100644 --- a/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts +++ b/types/duplicate-package-checker-webpack-plugin/duplicate-package-checker-webpack-plugin-tests.ts @@ -18,7 +18,12 @@ const c: webpack.Configuration = { plugins: [ new DuplicatePackageCheckerWebpackPlugin({ verbose: true, - emitError: true + emitError: true, + showHelp: false, + strict: false, + exclude(instance) { + return instance.name === "fbjs"; + } }) ] }; diff --git a/types/duplicate-package-checker-webpack-plugin/index.d.ts b/types/duplicate-package-checker-webpack-plugin/index.d.ts index 1eff56e9d5..cadb922c1a 100644 --- a/types/duplicate-package-checker-webpack-plugin/index.d.ts +++ b/types/duplicate-package-checker-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for duplicate-package-checker-webpack-plugin 1.2 +// Type definitions for duplicate-package-checker-webpack-plugin 2.1 // Project: https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,10 +13,36 @@ declare class DuplicatePackageCheckerWebpackPlugin extends Plugin { } declare namespace DuplicatePackageCheckerWebpackPlugin { + /** The properties of the instance of a package */ + interface PackageInstanceProperties { + /** The name of the package */ + name: string; + /** The version of the package */ + version: string; + /** Absolute path to the package */ + path: string; + /** Absolute path to the module that requested the package */ + issuer?: string; + } + + /** The configurable options for the plugin */ interface Options { - // Also show module that is requiring each duplicate package + /** Also show module that is requiring each duplicate package (default: false) */ verbose?: boolean; - // Emit errors instead of warnings + /** Emit errors instead of warnings (default: false) */ emitError?: boolean; + /** Show help message if duplicate packages are found (default: true) */ + showHelp?: boolean; + /** Warn also if major versions differ (default: true) */ + strict?: boolean; + + /** + * Exclude instances of packages from the results. + * If all instances of a package are excluded, or all instances except one, + * then the package is no longer considered duplicated and won't be emitted as a warning/error. + * @param instance The instance of a package being evaluated for exclusion. + * @returns true to exclude the instance, false otherwise + */ + exclude?: (instance: PackageInstanceProperties) => boolean; } } diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index 4a4a9f0492..1e075d7ba9 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -21,6 +21,11 @@ declare namespace dygraphs { * A per-series color definition. Used in conjunction with, and overrides, the colors option. */ color?: string; + + /** + * A function which plot data for this series on the chart. + */ + plotter?: any; /** * Draw a small dot at each point, in addition to a line going through the point. This makes diff --git a/types/eases/backIn.d.ts b/types/eases/backIn.d.ts new file mode 100644 index 0000000000..8681c8ae58 --- /dev/null +++ b/types/eases/backIn.d.ts @@ -0,0 +1,2 @@ +import { backIn } from "./index"; +export = backIn; diff --git a/types/eases/backInOut.d.ts b/types/eases/backInOut.d.ts new file mode 100644 index 0000000000..e6957de807 --- /dev/null +++ b/types/eases/backInOut.d.ts @@ -0,0 +1,2 @@ +import { backInOut } from "./index"; +export = backInOut; diff --git a/types/eases/backOut.d.ts b/types/eases/backOut.d.ts new file mode 100644 index 0000000000..b8b6ab6f4c --- /dev/null +++ b/types/eases/backOut.d.ts @@ -0,0 +1,2 @@ +import { backOut } from "./index"; +export = backOut; diff --git a/types/eases/bounceIn.d.ts b/types/eases/bounceIn.d.ts new file mode 100644 index 0000000000..a1499f174a --- /dev/null +++ b/types/eases/bounceIn.d.ts @@ -0,0 +1,2 @@ +import { bounceIn } from "./index"; +export = bounceIn; diff --git a/types/eases/bounceInOut.d.ts b/types/eases/bounceInOut.d.ts new file mode 100644 index 0000000000..0aade79df0 --- /dev/null +++ b/types/eases/bounceInOut.d.ts @@ -0,0 +1,2 @@ +import { bounceInOut } from "./index"; +export = bounceInOut; diff --git a/types/eases/bounceOut.d.ts b/types/eases/bounceOut.d.ts new file mode 100644 index 0000000000..c32227373c --- /dev/null +++ b/types/eases/bounceOut.d.ts @@ -0,0 +1,2 @@ +import { bounceOut } from "./index"; +export = bounceOut; diff --git a/types/eases/circIn.d.ts b/types/eases/circIn.d.ts new file mode 100644 index 0000000000..6cc5fee6ed --- /dev/null +++ b/types/eases/circIn.d.ts @@ -0,0 +1,2 @@ +import { circIn } from "./index"; +export = circIn; diff --git a/types/eases/circInOut.d.ts b/types/eases/circInOut.d.ts new file mode 100644 index 0000000000..29f480688a --- /dev/null +++ b/types/eases/circInOut.d.ts @@ -0,0 +1,2 @@ +import { circInOut } from "./index"; +export = circInOut; diff --git a/types/eases/circOut.d.ts b/types/eases/circOut.d.ts new file mode 100644 index 0000000000..39be74ff36 --- /dev/null +++ b/types/eases/circOut.d.ts @@ -0,0 +1,2 @@ +import { circOut } from "./index"; +export = circOut; diff --git a/types/eases/cubicIn.d.ts b/types/eases/cubicIn.d.ts new file mode 100644 index 0000000000..92455161df --- /dev/null +++ b/types/eases/cubicIn.d.ts @@ -0,0 +1,2 @@ +import { cubicIn } from "./index"; +export = cubicIn; diff --git a/types/eases/cubicInOut.d.ts b/types/eases/cubicInOut.d.ts new file mode 100644 index 0000000000..1e83ef573f --- /dev/null +++ b/types/eases/cubicInOut.d.ts @@ -0,0 +1,2 @@ +import { cubicInOut } from "./index"; +export = cubicInOut; diff --git a/types/eases/cubicOut.d.ts b/types/eases/cubicOut.d.ts new file mode 100644 index 0000000000..aa309e22a6 --- /dev/null +++ b/types/eases/cubicOut.d.ts @@ -0,0 +1,2 @@ +import { cubicOut } from "./index"; +export = cubicOut; diff --git a/types/eases/eases-tests.ts b/types/eases/eases-tests.ts new file mode 100644 index 0000000000..7dcb0dcc98 --- /dev/null +++ b/types/eases/eases-tests.ts @@ -0,0 +1,100 @@ +import eases = require("eases"); +import backInOut = require("eases/backInOut"); +import backIn = require("eases/backIn"); +import backOut = require("eases/backOut"); +import bounceInOut = require("eases/bounceInOut"); +import bounceIn = require("eases/bounceIn"); +import bounceOut = require("eases/bounceOut"); +import circInOut = require("eases/circInOut"); +import circIn = require("eases/circIn"); +import circOut = require("eases/circOut"); +import cubicInOut = require("eases/cubicInOut"); +import cubicIn = require("eases/cubicIn"); +import cubicOut = require("eases/cubicOut"); +import elasticInOut = require("eases/elasticInOut"); +import elasticIn = require("eases/elasticIn"); +import elasticOut = require("eases/elasticOut"); +import expoInOut = require("eases/expoInOut"); +import expoIn = require("eases/expoIn"); +import expoOut = require("eases/expoOut"); +import linear = require("eases/linear"); +import quadInOut = require("eases/quadInOut"); +import quadIn = require("eases/quadIn"); +import quadOut = require("eases/quadOut"); +import quartInOut = require("eases/quartInOut"); +import quartIn = require("eases/quartIn"); +import quartOut = require("eases/quartOut"); +import quintInOut = require("eases/quintInOut"); +import quintIn = require("eases/quintIn"); +import quintOut = require("eases/quintOut"); +import sineInOut = require("eases/sineInOut"); +import sineIn = require("eases/sineIn"); +import sineOut = require("eases/sineOut"); + +{ + eases.backInOut(0.5); // $ExpectType number + eases.backIn(0.5); // $ExpectType number + eases.backOut(0.5); // $ExpectType number + eases.bounceInOut(0.5); // $ExpectType number + eases.bounceIn(0.5); // $ExpectType number + eases.bounceOut(0.5); // $ExpectType number + eases.circInOut(0.5); // $ExpectType number + eases.circIn(0.5); // $ExpectType number + eases.circOut(0.5); // $ExpectType number + eases.cubicInOut(0.5); // $ExpectType number + eases.cubicIn(0.5); // $ExpectType number + eases.cubicOut(0.5); // $ExpectType number + eases.elasticInOut(0.5); // $ExpectType number + eases.elasticIn(0.5); // $ExpectType number + eases.elasticOut(0.5); // $ExpectType number + eases.expoInOut(0.5); // $ExpectType number + eases.expoIn(0.5); // $ExpectType number + eases.expoOut(0.5); // $ExpectType number + eases.linear(0.5); // $ExpectType number + eases.quadInOut(0.5); // $ExpectType number + eases.quadIn(0.5); // $ExpectType number + eases.quadOut(0.5); // $ExpectType number + eases.quartInOut(0.5); // $ExpectType number + eases.quartIn(0.5); // $ExpectType number + eases.quartOut(0.5); // $ExpectType number + eases.quintInOut(0.5); // $ExpectType number + eases.quintIn(0.5); // $ExpectType number + eases.quintOut(0.5); // $ExpectType number + eases.sineInOut(0.5); // $ExpectType number + eases.sineIn(0.5); // $ExpectType number + eases.sineOut(0.5); // $ExpectType number +} + +{ + backInOut(0.5); // $ExpectType number + backIn(0.5); // $ExpectType number + backOut(0.5); // $ExpectType number + bounceInOut(0.5); // $ExpectType number + bounceIn(0.5); // $ExpectType number + bounceOut(0.5); // $ExpectType number + circInOut(0.5); // $ExpectType number + circIn(0.5); // $ExpectType number + circOut(0.5); // $ExpectType number + cubicInOut(0.5); // $ExpectType number + cubicIn(0.5); // $ExpectType number + cubicOut(0.5); // $ExpectType number + elasticInOut(0.5); // $ExpectType number + elasticIn(0.5); // $ExpectType number + elasticOut(0.5); // $ExpectType number + expoInOut(0.5); // $ExpectType number + expoIn(0.5); // $ExpectType number + expoOut(0.5); // $ExpectType number + linear(0.5); // $ExpectType number + quadInOut(0.5); // $ExpectType number + quadIn(0.5); // $ExpectType number + quadOut(0.5); // $ExpectType number + quartInOut(0.5); // $ExpectType number + quartIn(0.5); // $ExpectType number + quartOut(0.5); // $ExpectType number + quintInOut(0.5); // $ExpectType number + quintIn(0.5); // $ExpectType number + quintOut(0.5); // $ExpectType number + sineInOut(0.5); // $ExpectType number + sineIn(0.5); // $ExpectType number + sineOut(0.5); // $ExpectType number +} diff --git a/types/eases/elasticIn.d.ts b/types/eases/elasticIn.d.ts new file mode 100644 index 0000000000..6dd90cb2da --- /dev/null +++ b/types/eases/elasticIn.d.ts @@ -0,0 +1,2 @@ +import { elasticIn } from "./index"; +export = elasticIn; diff --git a/types/eases/elasticInOut.d.ts b/types/eases/elasticInOut.d.ts new file mode 100644 index 0000000000..ec9fa9a307 --- /dev/null +++ b/types/eases/elasticInOut.d.ts @@ -0,0 +1,2 @@ +import { elasticInOut } from "./index"; +export = elasticInOut; diff --git a/types/eases/elasticOut.d.ts b/types/eases/elasticOut.d.ts new file mode 100644 index 0000000000..de7aedafe7 --- /dev/null +++ b/types/eases/elasticOut.d.ts @@ -0,0 +1,2 @@ +import { elasticOut } from "./index"; +export = elasticOut; diff --git a/types/eases/expoIn.d.ts b/types/eases/expoIn.d.ts new file mode 100644 index 0000000000..fc88cdeda3 --- /dev/null +++ b/types/eases/expoIn.d.ts @@ -0,0 +1,2 @@ +import { expoIn } from "./index"; +export = expoIn; diff --git a/types/eases/expoInOut.d.ts b/types/eases/expoInOut.d.ts new file mode 100644 index 0000000000..06235ba84b --- /dev/null +++ b/types/eases/expoInOut.d.ts @@ -0,0 +1,2 @@ +import { expoInOut } from "./index"; +export = expoInOut; diff --git a/types/eases/expoOut.d.ts b/types/eases/expoOut.d.ts new file mode 100644 index 0000000000..62bda4ab8e --- /dev/null +++ b/types/eases/expoOut.d.ts @@ -0,0 +1,2 @@ +import { expoOut } from "./index"; +export = expoOut; diff --git a/types/eases/index.d.ts b/types/eases/index.d.ts new file mode 100644 index 0000000000..ac46def324 --- /dev/null +++ b/types/eases/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for eases 1.0 +// Project: https://github.com/mattdesl/eases +// Definitions by: Mathias Paumgarten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Eases { + backInOut(t: number): number; + backIn(t: number): number; + backOut(t: number): number; + bounceInOut(t: number): number; + bounceIn(t: number): number; + bounceOut(t: number): number; + circInOut(t: number): number; + circIn(t: number): number; + circOut(t: number): number; + cubicInOut(t: number): number; + cubicIn(t: number): number; + cubicOut(t: number): number; + elasticInOut(t: number): number; + elasticIn(t: number): number; + elasticOut(t: number): number; + expoInOut(t: number): number; + expoIn(t: number): number; + expoOut(t: number): number; + linear(t: number): number; + quadInOut(t: number): number; + quadIn(t: number): number; + quadOut(t: number): number; + quartInOut(t: number): number; + quartIn(t: number): number; + quartOut(t: number): number; + quintInOut(t: number): number; + quintIn(t: number): number; + quintOut(t: number): number; + sineInOut(t: number): number; + sineIn(t: number): number; + sineOut(t: number): number; +} + +declare const eases: Eases; + +export = eases; +export as namespace eases; diff --git a/types/eases/linear.d.ts b/types/eases/linear.d.ts new file mode 100644 index 0000000000..a0f39246a9 --- /dev/null +++ b/types/eases/linear.d.ts @@ -0,0 +1,2 @@ +import { linear } from "./index"; +export = linear; diff --git a/types/eases/quadIn.d.ts b/types/eases/quadIn.d.ts new file mode 100644 index 0000000000..b91d594fc6 --- /dev/null +++ b/types/eases/quadIn.d.ts @@ -0,0 +1,2 @@ +import { quadIn } from "./index"; +export = quadIn; diff --git a/types/eases/quadInOut.d.ts b/types/eases/quadInOut.d.ts new file mode 100644 index 0000000000..b41eedae8e --- /dev/null +++ b/types/eases/quadInOut.d.ts @@ -0,0 +1,2 @@ +import { quadInOut } from "./index"; +export = quadInOut; diff --git a/types/eases/quadOut.d.ts b/types/eases/quadOut.d.ts new file mode 100644 index 0000000000..2f490d1d7c --- /dev/null +++ b/types/eases/quadOut.d.ts @@ -0,0 +1,2 @@ +import { quadOut } from "./index"; +export = quadOut; diff --git a/types/eases/quartIn.d.ts b/types/eases/quartIn.d.ts new file mode 100644 index 0000000000..ae5542ed3b --- /dev/null +++ b/types/eases/quartIn.d.ts @@ -0,0 +1,2 @@ +import { quartIn } from "./index"; +export = quartIn; diff --git a/types/eases/quartInOut.d.ts b/types/eases/quartInOut.d.ts new file mode 100644 index 0000000000..8c9eda5461 --- /dev/null +++ b/types/eases/quartInOut.d.ts @@ -0,0 +1,2 @@ +import { quartInOut } from "./index"; +export = quartInOut; diff --git a/types/eases/quartOut.d.ts b/types/eases/quartOut.d.ts new file mode 100644 index 0000000000..5d164804c5 --- /dev/null +++ b/types/eases/quartOut.d.ts @@ -0,0 +1,2 @@ +import { quartOut } from "./index"; +export = quartOut; diff --git a/types/eases/quintIn.d.ts b/types/eases/quintIn.d.ts new file mode 100644 index 0000000000..bf2e56cb2f --- /dev/null +++ b/types/eases/quintIn.d.ts @@ -0,0 +1,2 @@ +import { quintIn } from "./index"; +export = quintIn; diff --git a/types/eases/quintInOut.d.ts b/types/eases/quintInOut.d.ts new file mode 100644 index 0000000000..eeab23e7e7 --- /dev/null +++ b/types/eases/quintInOut.d.ts @@ -0,0 +1,2 @@ +import { quintInOut } from "./index"; +export = quintInOut; diff --git a/types/eases/quintOut.d.ts b/types/eases/quintOut.d.ts new file mode 100644 index 0000000000..1a8eed0c0c --- /dev/null +++ b/types/eases/quintOut.d.ts @@ -0,0 +1,2 @@ +import { quintOut } from "./index"; +export = quintOut; diff --git a/types/eases/sineIn.d.ts b/types/eases/sineIn.d.ts new file mode 100644 index 0000000000..77a609b4c5 --- /dev/null +++ b/types/eases/sineIn.d.ts @@ -0,0 +1,2 @@ +import { sineIn } from "./index"; +export = sineIn; diff --git a/types/eases/sineInOut.d.ts b/types/eases/sineInOut.d.ts new file mode 100644 index 0000000000..9328e02617 --- /dev/null +++ b/types/eases/sineInOut.d.ts @@ -0,0 +1,2 @@ +import { sineInOut } from "./index"; +export = sineInOut; diff --git a/types/eases/sineOut.d.ts b/types/eases/sineOut.d.ts new file mode 100644 index 0000000000..082ef825d7 --- /dev/null +++ b/types/eases/sineOut.d.ts @@ -0,0 +1,2 @@ +import { sineOut } from "./index"; +export = sineOut; diff --git a/types/eases/tsconfig.json b/types/eases/tsconfig.json new file mode 100644 index 0000000000..1ed08e1b05 --- /dev/null +++ b/types/eases/tsconfig.json @@ -0,0 +1,54 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "eases-tests.ts", + "backInOut.d.ts", + "backIn.d.ts", + "backOut.d.ts", + "bounceInOut.d.ts", + "bounceIn.d.ts", + "bounceOut.d.ts", + "circInOut.d.ts", + "circIn.d.ts", + "circOut.d.ts", + "cubicInOut.d.ts", + "cubicIn.d.ts", + "cubicOut.d.ts", + "elasticInOut.d.ts", + "elasticIn.d.ts", + "elasticOut.d.ts", + "expoInOut.d.ts", + "expoIn.d.ts", + "expoOut.d.ts", + "linear.d.ts", + "quadInOut.d.ts", + "quadIn.d.ts", + "quadOut.d.ts", + "quartInOut.d.ts", + "quartIn.d.ts", + "quartOut.d.ts", + "quintInOut.d.ts", + "quintIn.d.ts", + "quintOut.d.ts", + "sineInOut.d.ts", + "sineIn.d.ts", + "sineOut.d.ts" + ] +} diff --git a/types/eases/tslint.json b/types/eases/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/eases/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index 15892864e5..dc525231e6 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -1,122 +1,414 @@ -// Type definitions for echarts +// Type definitions for echarts 4.1.0 // Project: http://echarts.baidu.com/ // Definitions by: Xie Jingyang // AntiMoron // Liveangela +// Ovilia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 declare namespace echarts { - function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: object | string, opts?: { - devicePixelRatio?: number - renderer?: string - width?: number | string - height?: number | string - }): ECharts; + /** + * Creates an ECharts instance, and returns an echartsInstance. You shall + * not initialize multiple ECharts instances on a single container. + * + * @param {HTMLDivElement | HTMLCanvasElement} dom Instance container, + * usually is a `div` element with height and width defined. + * @param {object | string} [theme] Theme to be applied. + * This can be a configuring object of a theme, or a theme name + * registered through [echarts.registerTheme](https://echarts.apache.org/api.html#echarts.registerTheme). + * @param {object} [opts] Chart configurations. + * @param {number} [opts.devicePixelRatio] Ratio of one physical pixel to + * the size of one device independent pixels. Browser's + * `window.devicePixelRatio` is used by default. + * @param {string} [opts.renderer] Supports `'canvas'` or `'svg'`. + * See [Render by Canvas or SVG](https://echarts.apache.org/tutorial.html#Render%20by%20Canvas%20or%20SVG). + * @param {number} [opts.width] Specify width explicitly, in pixel. + * If setting to `null`/`undefined`/`'auto'`, width of `dom` + * (instance container) will be used. + * @param {number} [opts.height] Specify height explicitly, in pixel. + * If setting to `null`/`undefined`/`'auto'`, height of `dom` + * (instance container) will be used. + */ + function init( + dom: HTMLDivElement | HTMLCanvasElement, + theme?: object | string, + opts?: { + devicePixelRatio?: number + renderer?: string + width?: number | string + height?: number | string + } + ): ECharts - const graphic: Graphic; + /** + * Connects interaction of multiple chart series. For example: + * + ```js + // set group id of each instance respectively. + chart1.group = 'group1'; + chart2.group = 'group1'; + echarts.connect('group1'); + // or incoming instance array that need to be linked. + echarts.connect([chart1, chart2]); + ``` + * + * @param group Group id in string, or array of chart instance. + */ + function connect(group: string | ECharts[]): void - interface Graphic { - clipPointsByRect(points: number[][], rect: ERectangle): number[][]; - clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; - LinearGradient: { new(x: number, y: number, x2: number, y2: number, colorStops: object[], globalCoord?: boolean): LinearGradient } - } + /** + * Disconnects interaction of multiple chart series. To have one single + * instance to be removed, you can set `group` of chart instance to be null. + * + * @param {string} group Group id in string. + */ + function disConnect(group: string): void - function connect(group: string | string[]): void; + /** + * Destroys chart instance, after which the instance cannot be used any + * more. + * + * @param target Chart instance or container. + */ + function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement) + : void - function disConnect(group: string): void; + /** + * Returns chart instance of dom container. + * + * @param target Chart container. + */ + function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement) + : ECharts - function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement): void; + /** + * Registers available maps. This can only be used after including + * [geo](https://echarts.apache.org/option.html#geo) + * component or chart series of + * [map](https://echarts.apache.org/option.html#series-map). + * + * @param {string} mapName Map name, referring to `map` value set in + * [geo](https://echarts.apache.org/option.html#geo) + * component or + * [map](https://echarts.apache.org/option.html#series-map). + * @param {object} geoJson Data in GeoJson format. See + * [http://geojson.org/](http://geojson.org/) for more format information. + * @param {object} [specialAreas] Zoomed part of a specific area in the map + * for better visual effect. + * See [USA Population Estimates example](https://ecomfe.github.io/echarts-examples/public/editor.html?c=map-usa). + */ + function registerMap( + mapName: string, + geoJson: object, + specialAreas?: object + ): void - function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement): ECharts; - - function registerMap(mapName: string, geoJson: object, specialAreas?: object): void; - - function registerTheme(themeName: string, theme: object): void; + /** + * Registers a theme, should be specified when + * [initialize the chart instance](https://echarts.apache.org/api.html#echarts.init). + * + * @param {string} themeName Theme name. + * @param {object} theme Theme configurations. + */ + function registerTheme(themeName: string, theme: object): void interface MapObj { - /** geoJson data for map */ + /** + * geoJson data for map + */ geoJson: object, - /** special areas fro map */ + /** + * special areas fro map + */ specialAreas: object } - function getMap(mapName: string): MapObj; + /** + * Get a registed map. + * + * @param {string} mapName Map name. + * @return {MapObj} Map data. + */ + function getMap(mapName: string): MapObj - interface LinearGradient { - colorStops: object[]; - global: boolean; - type: string; - x: number - x2: number - y: number - y2: number + /** + * Util methods about graphics. + */ + const graphic: Graphic; + + interface Graphic { + /** + * Clip the given points by the given rectangular. + * + * @param {number[][]} points The points to be clipped, + * like [[23, 44], [12, 15], ...]. + * @param {ERectangle} rect The rectangular that is used to clip points. + */ + clipPointsByRect(points: number[][], rect: ERectangle): number[][]; + + /** + * Clip the first input rectangular by the second input rectangular. + * + * @param {ERectangle} targetRect The rectangular to be clipped. + * @param {ERectangle} rect The rectangular that is used to clip + * targetRect. + */ + clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; } interface ECharts { + /** + * Group name to be used in chart connection + */ group: string - setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void + /** + * Configuration item, data, universal interface, all parameters and + * data can all be modified through `setOption`. ECharts will merge + * new parameters and data, and then refresh chart. + * + * @param {EChartOption} option Configuration item and data. Please + * refer to [configuration item manual](https://echarts.apache.org/option.html) + * for more information. + * @param {boolean} [notMerge=false] Whether not to merge with previous + * `option` + * @param {boolean} [lazyUpdate=false] Whether not to update chart + * immediately + */ + setOption( + option: EChartOption, + notMerge?: boolean, + lazyUpdate?: boolean + ) : void + /** + * Configuration item, data, universal interface, all parameters and + * data can all be modified through `setOption`. ECharts will merge + * new parameters and data, and then refresh chart. + * + * @param {EChartOption} option Configuration item and data. Please + * refer to [configuration item manual](https://echarts.apache.org/option.html) + * for more information. + * @param {EChartsOptionConfig} [opts] Options about how to setOption + */ + setOption(option: EChartOption, opts?: EChartsOptionConfig): void + + /** + * Gets width of ECharts instance container. + * + * @return {number} Width. + */ getWidth(): number + /** + * Gets height of ECharts instance container. + * + * @return {number} Height. + */ getHeight(): number + /** + * Gets DOM element of ECharts instance container. + * + * @return {HTMLCanvasElement|HTMLDivElement} DOM container. + */ getDom(): HTMLCanvasElement | HTMLDivElement - getOption(): object + /** + * Gets `option` object maintained in current instance, which contains + * configuration item and data merged from previous `setOption` + * operations by users, along with user interaction states. + * For example, switching of legend, zooming area of data zoom, + * and so on. Therefore, a new instance that is exactly the same + * can be recovered from this option. + */ + getOption(): EChartOption - resize(): void + /** + * Resizes chart, which should be called manually when container size + * changes. When `opts` is not provided, DOM size is used. + * + * @param {EChartsResizeOption} opts Specify parameters explicitly. + */ + resize(opts?: EChartsResizeOption): void + /** + * Triggers chart action, like chart switch `legendToggleSelect`, + * zoom data area `dataZoom`, show tooltip `showTip` and so on. + * See [action](https://echarts.apache.org/api.html#action) and + * [events](https://echarts.apache.org/api.html#events) + * for more information. + * + * @param payload Trigger multiple actions through `batch` attribute. + */ dispatchAction(payload: object): void + /** + * Binds event-handling function. + * There are two kinds of events in ECharts, one of which is mouse + * events, which will be triggered when the mouse clicks certain + * element in the chart, the other kind will be triggered after + * `dispatchAction` is called. Every action has a corresponding + * event. + * If event is triggered externally by `dispatchAction`, and there + * is batch attribute in action to trigger batch action, then the + * corresponding response event parameters be in batch. + * + * @param {string} eventName Event names are all in lower-cases, + * for example, `'click'`, `'mousemove'`, `'legendselected'` + * @param {Function} handler Event-handling function, whose format + * is as following: + ```js + (event: object) + ``` + * @param {object} [context] context of callback function, what + * `this` refers to. + */ on(eventName: string, handler: Function, context?: object): void + /** + * Unbind event-handler function. + * + * @param {string} eventName Event names are all in lower-cases, + * for example, `'click'`, `'mousemove'`, `'legendselected'` + * @param {Function} [handler] The function to be unbound could be + * passed. Otherwise, all event functions of this type will be + * unbound. + */ off(eventName: string, handler?: Function): void - showLoading(type?: string, opts?: object): void + /** + * Convert a point from logical coordinate (e.g., in geo, cartesian, + * graph, ...) to pixel coordinate. + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be converted. + */ + convertToPixel(finder: EChartsConvertFinder, value: string | any[]) + : string | any[] + /** + * Convert a point from pixel coordinate to logical coordinate + * (e.g., in geo, cartesian, graph, ...). + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be converted. + */ + convertFromPixel(finder: EChartsConvertFinder, value: any[] | string) + : any[] | string + + /** + * Determine whether the given point is in the given coordinate systems or series. + * + * @param {EChartsConvertFinder} finder Indicate in which coordinate + * system conversion is performed. + * Generally, index or id or name can be used to specify + * coordinate system. + * @param {string | any[]} value The value to be judged, in pixel + * coordinate system. + */ + containPixel(finder: EChartsConvertFinder, value: any[]): boolean + + /** + * Shows loading animation. You can call this interface manually before + * data is loaded, and call `hideLoading` to hide loading animation + * after data is loaded. + * + * @param {string} [type='default'] + * @param {EChartsLoadingOption} [opts] + */ + showLoading(type?: string, opts?: EChartsLoadingOption): void + + /** + * Hides animation loading effect. + */ hideLoading(): void + /** + * Exports chart image; returns a base64 URL; can be set to `src` of + * `Image`. + * + * @param opts Options. + */ getDataURL(opts: { - /** 导出的格式,可选 png, jpeg */ + // Exporting format, can be either png, or jpeg type?: string, - /** 导出的图片分辨率比例,默认为 1。*/ + // Resolution ratio of exporting image, 1 by default. pixelRatio?: number, - /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ - backgroundColor?: string + // Background color of exporting image, use backgroundColor in + // option by default. + backgroundColor?: string, + // Excluded components list. e.g. ['toolbox'] + excludeComponents?: string[] }): string + /** + * Exports connected chart image; returns a base64 url; can be set to + * `src` of `Image`. Position of charts in exported image are + * related to that of the container. + * + * @param opts Options. + */ getConnectedDataURL(opts: { - /** 导出的格式,可选 png, jpeg */ + // Exporting format, can be either png, or jpeg type: string, - /** 导出的图片分辨率比例,默认为 1。 */ + // Resolution ratio of exporting image, 1 by default. pixelRatio: number, - /** 导出的图片背景色,默认使用 option 里的 backgroundColor */ - backgroundColor: string + // Background color of exporting image, use backgroundColor in + // option by default. + backgroundColor: string, + // Excluded components list. e.g. ['toolbox'] + excludeComponents?: string[] }): string + /** + * The method is used in rendering millions of data + * (e.g. rendering geo data). In these scenario, the entire size of + * data is probably up to 10 or 100 MB, even using binary format. + * So chunked load data and rendering is required. When using + * `appendData`, the graphic elements that have been rendered will + * not be cleared, but keep rendering new graphic elements. + * + * @param opts Data options. + */ + appendData(opts: { + // Specify which series the data will be appended to. + seriesIndex?: string, + // The data to be appended. + data?: any[]|TypedArray, + }): void + + /** + * Clears current instance; removes all components and charts in + * current instance. + */ clear(): void + /** + * Returns whether current instance has been disposed. + * + * @return {boolean} Whether has been disposed. + */ isDisposed(): boolean + /** + * Disposes instance. Once disposed, the instance can not be used again. + */ dispose(): void - - /** 转换逻辑点到像素 */ - convertToPixel(finder: ConvertFinder | string, value: string | any[]): string | any[] - - convertFromPixel(finder: ConvertFinder | string, value: any[] | string): any[] | string - - containPixel(finder: ConvertFinder | string, - /** 要被判断的点,为像素坐标值,以 echarts 实例的 dom 节点的左上角为坐标 [0, 0] 点。*/ - value: any[]): boolean - - getModel(): { - getComponent(finder: string): any; - } } - interface ConvertFinder { + type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array + | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array + | Float64Array; + + interface EChartsConvertFinder { seriesIndex?: number, seriesId?: string, seriesName?: string, @@ -193,6 +485,29 @@ declare namespace echarts { zAxis3D?: object } + interface EChartsOptionConfig { + notMerge?: boolean, + lazyUpdate?: boolean, + silent?: boolean + } + + interface EChartsResizeOption { + /** + * Chart width. + */ + width?: number | string, + + /** + * Chart height. + */ + height?: number | string, + + /** + * Specify whether or not to prevent triggering events. + */ + silent?: boolean + } + interface EChartTitleOption { show?: boolean; text?: string; @@ -219,6 +534,38 @@ declare namespace echarts { shadowOffsetX?: number, shadowOffsetY?: number, } + + interface EChartsLoadingOption { + /** + * Loading text. + * @default 'loading' + */ + text?: string, + + /** + * Loading circle color. + * @default '#c23531' + */ + color?: string, + + /** + * Loading text color. + * @default '#000' + */ + textColor?: string, + + /** + * Mask background color. + * @default 'rgba(255, 255, 255, 0.8)' + */ + maskColor?: string, + + /** + * Zlevel of loading. If not 0, it creates a new canvas for loading. + * @default 0 + */ + zlevel?: 0 + } } declare module 'echarts' { diff --git a/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts b/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts new file mode 100644 index 0000000000..3dc5a9d61a --- /dev/null +++ b/types/ecma-proposal-math-extensions/ecma-proposal-math-extensions-tests.ts @@ -0,0 +1,7 @@ +import "ecma-proposal-math-extensions"; + +Math.scale(42, 21, 64, 0, 100); +Math.fscale(0.42, 0.21, 0.64, 0.0, 1.0); +Math.clamp(42, 0, 100); +Math.radians(180) === 180 * Math.DEG_PER_RAD; +Math.degrees(Math.PI) === Math.PI * Math.RAD_PER_DEG; diff --git a/types/ecma-proposal-math-extensions/index.d.ts b/types/ecma-proposal-math-extensions/index.d.ts new file mode 100644 index 0000000000..6412e63dd6 --- /dev/null +++ b/types/ecma-proposal-math-extensions/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for ecma-proposal-math-extensions 0.0 +// Project: https://github.com/rwaldron/proposal-math-extensions#readme +// Definitions by: Konstantin Simon Maria Möllers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.0 + +interface Math { + /** This is the number of how many degrees are one radian. */ + readonly DEG_PER_RAD: number; + /** This is the number of how many radians are one degree. */ + readonly RAD_PER_DEG: number; + /** + * Scales a value between `inLow` and `inHigh` to the range of `outLow` to `outHigh`. + * @param x The numeric value in the input range to scale. + * @param inLow The lower bound of the input range. + * @param inHigh The upper bound of the input range. + * @param outLow The lower bound of the output range. + * @param outHigh The upper bound of the output range. + * @return The input value scaled to the output range. + */ + scale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; + /** + * Scales a floating point value between `inLow` and `inHigh` to the range of `outLow` to `outHigh`. + * @param x The numeric value in the input range to scale. + * @param inLow The lower bound of the input range. + * @param inHigh The upper bound of the input range. + * @param outLow The lower bound of the output range. + * @param outHigh The upper bound of the output range. + * @return The input value scaled to the output range. + */ + fscale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; + /** + * Clamps an incoming value `x` to a range between `lower` and `upper`. + * @param x The value to clamp. + * @param lower The lower bound of the range to clamp `x` to. + * @param upper The upper bound of the range to clamp `x` to. + * @return The input value clamped to the given range. + */ + clamp(x: number, lower: number, upper: number): number; + /** + * Converts an angle given in degrees to an angle given in radians. + * @param degrees The input angle in degrees. + * @return The output angle in radians. + */ + radians(degrees: number): number; + /** + * Converts an angle given in radians to an angle given in degrees. + * @param radians The input angle in radians. + * @return The output angle in degrees. + */ + degrees(radians: number): number; +} diff --git a/types/ecma-proposal-math-extensions/tsconfig.json b/types/ecma-proposal-math-extensions/tsconfig.json new file mode 100644 index 0000000000..52115765eb --- /dev/null +++ b/types/ecma-proposal-math-extensions/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "target": "es2017", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ecma-proposal-math-extensions-tests.ts" + ] +} diff --git a/types/ecma-proposal-math-extensions/tslint.json b/types/ecma-proposal-math-extensions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ecma-proposal-math-extensions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 83ed128742..58faf8c7f4 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,3461 +1,3418 @@ -module AccordionComponent { - $(function () { - var sample = new ej.Accordion($("#basicAccordion"), { - width: "100%", - allowKeyboardNavigation: true, - collapseSpeed: 500, - collapsible: true, - enableAnimation: true, - enableMultipleOpen: true, - events: "click", - expandSpeed: 500, - headerSize: "40px", - htmlAttributes: { title: "Demo" }, - selectedItemIndex: 1, - showCloseButton: true, - showRoundedCorner: true - }); - }); -} - - - -module AutocompleteComponent { - var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { - width: "100%", - watermarkText: "Select a car", - dataSource: carList, - enableAutoFill: true, - showPopupButton: true, - multiSelectMode: "delimiter" - }); - }); -} - - - - - -module Barcodecomponent { - $(function () { - var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { - text:"http://www.syncfusion.com" - }); - }); -} - - - - - -module Bulletgraphcomponent { - $(function () { - var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { - isResponsive: true, - load: function () { - var sender = $("#BulletGraph").data("ejBulletGraph"); - var bulletTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; - if (bulletTheme) { - switch (bulletTheme) { - case "flatdark": - case "flatazuredark": - case "flatlimedark": - case "flatsaffrondark": - case "gradientdark": - case "gradientazuredark": - case "gradientlimedark": - case "gradientsaffrondark": - case "flathigh-contrast-01dark": - case "flathigh-contrast-02dark": - bulletTheme = "flatdark"; - break; - case "flatoffice-365light": - case "flatmateriallight": - bulletTheme = "material"; - break; - default: - bulletTheme = "flatlight"; - break; - } - sender.model.theme = bulletTheme; - } - - }, - tooltipSettings: { visible: true }, - quantitativeScaleSettings: { - featureMeasures: [{ - value: 8, comparativeMeasureValue:6.7 - }] - }, - qualitativeRanges: [{ - rangeEnd: 4.3, rangeStroke:"#ebebeb", - }, - { - rangeEnd: 7.3, rangeStroke:"#d8d8d8" - }, - { - rangeEnd: 10, rangeStroke: "#7f7f7f" - } - ], - captionSettings: { - textPosition: 'right', text: 'Revenue YTD', - subTitle: { - text: "$ in Thousands", textPosition:"right" - } - } - }); - }); -} - - - - - -module ButtonComponent { - $(function () { - var basicButton = new ej.Button($("#buttonnormal"), { - size: "large", - showRoundedCorner: true, - contentType: "textandimage", - prefixIcon: "e-icon e-save", - text: "Save" - }); - var toggleButton = new ej.ToggleButton($("#TextOnly"), { - showRoundedCorner: true, - size: "large", - contentType: "textandimage", - defaultPrefixIcon: "e-icon e-save", - activePrefixIcon: "e-icon e-delete", - defaultText: "Save", - activeText: "Delete" - }); - var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { - showRoundedCorner: true, - size: "large", - prefixIcon: "e-icon e-file-empty", - targetID: "menu1", - contentType: "textandimage", - text: "File" - }); - var groupButton = new ej.GroupButton($("#groupButton"), { - showRoundedCorner: true, - size: "large" - }); - var check1 = new ej.CheckBox($("#check1"), { - size: "medium", enableTriState: true - }); - var check2 = new ej.CheckBox($("#check2"), { - size: "medium", enableTriState: true - }); - var radio1 = new ej.RadioButton($("#radio1"), { - size: "medium" - }); - var radio2 = new ej.RadioButton($("#radio2"), { - size: "medium", checked: true - }); - }); -} - - - - -module ChartComponent { - $(function () { - var chartsample = new ej.datavisualization.Chart($("#Chart"), { - primaryXAxis: { - range: { min: 2005, max: 2011, interval: 1 }, - title: { text: "Year" }, - valueType: "category" - }, - primaryYAxis: { - range: { min: 25, max: 50, interval: 5 }, - labelFormat: "{value}%", - title: { text: "Efficiency" }, - - }, - commonSeriesOptions: - { - type: 'line', enableAnimation: true, - tooltip: { visible: true, template: 'Tooltip' }, - marker: - { - shape: 'circle', - size: - { - height: 10, width: 10 - }, - visible: true - }, - border: { width: 2 } - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, - { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } - ], - isResponsive: true, - load: function () { - var sender = $("#Chart").data("ejChart"); - if (!!window.orientation && sender) { //to modify chart properties for mobile view - var model = sender.model, - seriesLength = model.series.length; - model.legend.visible = false; - model.size.height = null; - model.size.width = null; - for (var i = 0; i < seriesLength; i++) { - if (!model.series[i].marker) - model.series[i].marker = {}; - if (!model.series[i].marker.size) - model.series[i].marker.size = {}; - model.series[i].marker.size.width = 6; - model.series[i].marker.size.height = 6; - } - model.primaryXAxis.labelIntersectAction = "rotate45"; - if (model.primaryXAxis.title) - model.primaryXAxis.title.text = ""; - if (model.primaryYAxis.title) - model.primaryYAxis.title.text = ""; - model.primaryXAxis.edgeLabelPlacement = "hide"; - model.primaryYAxis.labelIntersectAction = "rotate45"; - model.primaryYAxis.edgeLabelPlacement = "hide"; - } - var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; - if (theme) { - switch (theme) { - case "flatdark": - case "flatazuredark": - case "flatlimedark": - case "flatsaffrondark": - theme = "flatdark"; - break; - case "gradientlight": - case "gradientazurelight": - case "gradientlimelight": - case "gradientsaffronlight": - theme = "gradientlight"; - break; - case "gradientdark": - case "gradientazuredark": - case "gradientlimedark": - case "gradientsaffrondark": - theme = "gradientdark"; - break; - case "flatbootstraplight": - theme = "bootstrap"; - break; - case "flathigh-contrast-01dark": - case "flathigh-contrast-02dark": - theme = "high-contrast-01"; - break; - case "flatmateriallight": - case "flatoffice-365light": - theme = "material"; - break; - - default: - theme = "flatlight"; - break; - } - sender.model.theme = theme; - } - }, - title: { text: 'Efficiency of oil-fired power production' }, - size: { height: "600" }, - legend: { visible: true }, - }); - // chartsample.model.load="loadTheme"; - }); -} - - - - - -module circulargaugecomponent { - $(function () { - var circularsample = new ej.datavisualization.CircularGauge($("#CircularGauge"), { - enableAnimation: false, - isResponsive: true, - backgroundColor: "transparent", width: 500, - scales: [{ - showRanges: true, - startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, - border: { - width: 0.5, - }, - pointers: [{ - value: 60, - showBackNeedle: true, - backNeedleLength: 20, - length: 95, - width: 7 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -30, - startValue: 0, - endValue: 70 - }, { - distanceFromScale: -30, - startValue: 70, - endValue: 110, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -30, - startValue: 110, - endValue: 120, - backgroundColor: "#f5b43f", - border: { color: "#f5b43f" } - }] - }] - }); - }); -} - - - - -module ColorPickerComponent { - $(function () { - var colorSample = new ej.ColorPicker($("#colorpick"), { - value: "#278787" - }); - }); -} - - - - -module ComboBoxComponent { - var BikeList = [ - { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, - { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, - { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, - { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } - ]; - $(function () { - var comboboxInstance = new ej.ComboBox($("#selectCar"), { - width: "100%", - placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, - dataSource: BikeList, - autofill: true - }); - }); -} - - - - - -module DatePickerComponent { - $(function () { - var dateSample = new ej.DatePicker($("#datepick"), { - width: "100%" - }); - }); -} - - - - -module DateTimePickerComponent { - $(function () { - var datetimeSample = new ej.DateRangePicker($("#daterangepick"), { - width: "100%" - }); - }); -} - - - -module DateTimePickerComponent { - $(function () { - var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { - width: "100%" - }); - }); -} - - - -$(function () { - var diagram = new ej.datavisualization.Diagram($("#diagram"), { - width: "1000px", - height: "600px", - pageSettings: { - //Sets page size - pageHeight: 500, - pageWidth: 500, - //Customizes the appearance of page - pageBorderWidth: 4, - pageBackgroundColor: "white", - pageBorderColor: "lightgray", - pageMargin: 25, - showPageBreak: true, - multiplePage: true, - pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait - }, - scrollSettings: { - horizontalOffset: 0, - verticalOffset: 0 - }, - snapSettings: { - snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines - }, - nodes: [ - createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Terminator }), - createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), - createNode({ - name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], - type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision - }), - createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), - createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process - }), - createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), - createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), - createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) - ], - connectors: [ - createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), - createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), - createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), - createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) - ] - }); - -}); - -function createNode(option: ej.datavisualization.Diagram.Node) { - if (!option.fillColor) { - option.borderColor = "#1BA0E2"; - option.fillColor = "#1BA0E2"; - } - option.labels[0].fontColor = "white"; - return option; -} - -function createConnector(option: ej.datavisualization.Diagram.Connector) { - option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; - option.lineColor = "#606060"; - if (option.labels && option.labels.length > 0) { - option.labels[0].fillColor = "white"; - } - return option; -} - -function createLabel(options: any) { - return options; -} - - - -module DialogComponent { - $(function () { - var dialogInstance = new ej.Dialog($("#basicDialog"), { - width: 550, - minWidth: 310, - minHeight: 215, - target: ".control", - close: () => { - $("#btnOpen").show(); - } - }); - var btnInstance = new ej.Button($("#btnOpen"), { - size: "medium", - click: () => { - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open"); - }, - type: "button", - height: 30, - width: 150 - }); - }); -} - - - - -module digitalgaugecomponent { - $(function () { - var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { - width: 525, - height: 305, - isResponsive: true, - items: [{ - segmentSettings: { - width: 1, - spacing: 0, - color: "#8c8c8c" - }, - characterSettings: { - opacity: 0.8, - }, - value: "Syncfusion", - position: { x: 52, y: 52 } - }] - }); - }); -} - - - - - - -module DropDownListComponent { - var BikeList = [ - { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, - { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, - { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, - { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } - ]; - $(function () { - var sample = new ej.DropDownList($("#bikeList"), { - dataSource: BikeList, - width: "100%", - watermarkText: "Select a bike", - fields: { id: "empid", text: "text", value: "text" }, - enableFilterSearch: true, - caseSensitiveSearch: true, - enableIncrementalSearch: true, - enablePopupResize: true, - delimiterChar: ";", - multiSelectMode: ej.MultiSelectMode.Delimiter, - maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", - minPopupWidth: "350px", - showCheckbox: true, - showRoundedCorner: true - }); - }); - -} - - - - - - -module ExplorerComponent { - $(function () { - var file = new ej.FileExplorer($("#fileExplorer"), { - path: (window).baseurl + "Content/FileBrowser/", - width: "100%", - minWidth: "150px", - layout: "tile", - isResponsive: true, - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }); - }); -} - - - - -module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); - }); -} - - - -module GridComponent { - $(function () { - var gridInstance = new ej.Grid($("#Grid"), { - dataSource: (window).gridData, - allowGrouping: true, - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowPaging: true, - allowReordering: true, - allowResizing: true, - allowFiltering: true, - allowScrolling: true, - enableRowHover: true, - selectionType: "multiple", - selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, - allowKeyboardNavigation: true, - editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, - toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, - columns: [ - { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, - { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, - { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, - { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, - { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, - { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } - ], - isResponsive: true, - minWidth: 700, - showSummary: true, - summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] - }); - }); -} - - - -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] -var itemSource: any[] = []; -for (var i = 0; i < columns.length; i++) { - for (var j = 0; j < 6; j++) { - var value = Math.floor((Math.random() * 100) + 1); - itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) - } -} - -$(function () { - var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - isResponsive: true, - itemsSource: itemSource, - width: "100%", - itemsMapping: { - column: { propertyName: "ProductName", displayName: "Product Name" }, - row: { propertyName: "Year", displayName: "Year" }, - value: { propertyName: "Value" }, - columnMapping: [ - { "propertyName": columns[0], "displayName": columns[0] }, - { "propertyName": columns[1], "displayName": columns[1] }, - { "propertyName": columns[2], "displayName": columns[2] }, - { "propertyName": columns[3], "displayName": columns[3] }, - { "propertyName": columns[4], "displayName": columns[4] }, - { "propertyName": columns[5], "displayName": columns[5] } - ], - headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, - }, - legendCollection: ["heatmap_legend"] - }); - var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - height: "50px", - width: "75%", - isResponsive: true - }); -}); - - - - -module KanbanComponent { - $(function () { - var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), - columns: [ - { headerText: "Backlog", key: "Open" }, - { headerText: "In Progress", key: "InProgress" }, - { headerText: "Testing", key: "Testing" }, - { headerText: "Done", key: "Close" } - ], - keyField: "Status", - allowTitle: true, - fields: { - content: "Summary", - primaryKey: "Id", - imageUrl: "ImgUrl" - }, - allowSelection: false - }); - }); -} - - - - -module lineargaugecomponent { - $(function () { - var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { - labelColor: "#8c8c8c", width: 500, - isResponsive: true, enableAnimation: false, - scales: [{ - width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, - position: { x: 52, y: 50 }, markerPointers: [{ - value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } - }], - labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], - ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], - ranges: [{ - endValue: 60, - startValue: 0, - backgroundColor: "#F6B53F", - border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 - }, { - endValue: 100, - startValue: 60, - backgroundColor: "#E94649", - border: { color: "#E94649" }, startWidth: 4, endWidth: 4 - }] - }] - }); - }); -} - - - - - -module ListBoxComponent { - $(function () { - var listboxInstance = new ej.ListBox($("#selectcar"), { - showCheckbox: true - }); - }); -} - - - -module ListviewComponent { - $(function () { - var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 - }); - }); -} - - -var world_map= - { - "type": "FeatureCollection", - "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, - "features": [ - { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, - { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, - { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, - { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, - { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, - { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, - { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, - { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, - { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, - { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, - { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, - { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, - { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, - { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, - { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, - { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, - { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, - { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, - { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, - { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, - { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, - { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, - { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, - { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, - { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, - { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, - { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, - { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, - { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, - { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, - { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, - { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, - { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, - { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, - { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, - { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, - { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, - { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, - { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, - { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, - { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, - { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, - { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, - { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, - { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, - { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, - { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, - { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, - { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, - { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, - { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, - { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, - { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, - { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, - { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, - { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, - { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, - { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, - { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, - { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, - { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, - { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, - { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, - { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, - { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, - { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, - { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, - { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, - { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, - { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, - { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, - { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, - { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, - { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, - { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, - { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, - { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, - { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, - { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, - { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, - { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, - { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, - { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, - { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, - { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, - { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, - { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, - { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, - { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, - { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, - { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, - { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, - { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, - { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, - { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, - { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, - { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, - { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, - { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, - { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, - { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, - { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, - { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, - { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, - { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, - { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, - { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, - { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, - { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, - { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, - { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, - { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, - { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, - { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, - { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, - { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, - { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, - { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, - { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, - { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, - { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, - { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, - { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, - { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, - { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, - { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, - { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, - { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, - { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, - { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, - { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, - { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, - { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, - { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, - { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, - { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, - { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, - { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, - { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, - { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, - { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, - { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, - { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, - { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, - { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, - { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, - { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, - { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, - { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, - { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, - { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, - { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, - { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, - { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, - { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } - ] - }; - -var randomcountriesData1 = [ - { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, - { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, - { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, - { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, - { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, - { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, - { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, -]; - -module mapcomponenet { - $(function () { - var mapsample = new ej.datavisualization.Map($("#map"), { - enableAnimation: true, - navigationControl: { - enableNavigation: true, - orientation: 'vertical', - absolutePosition: { x: 5, y: 15 }, - dockPosition: 'none' - }, - layers: [ - { - layerType: 'geometry', - enableMouseHover: false, - enableSelection: false, - shapeSettings: { - fill: "#626171", - autoFill: false, - highlightStroke: "white", - stroke: "white", - strokeThickness: 0.5, - highlightColor: "#BFBFBF" - }, - shapeData: world_map, - legendSettings: { dockOnMap: false } - } - ] - }); - }); -} - - - - - - - -module MenuComponent { - $(function () { - var sample = new ej.Menu($("#syncfusionProducts"), { - width: "100%", - animationType: ej.AnimationType.Default, - cssClass: 'gradient-lime ', - enableAnimation: true, - enableSeparator: true, - height: 40, - htmlAttributes: { "aria-label": "menu" }, - menuType: "normalmenu", - orientation: ej.Orientation.Horizontal, - showRootLevelArrows: true, - showSubLevelArrows: true, - subMenuDirection: ej.Direction.Right, - titleText: "Menu", - - }); - }); - -} - - - - - - - - -module NavigationDrawerComponent { - $(function () { - var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", - contentId: "content_container", - type: "overlay", - direction: "left", - enableListView: true, - listViewSettings: { - width: 300, - selectedItemIndex: 0 - }, - position: "normal" - }); - $("#navpane_listview").click(function (e: any) { - var text = e.target["text"] || $(e.target).closest("li.e-list").text(); - $("#butdrawer").parent().children("h2").text(text); - }); - }); -} - - - -module PDFViewerComponent { - $(function () { - var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl: (window).baseurl + "api/PdfViewer", - isResponsive: true - }); - }); -} - - - -module PivotChartOlap { - $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { - dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters: [] - }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - // load:"loadTheme" - }); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotChartRelational { - - $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters: [] - }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - // load:"loadTheme" - }); - }); -} - - - -module PivotGaugeOlap { - - $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { - dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters: [] - }, - enableTooltip: true, isResponsive: true, - labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, - border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 - }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] - }] - }); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotGaugeRelational { - $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], - values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, - enableTooltip: true, isResponsive: true, - labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, - border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 - }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] - }] - }); - }); -} - - - -module PivotGridOlap { - - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { - dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" - }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotGridRelational { - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" - }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); - - }); -} - - - -module PivotTreeMap { - $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { - dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters: [] - } - }); - }); -} - - - -module ProgressBarComponent { - $(function () { - var sample = new ej.ProgressBar($("#progressBar"), { - width: 200, - value: 45, - height: 20, - enablePersistence: true, - maxValue: 200, - minValue: 0, - showRoundedCorner: true, - text: 'loading...' - }); - }); - -} - - - - -declare var rteObj: any; -declare var data: any; -var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; -var rteEle = $("#rteSample1"); -module RadialMenuComponent { - $(function () { - - if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { - var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { - imageClass: "imageclass", - backImageClass: "backimageclass", - targetElementId: "radialtarget1" - }); - $("#radialtarget1").parent().css("position", "relative"); - } - else { - $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); - } - var rteInstance = new ej.RTE($("#rteSample1"), { - width: "100%", - minWidth: "10px", - change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, - select: (e) => { - var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, - // To get Iframe positions - iframeY = e.event.clientY, iframeX = e.event.clientX, - // To set Radial Menu position within target - x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), - y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); - radialEle.ejRadialMenu("setPosition", x, y); - radialEle.focus(); - $('iframe').contents().find('body').blur(); - }, - showToolbar: false, - showContextMenu: false - }); - $(window).resize(function () { - if (ej.isMobile() && ej.isPortrait()) - $('#defaultradialmenu').css({ "left": 25 }); - }); - }); -} - - -function bold(e: any) { - - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("bold"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function italic(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("italic"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function undo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("undo"); - action -= 1; - if (action == 0) - radialEle.ejRadialMenu("disableItem", "Undo"); - radialEle.ejRadialMenu("enableItem", "Redo"); - radialEle.focus(); -} -function redo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("redo"); - action += 1; - if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); - radialEle.ejRadialMenu("enableItem", "Undo"); - radialEle.focus(); -} - - - - -module RadialSliderComponent { - $(function () { - var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" - }); - }); -} - - -module rangecomponent { - $(function () { - var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { - enableDeferredUpdate: true, - padding: "15", - allowSnapping: true, - selectedRangeSettings: { - start: "2010/5/1", end: "2011/10/1" - }, - isResponsive: true, - tooltipSettings: { - visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" - }, - load: () => { - var rn = $("#RangeNavigator").data("ejRangeNavigator"); - rn.model.series = [ - { - type: 'line', - dataSource: data.Open, xName: "XValue", yName: "YValue", - fill: '#69D2E7' - } - ]; - }, - loaded: function () { - var sender = $("#RangeNavigator").data("ejRangeNavigator"); - var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; - if (theme) { - switch (theme) { - case "flatazurelight": - theme = "azurelight"; - break; - case "flatlimelight": - theme = "limelight"; - break; - case "flatsaffronlight": - theme = "saffronlight"; - break; - case "gradientazurelight": - theme = "gradientazure"; - break; - case "gradientlimelight": - theme = "gradientlime"; - break; - case "gradientsaffronlight": - theme = "gradientsaffron"; - break; - case "flatazuredark": - theme = "azuredark"; - break; - case "flatlimedark": - theme = "limedark"; - break; - case "flatsaffrondark": - theme = "saffrondark"; - break; - case "gradientazuredark": - theme = "gradientazuredark"; - break; - case "gradientlimedark": - theme = "gradientlimedark"; - break; - case "gradientsaffrondark": - theme = "gradientsaffrondark"; - break; - case "flathigh-contrast-01dark": - theme = "highcontrast01"; - break; - case "flathigh-contrast-02dark": - theme = "highcontrast02"; - break; - case "flatmateriallight": - theme = "material"; - break; - case "flatoffice-365light": - theme = "office"; - break; - default: - theme = "flatlight"; - break; - } - sender.model.theme = theme; - } - } - - }); - }); -} -var data; -data = GetData(); - -function GetData() { - var series1: any[] = []; - var series2: any[] = []; - var value = 100; - var value1 = 120; - for (var i = 1; i < 730; i++) { - - if (Math.random() > .5) { - value += Math.random(); - value1 += Math.random(); - } else { - value -= Math.random(); - value1 -= Math.random(); - } - var point1 = { XValue: new Date(2010, 0, i), YValue: value }; - var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; - series1.push(point1); - series2.push(point2); - } - - data = { Open: series1, Close: series2 }; - return data; -}; - - - -module RatingComponent { - $(function () { - - var sample1 = new ej.Rating($("#fullRating"), { - value: 4, - precision: ej.Rating.Precision.Full, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: ej.Orientation.Horizontal, - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample2 = new ej.Rating($("#halfRating"), { - precision: ej.Rating.Precision.Half, - value: 3.5, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample3 = new ej.Rating($("#exactRating"), { - precision: ej.Rating.Precision.Exact, - value: 3.7, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - }); - -} - - - -module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); -} - - - -var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; -module RibbonComponent { - $(function () { - var sample = new ej.Ribbon($("#defaultRibbon"), { - width: "100%", - expandPinSettings: { - toolTip: "Collapse the Ribbon" - }, - collapsePinSettings: { - toolTip: "Pin the Ribbon" - }, - applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } - }, - tabs: [{ - id: "home", text: "HOME", groups: [{ - text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "new", - text: "New", - toolTip: "New", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-new", - click: "onClick" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "paste", - text: "paste", - toolTip: "Paste", - splitButtonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-ribbonpaste", - targetID: "pasteSplit", - buttonMode: "dropdown", - click: "onClick", - arrowPosition: ej.ArrowPosition.Bottom - } - } - ], - defaults: { - type: "splitbutton", - width: 50, - height: 70 - } - }, - { - groups: [{ - id: "cut", - text: "Cut", - toolTip: "Cut", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - click: "onClick", - prefixIcon: "e-icon e-ribbon e-ribboncut" - } - }, - { - id: "copy", - text: "Copy", - toolTip: "Copy", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - click: "onClick", - prefixIcon: "e-icon e-ribbon e-ribboncopy" - } - }, - { - id: "clear", - text: "Clear", - toolTip: "Clear All", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - click: "onClick", - prefixIcon: "e-icon e-ribbon clearAll" - } - }], - defaults: { - type: "button", - width: 60, - isBig: false - } - }] - }, - { - text: "Font", alignType: "rows", content: [{ - groups: [{ - id: "fontfamily", - toolTip: "Font", - dropdownSettings: { - dataSource: fontfamily, - text: "Segoe UI", - select: "onClick", - width: 150 - } - }, - { - id: "fontsize", - toolTip: "FontSize", - dropdownSettings: { - dataSource: fontsize, - text: "1pt", - select: "onClick", - width: 65 - } - }], - defaults: { - type: "dropdownlist", - height: 28 - } - }, - { - groups: [{ - id: "bold", - toolTip: "Bold", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Bold", - activeText: "Bold", - click: "onClick", - defaultPrefixIcon: "e-icon e-ribbon bold", - activePrefixIcon: "e-icon e-ribbon bold" - } - }, - { - id: "italic", - toolTip: "Italic", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Italic", - activeText: "Italic", - click: "onClick", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", - activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" - } - }, - { - id: "underline", - text: "Underline", - toolTip: "Underline", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Underline", - activeText: "Underline", - click: "onClick", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", - activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" - } - }, - { - id: "strikethrough", - text: "strikethrough", - toolTip: "Strikethrough", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Strikethrough", - activeText: "Strikethrough", - click: "onClick", - defaultPrefixIcon: "e-icon e-ribbon strikethrough", - activePrefixIcon: "e-icon e-ribbon strikethrough" - } - }, - { - id: "superscript", - text: "superscript", - toolTip: "Superscript", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-superscripticon" - } - }, - { - id: "subscript", - text: "subscript", - toolTip: "Subscript", - enableSeparator: true, - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-subscripticon" - } - }, - { - id: "fontcolor", - text: "Font Color", - toolTip: "Font Color", - type: ej.Ribbon.Type.Custom, - contentID: "fontcolor" - }, - { - id: "fillcolor", - text: "Fill Color", - toolTip: "Fill Color", - type: ej.Ribbon.Type.Custom, - contentID: "fillcolor" - } - ], - defaults: { - isBig: false - } - }] - }, - { - text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ - { - groups: [{ - id: "bullet", - text: "Bullet Format", - toolTip: "Bullets", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-bullet" - } - }, - { - id: "number", - text: "Number Format", - toolTip: "Numbering", - enableSeparator: true, - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-numbericon" - } - }, - { - id: "textindent", - text: "Indent", - toolTip: "Text Indent", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-indent" - } - }, - { - id: "textoudent", - text: "Outdent", - toolTip: "Text Outdent", - enableSeparator: true, - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-outdent" - } - }, - { - id: "sortascending", - text: "Sort", - toolTip: "Sort", - enableSeparator: true, - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-sort" - } - }, - { - id: "border", - text: "Border", - toolTip: "Border", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-border" - } - }], - defaults: { - type: "button", - isBig: false - } - }, - { - groups: [{ - id: "alignleft", - text: "JustifyLeft", - toolTip: "Align Left", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignleft" - } - }, - { - id: "aligncenter", - text: "JustifyCenter", - toolTip: "Align Center", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon aligncenter" - } - }, - { - id: "alignright", - text: "JustifyRight", - toolTip: "Align Right", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignright" - } - }, - { - id: "justify", - text: "JustifyFull", - toolTip: "Justify", - enableSeparator: true, - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon justify" - } - }, - { - id: "uppercase", - text: "Upper Case", - toolTip: "Upper Case", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-uppercase" - } - }, - { - id: "lowercase", - text: "Lower Case", - toolTip: "Lower Case", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-lowercase" - } - }], - defaults: { - type: "button", - isBig: false - } - }] - }, - { - text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "undo", - text: "Undo", - toolTip: "Undo", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-undo" - } - }, - { - id: "redo", - text: "Redo", - toolTip: "Redo", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-redo" - } - } - ], - defaults: { - type: "button", - width: 40, - height: 70 - } - }] - }, - { - text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "zoomin", - text: "Zoom In", - toolTip: "Zoom In", - buttonSettings: { - width: 58, - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomin" - } - }, - { - id: "zoomout", - text: "Zoom Out", - toolTip: "Zoom Out", - buttonSettings: { - width: 70, - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomout" - } - }, - { - id: "fullscreen", - text: "Full Screen", - toolTip: "Full Screen", - buttonSettings: { - width: 73, - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-fullscreen" - } - } - ], - defaults: { - type: "button", - height: 70 - } - }] - }] - }, { - id: "insert", text: "INSERT", groups: [{ - text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "tables", - text: "Tables", - toolTip: "Tables", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-table" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - }, - { - text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "pictures", - text: "Pictures", - toolTip: "Pictures", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-picture" - } - }, - { - id: "videos", - text: "Videos", - toolTip: "Videos", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-video" - } - }, - { - id: "shapes", - text: "Shapes", - toolTip: "Shapes", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-shape" - } - }, - { - id: "charts", - text: "Charts", - toolTip: "Charts", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-chart" - } - } - ], - defaults: { - type: "button", - width: 56, - height: 70 - } - }] - }, - { - text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "comments", - text: "Comments", - toolTip: "Comments", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-comment" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "text", - text: "Text", - toolTip: "Text", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-text", - width: 50 - } - }, - { - id: "datetime", - text: "Date Time", - toolTip: "DateTime", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-datetimenew" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "hyperlink", - text: "Hyperlink", - toolTip: "Hyperlink", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-hyperlink" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "equation", - text: "Equation", - toolTip: "Equation", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-equation" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "printlayout", - text: "Print Layout", - toolTip: "Print Layout", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-printlayout" - } - } - ], - defaults: { - type: "button", - width: 80, - height: 70 - } - }] - }, - { - text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "print", - text: "Print", - toolTip: "Print", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-print" - } - }, - { - id: "save", - text: "Save", - toolTip: "Save", - buttonSettings: { - click: "onClick", - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-save" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - } - ] - } - ], - create: function createControl(args) { - var ribbon = $("#defaultRibbon").data("ejRibbon"); - $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); - $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); - } - }); - }); -} -function colorHandler(args:any) { - (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); -} -function onClick(args: any) { - var val, prop = args.text; - val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; - if (action1.indexOf(val) != -1) - $("#contenteditor").empty(); - else if (action2.indexOf(val) != -1) - document.execCommand(val, false, null); - else if (fontfamily.indexOf(prop) != -1) - document.execCommand("FontName", false, prop); - else if (fontsize.indexOf(prop) != -1) - document.execCommand("FontSize", false, prop.replace("pt", "")); - else - $("#contenteditor").append("

Action: " + val + " Triggered

"); -} - - - - - - -module RotatorComponent { - $(function () { - var rotatorInstance = new ej.Rotator($("#sliderContent"), { - slideWidth: "100%", - frameSpace: "0px", - slideHeight: "auto", - displayItemsCount: "1", - navigateSteps: "1", - pagerPosition: "outside", - orientation: "horizontal", - showPager: true, - enabled: true, - showCaption: true, - allowKeyboardNavigation: true, - showPlayButton: true, - isResponsive: true, - animationType: "slide", - }); - }); -} - - - -module RTEComponent { - $(function () { - var sample = new ej.RTE($("#rteSample"), { - width: "100%", - minWidth: "150px", - showFooter: true, - showHtmlSource: true, - allowEditing: true, - allowKeyboardNavigation: true, - autoFocus: true, - autoHeight: true, - colorPaletteColumns: 10, - colorPaletteRows: 5, - cssClass: 'gradient-lime', - enableResize: true, - enableTabKeyNavigation: true, - fileBrowser: { - filePath: (window).baseurl + "Content/FileBrowser/", - extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }, - imageBrowser: { - filePath: (window).baseurl + "Content/FileBrowser/", - extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }, - isResponsive: true, - showClearAll: true, - showClearFormat: true, - showDimensions: true, - showCharCount: true, - tools: { - formatStyle: ["format"], - edit: ["findAndReplace"], - font: ["fontName", "fontSize", "fontColor", "backgroundColor"], - style: ["bold", "italic", "underline", "strikethrough"], - alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], - lists: ["unorderedList", "orderedList"], - clipboard: ["cut", "copy", "paste"], - doAction: ["undo", "redo"], - indenting: ["outdent", "indent"], - clear: ["clearFormat", "clearAll"], - links: ["createLink", "removeLink"], - images: ["image"], - media: ["video"], - tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], - effects: ["superscript", "subscript"], - casing: ["upperCase", "lowerCase"], - view: ["fullScreen", "zoomIn", "zoomOut"], - print: ["print"], - customUnorderedList: [{ - name: "unOrderInsert", - tooltip: "Custom UnOrderList", - css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", - text: "Smiley", - listImage: "url('../content/images/rte/Smiley-GIF.gif')" - }], - customOrderedList: [{ - name: "orderInsert", - tooltip: "Custom OrderList", - css: "e-rte-toolbar-icon e-rte-listitems customOrder", - text: "Lower-Greek", - listStyle: "lower-greek" - }] - } - }); - }); - -} - - - -module ScheduleComponent { - $(function () { - var sample = new ej.Schedule($("#Schedule1"), { - width: "100%", - height: "525px", - currentDate: new Date(2017, 5, 5), - timeScale: { - minorSlotCount: 4, - majorSlot: 60 - }, - contextMenuSettings: { - enable: true, - menuItems: { - appointment: [ - { id: "open", text: "Open Appointment" }, - { id: "delete", text: "Delete Appointment" }, - { id: "customMenu3", text: "Menu Item 3" }, - { id: "customMenu4", text: "Menu Item 4" } - ], - cells: [ - { id: "new", text: "New Appointment" }, - { id: "recurrence", text: "New Recurring Appointment" }, - { id: "today", text: "Today" }, - { id: "gotodate", text: "Go to date" }, - { id: "settings", text: "Settings" }, - { id: "view", text: "View", parentId: "settings" }, - { id: "timemode", text: "TimeMode", parentId: "settings" }, - { id: "view_Day", text: "Day", parentId: "view" }, - { id: "view_Week", text: "Week", parentId: "view" }, - { id: "view_Workweek", text: "Workweek", parentId: "view" }, - { id: "view_Month", text: "Month", parentId: "view" }, - { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, - { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, - { id: "workhours", text: "Work Hours", parentId: "settings" }, - { id: "customMenu1", text: "Menu Item 1" }, - { id: "customMenu2", text: "Menu Item 2" } - ] - } - }, - resources: [{ - field: "ownerId", - title: "Owner", - name: "Owners", allowMultiple: true, - resourceSettings: { - dataSource: [ - { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, - { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, - { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } - ], - text: "text", id: "id", groupId: "groupId", color: "color" - } - }], - appointmentSettings: { - dataSource: new ej.DataManager((window).ResourcesData).executeLocal(new ej.Query().take(10)), - id: "Id", - subject: "Subject", - startTime: "StartTime", - endTime: "EndTime", - description: "Description", - allDay: "AllDay", - recurrence: "Recurrence", - recurrenceRule: "RecurrenceRule", - resourceFields: "ownerId" - } - }); - }); -} - - - -module ScrollerComponent { - $(function () { - var scrollerSample = new ej.Scroller($("#scrollcontent"), { - height: "300px", - width: "100%" - }); - $(window).bind('resize', function () { - scrollerSample.refresh(); - }); - }); -} - - - -module SignatureComponent { - $(function () { - var basicSignature = new ej.Signature($("#signature"), { - height: "400px", - isResponsive: true, - strokeWidth: 3 - }); - }); -} - - - - -module SliderComponent { - $(function () { - var slider = new ej.Slider($("#minSlider"), { - sliderType: "MinRange", - value: 60, - minValue: 0, - maxValue: 100 - }); - var rangeslider = new ej.Slider($("#rangeSlider"), { - sliderType: "Range", - values: [30, 60], - minValue: 0 - }); - - }); -} - - - - - - -module linesparkline { - $(function () { - - var sparklinesample = new ej.Sparkline($("#line"), { - dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], - tooltip: { - visible: true, - font: { size: "12px" } - }, - type: "line", - size: { height: "40", width: "170" }, - }); - }); -} - -module columnsparkline { - $(function () { - var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], - negativePointColor: "red", - highPointColor: "blue", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - type: "column", - size: { height: "100", width: "150" }, - }); - }); -} - -module areasparkline { - $(function () { - var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], - markerSettings: { visible: true }, - highPointColor: "blue", - lowPointColor: "orange", - type: "area", - opacity: 0.5, - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "100", width: "150" }, - }); - }); -} - -module windlosssparkline { - $(function () { - var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], - type: "winloss", - size: { height: "100", width: "150" }, - }); - }); -} - -module piesparkline1 { - $(function () { - var sparkpiesample1 = new ej.Sparkline($("#pie1"), { - dataSource: [4, 6, 7], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline2 { - $(function () { - var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1, ], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline3 { - $(function () { - var sparkpiesample3 = new ej.Sparkline($("#pie3"), { - dataSource: [2, 3, 5], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline4 { - $(function () { - var sparkpiesample4 = new ej.Sparkline($("#pie4"), { - dataSource: [10, 12, 11], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - - - - - - -module SplitterComponent { - $(function () { - var splitterInstance = new ej.Splitter($("#outterSpliter"), { - height: "250px", - width: "50%", - orientation: ej.Orientation.Vertical, - properties: [{}, { paneSize: 80 }], - isResponsive: true - }); - var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive: true, - }); - }); -} - - - -module SpreadsheetComponent { - $(function () { - var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { - scrollSettings: { - height: 550, - }, - importSettings: { - importMapper: (window).baseurl + "api/Spreadsheet/Import" - }, - exportSettings: { - excelUrl: (window).baseurl + "api/Spreadsheet/ExcelExport", - csvUrl: (window).baseurl + "api/Spreadsheet/CsvExport", - pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" - }, - sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - } - } - }); - }); -} - - - - -var default_data: Array = [ - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, - { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, - - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, - { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, - { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, - - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, - { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, - - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, - { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, - { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } -]; - -module sunburstcomponent { - $(function () { - var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", - levels: [ - { groupMemberPath: "Country" }, - { groupMemberPath: "JobDescription" }, - { groupMemberPath: "JobGroup" }, - { groupMemberPath: "JobRole" } - ], - dataSource: default_data, - dataLabelSettings: { visible: true }, - tooltip: { visible: false }, - enableAnimation: false, - size: { height: "600" }, - innerRadius: 0.2, - load: function () { - var sender = $("#Sunburst").data("ejSunburstChart"); - var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; - SunBurstTheme = SunBurstTheme.toString(); - if (SunBurstTheme.indexOf("dark") > -1 || SunBurstTheme.indexOf("contrast") > -1) - SunBurstTheme = "flatdark"; - else - SunBurstTheme = "flatlight"; - sender.model.theme = SunBurstTheme; - }, - title: { text: "Employees Count" }, - zoomSettings: { enable: false }, - legend: { visible: true, position: 'top' } - // load:"loadTheme" - }); - }); -} - - - - -module TabComponent { - $(function () { - var sample = new ej.Tab($("#defaultTab"), { - width: "500px", - collapsible: true, - events: "click", - heightAdjustMode: ej.Tab.HeightAdjustMode.Content, - showCloseButton: true, - showRoundedCorner: false - }); - }); -} - - - -module TagCloudComponent { - - - var websiteCollection = [ - { text: "Google", url: "http://www.google.com", frequency: 12 }, - { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, - { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, - { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, - { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, - { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, - { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, - { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, - { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, - { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, - { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, - { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, - { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, - { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, - { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, - { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, - { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, - { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } - ]; - - $(function () { - var sample = new ej.TagCloud($("#techWebList"), { - titleText: "Tech Sites", - dataSource: websiteCollection, - cssClass: "gradient-lime", - fields: { - text: "text", url: "url", frequency: "frequency" - } - }); - - }); -} - - - -module EditorComponent { - $(function () { - var num = new ej.NumericTextbox($("#numeric"), { - value: 30, - minValue: 1, - maxValue: 100, - name: "numeric", - width: "100%" - }); - var per = new ej.PercentageTextbox($("#percent"), { - value: 60, - minValue: 10, - maxValue: 1000, - name: "percent", - width: "100%" - }); - var cur = new ej.CurrencyTextbox($("#currency"), { - value: 100, - minValue: 10, - maxValue: 1000, - name: "currency", - width: "100%" - }); - var mask = new ej.MaskEdit($("#maskedit"), { - name: "mask", - value: "4242422424", - maskFormat: "99 999-99999", - width: "100%" - }) - }); -} - - - - - -module TileViewComponent { - $(function () { - var tile1 = new ej.Tile($("#tile1"), { - imagePosition: "fill", - caption: { text: "People" }, - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_1.png' - }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/alerts.png', - - }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/bing.png', - }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize: "small", - imageUrl: 'content/images/tile/windows/camera.png', - }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/messages.png', - }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/games.png', - caption: { text: "Play" } - }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize: "medium", - imageUrl: 'content/images/tile/windows/map.png', - caption: { text: "Maps" } - }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition: "fill", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/sports.png', - caption: { text: "Sports" } - }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition: "fill", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_2.png', - caption: { text: "People" } - }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/pictures.png', - caption: { text: "Photo" } - }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition: "center", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/weather.png', - caption: { text: "Weather" } - }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/music.png', - caption: { text: "Music" } - }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/favs.png', - caption: { text: "Favorites" } - }); - }); -} - - - -module TimePickerComponent { - $(function () { - var timeSample = new ej.TimePicker($("#timepick"), { - width: "100%" - }); - }); -} - - - - -module ToolbarComponent { - - $(function () { - var sample = new ej.Toolbar($("#editingToolbar"), { - width: "100%", - cssClass: "gradient-lime", - enableSeparator: true, - - isResponsive: true, - orientation: ej.Orientation.Horizontal, - showRoundedCorner: true - }); - }); - -} - - - - -module TooltipComponent { - - $(function () { - - var sample1 = new ej.Tooltip($("#link1"), { - content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample2 = new ej.Tooltip($("#link2"), { - content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", - position: { - stem: { - horizontal: "right", - vertical: "center" - }, - target: { - horizontal: "left", - vertical: "center" - } - }, - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample3 = new ej.Tooltip($("#link3"), { - content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', - position: { - stem: { - horizontal: "right", - vertical: "center" - }, - target: { - horizontal: "left", - vertical: "center", - }, - }, - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - }); -} - - - -module TreeGridComponent { - $(function () { - var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); - }); -} - - - - -var population_data: Array = [ - { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, - { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, - { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, - { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, - { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, - { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, - { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, - { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, - { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, - { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, - { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, - { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, - { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } -]; - -module treemapcomponent { - $(function () { - var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { - leafItemSettings: { showLabels: true, labelPath: "Country" }, - rangeColorMapping: [ - { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, - { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, - { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, - { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } - ], - levels: [ - { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } - ], - dataSource: population_data, - colorValuePath: "Growth", - weightValuePath: "Population", - borderThickness: 0, - showLegend: true - }); - }); -} - - - - - -module TreeViewComponent { - $(function () { - var tree = new ej.TreeView($("#treeView"), { - allowEditing: true, - allowDragAndDrop: true, - allowDropChild: true, - allowDropSibling: true, - }); - }); -} - - - - -module UploadboxComponent { - - $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"), { - saveUrl: (window).baseurl + "api/uploadbox/Save", - removeUrl: (window).baseurl + "api/uploadbox/Remove", - buttonText: { - browse: "Choose File", upload: "Upload", cancel: "Cancel" - }, - cssClass: "gradient- purple", - dialogAction: { - modal: false, closeOnComplete: false, drag: true - }, - extensionsAllow: ".zip", - multipleFilesSelection: true, - showFileDetails: true - }); - }); - -} - - - - -module WaitingPopupComponent { - $(function () { - var sample = new ej.WaitingPopup($("#target"), { - showOnInit: true, - showImage: true, - text: 'waiting…', - target: "#target", - appendTo: "#waiting" - }); - }); - -} +module AccordionComponent { + $(function () { + var sample = new ej.Accordion($("#basicAccordion"), { + width: "100%", + allowKeyboardNavigation: true, + collapseSpeed: 500, + collapsible: true, + enableAnimation: true, + enableMultipleOpen: true, + events: "click", + expandSpeed: 500, + headerSize: "40px", + htmlAttributes: { title: "Demo" }, + selectedItemIndex: 1, + showCloseButton: true, + showRoundedCorner: true + }); + }); +} + + + +module AutocompleteComponent{ + var carList = [ + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + width: "100%", + watermarkText: "Select a car", + dataSource: carList, + enableAutoFill: true, + showPopupButton: true, + multiSelectMode: "delimiter" + }); + }); +} + + + + +module Barcodecomponent { + $(function () { + var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { + text:"http://www.syncfusion.com" + }); + }); +} + + + + + +module Bulletgraphcomponent { + $(function () { + var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { + isResponsive: true, + load: function () { + var sender = $("#BulletGraph").data("ejBulletGraph"); + var bulletTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; + if (bulletTheme) { + switch (bulletTheme) { + case "flatdark": + case "flatazuredark": + case "flatlimedark": + case "flatsaffrondark": + case "gradientdark": + case "gradientazuredark": + case "gradientlimedark": + case "gradientsaffrondark": + case "flathigh-contrast-01dark": + case "flathigh-contrast-02dark": + bulletTheme = "flatdark"; + break; + case "flatoffice-365light": + case "flatmateriallight": + bulletTheme = "material"; + break; + default: + bulletTheme = "flatlight"; + break; + } + sender.model.theme = bulletTheme; + } + + }, + tooltipSettings: { visible: true }, + quantitativeScaleSettings: { + featureMeasures: [{ + value: 8, comparativeMeasureValue:6.7 + }] + }, + qualitativeRanges: [{ + rangeEnd: 4.3, rangeStroke:"#ebebeb", + }, + { + rangeEnd: 7.3, rangeStroke:"#d8d8d8" + }, + { + rangeEnd: 10, rangeStroke: "#7f7f7f" + } + ], + captionSettings: { + textPosition: 'right', text: 'Revenue YTD', + subTitle: { + text: "$ in Thousands", textPosition:"right" + } + } + }); + }); +} + + + + + +module ButtonComponent { + $(function () { + var basicButton = new ej.Button($("#buttonnormal"), { + size: "large", + showRoundedCorner: true, + contentType: "textandimage", + prefixIcon: "e-icon e-save", + text: "Save" + }); + var toggleButton = new ej.ToggleButton($("#TextOnly"), { + showRoundedCorner: true, + size: "large", + contentType: "textandimage", + defaultPrefixIcon: "e-icon e-save", + activePrefixIcon: "e-icon e-delete", + defaultText: "Save", + activeText: "Delete" + }); + var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { + showRoundedCorner: true, + size: "large", + prefixIcon: "e-icon e-file-empty", + targetID: "menu1", + contentType: "textandimage", + text: "File" + }); + var groupButton = new ej.GroupButton($("#groupButton"), { + showRoundedCorner: true, + size: "large" + }); + var check1 = new ej.CheckBox($("#check1"), { + size: "medium", enableTriState: true + }); + var check2 = new ej.CheckBox($("#check2"), { + size: "medium", enableTriState: true + }); + var radio1 = new ej.RadioButton($("#radio1"), { + size: "medium" + }); + var radio2 = new ej.RadioButton($("#radio2"), { + size: "medium", checked: true + }); + }); +} + + + + +module ChartComponent { + $(function () { + var chartsample = new ej.datavisualization.Chart($("#Chart"), { + primaryXAxis: { + range: { min: 2005, max: 2011, interval: 1 }, + title: { text: "Year" }, + valueType: "category" + }, + primaryYAxis: { + range: { min: 25, max: 50, interval: 5 }, + labelFormat: "{value}%", + title: { text: "Efficiency" }, + }, + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : { width: 2 } + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, + { + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } + ], + isResponsive: true, + load: function () { + var sender = $("#Chart").data("ejChart"); + if (!!window.orientation && sender) { //to modify chart properties for mobile view + var model = sender.model, + seriesLength = model.series.length; + model.legend.visible = false; + model.size.height = null; + model.size.width = null; + for (var i = 0; i < seriesLength; i++) { + if (!model.series[i].marker) + model.series[i].marker = {}; + if (!model.series[i].marker.size) + model.series[i].marker.size = {}; + model.series[i].marker.size.width = 6; + model.series[i].marker.size.height = 6; + } + model.primaryXAxis.labelIntersectAction = "rotate45"; + if (model.primaryXAxis.title) + model.primaryXAxis.title.text = ""; + if (model.primaryYAxis.title) + model.primaryYAxis.title.text = ""; + model.primaryXAxis.edgeLabelPlacement = "hide"; + model.primaryYAxis.labelIntersectAction = "rotate45"; + model.primaryYAxis.edgeLabelPlacement = "hide"; + } + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; + if (theme) { + switch (theme) { + case "flatdark": + case "flatazuredark": + case "flatlimedark": + case "flatsaffrondark": + theme = "flatdark"; + break; + case "gradientlight": + case "gradientazurelight": + case "gradientlimelight": + case "gradientsaffronlight": + theme = "gradientlight"; + break; + case "gradientdark": + case "gradientazuredark": + case "gradientlimedark": + case "gradientsaffrondark": + theme = "gradientdark"; + break; + case "flatbootstraplight": + theme = "bootstrap"; + break; + case "flathigh-contrast-01dark": + case "flathigh-contrast-02dark": + theme = "high-contrast-01"; + break; + case "flatmateriallight": + case "flatoffice-365light": + theme = "material"; + break; + + default: + theme = "flatlight"; + break; + } + sender.model.theme = theme; + } + }, + title: { text: 'Efficiency of oil-fired power production' }, + size: { height: "600" }, + legend: { visible: true}, + }); + }); +} + + + + +module circulargaugecomponent { + $(function () { + var circularsample = new ej.datavisualization.CircularGauge($("#CircularGauge"), { + enableAnimation: false, + isResponsive: true, + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }] + }); + }); +} + + + +module ColorPickerComponent { + $(function () { + var colorSample = new ej.ColorPicker($("#colorpick"), { + value: "#278787" + }); + }); +} + + + + +module ComboBoxComponent{ + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { + width: "100%", + placeholder: "Select a Bike", + fields: { text: "text", value: "empid" }, + dataSource: BikeList, + autofill: true + }); + }); +} + + + +module DatePickerComponent { + $(function () { + var dateSample = new ej.DatePicker($("#datepick"), { + width: "100%" + }); + }); +} + + + + +module DateTimePickerComponent { + $(function () { + var datetimeSample = new ej.DateRangePicker($("#daterangepick"), { + width: "100%" + }); + }); +} + + + +module DateTimePickerComponent { + $(function () { + var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { + width: "100%" + }); + }); +} + + + +$(function () { + var diagram = new ej.datavisualization.Diagram($("#diagram"), { + width: "1000px", + height: "600px", + pageSettings: { + //Sets page size + pageHeight: 500, + pageWidth: 500, + //Customizes the appearance of page + pageBorderWidth: 4, + pageBackgroundColor: "white", + pageBorderColor: "lightgray", + pageMargin: 25, + showPageBreak: true, + multiplePage: true, + pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait + }, + scrollSettings: { + horizontalOffset: 0, + verticalOffset: 0 + }, + snapSettings: { + snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines + }, + nodes: [ + createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Terminator }), + createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ + name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], + type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision + }), + createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), + createNode({ + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), + createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) + ], + connectors: [ + createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), + createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), + createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), + createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) + ] + }); +}); + +function createNode(option: ej.datavisualization.Diagram.Node) { + if (!option.fillColor) { + option.borderColor = "#1BA0E2"; + option.fillColor = "#1BA0E2"; + } + option.labels[0].fontColor = "white"; + return option; +} + +function createConnector(option: ej.datavisualization.Diagram.Connector) { + option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; + option.lineColor = "#606060"; + if (option.labels && option.labels.length > 0) { + option.labels[0].fillColor = "white"; + } + return option; +} + +function createLabel(options : any) { + return options; +} + + +module DialogComponent { + $(function () { + var dialogInstance = new ej.Dialog($("#basicDialog"), { + width: 550, + minWidth: 310, + minHeight: 215, + target:".control", + close:()=>{ + $("#btnOpen").show();} + }); + var btnInstance = new ej.Button($("#btnOpen"), { + size: "medium", + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, + type: "button", + height: 30, + width: 150 + }); + }); +} + + + + +module digitalgaugecomponent { + $(function () { + var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { + width: 525, + height: 305, + isResponsive: true, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "Syncfusion", + position: { x: 52, y: 52 } + }] + }); + }); +} + + + + + +module DropDownListComponent { + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var sample = new ej.DropDownList($("#bikeList"),{ + dataSource: BikeList, + width: "100%", + watermarkText: "Select a bike", + fields: { id: "empid", text: "text", value: "text" }, + enableFilterSearch: true, + caseSensitiveSearch: true, + enableIncrementalSearch: true, + enablePopupResize: true, + delimiterChar: ";", + multiSelectMode: ej.MultiSelectMode.Delimiter, + maxPopupHeight: "300px", + minPopupHeight: "150px", + maxPopupWidth: "500px", + minPopupWidth: "350px", + showCheckbox: true, + showRoundedCorner: true + }); + }); +} + + + + + +module ExplorerComponent { + $(function () { + var file = new ej.FileExplorer($("#fileExplorer"), { + path: (window).baseurl + "Content/FileBrowser/", + width: "100%", + minWidth: "150px", + layout: "tile", + isResponsive: true, + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }); + }); +} + + + + +module GanttComponent { + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); +}); +} + + + +module GridComponent { + $(function () { + var gridInstance = new ej.Grid($("#Grid"), { + dataSource: (window).gridData, + allowGrouping: true, + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowPaging: true, + allowReordering: true, + allowResizing: true, + allowFiltering: true, + allowScrolling: true, + enableRowHover: true, + selectionType: "multiple", + selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, + allowKeyboardNavigation: true, + editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, + toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, + columns: [ + { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, + { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, + { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } + ], + isResponsive: true, + minWidth: 700, + showSummary: true, + summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] + }); + }); +} + + + +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fl�temysost"] +var itemSource: any[] = []; +for (var i = 0; i < columns.length; i++) { + for (var j = 0; j < 6; j++) { + var value = Math.floor((Math.random() * 100) + 1); + itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) + } +} + +$(function () { + var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + isResponsive: true, + itemsSource: itemSource, + width: "100%", + itemsMapping: { + column: { propertyName: "ProductName", displayName: "Product Name" }, + row: { propertyName: "Year", displayName: "Year" }, + value: { propertyName: "Value" }, + columnMapping: [ + { "propertyName": columns[0], "displayName": columns[0] }, + { "propertyName": columns[1], "displayName": columns[1] }, + { "propertyName": columns[2], "displayName": columns[2] }, + { "propertyName": columns[3], "displayName": columns[3] }, + { "propertyName": columns[4], "displayName": columns[4] }, + { "propertyName": columns[5], "displayName": columns[5] } + ], + headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, + }, + legendCollection: ["heatmap_legend"] + }); + var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + height: "50px", + width: "75%", + isResponsive: true + }); +}); + + + + +module KanbanComponent { + $(function () { + var sample = new ej.Kanban($("#Kanban"), { + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + allowTitle: true, + fields: { + content: "Summary", + primaryKey: "Id", + imageUrl: "ImgUrl" + }, + allowSelection: false + }); + }); +} + + +module lineargaugecomponent { + $(function () { + var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { + labelColor: "#8c8c8c", width: 500, + isResponsive: true, enableAnimation: false, + scales: [{ + width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }] + }); + }); +} + + + +module ListBoxComponent { + $(function () { + var listboxInstance = new ej.ListBox($("#selectcar"), { + showCheckbox: true + }); + }); +} + + + +module ListviewComponent { + $(function () { + var listviewInstance = new ej.ListView($("#defaultlistview"), { + enableCheckMark: true, + width: 400 + }); + }); +} + + +var world_map= + { + "type": "FeatureCollection", + "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, + "features": [ + { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, + { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, + { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, + { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, + { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, + { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, + { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, + { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, + { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, + { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, + { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, + { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, + { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, + { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, + { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, + { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, + { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, + { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, + { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, + { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, + { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, + { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, + { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, + { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, + { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, + { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, + { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, + { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "C�te d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, + { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, + { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, + { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, + { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, + { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, + { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, + { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, + { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, + { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, + { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, + { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, + { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, + { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, + { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, + { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, + { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, + { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, + { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, + { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, + { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, + { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, + { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, + { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, + { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, + { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, + { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, + { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, + { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, + { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, + { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, + { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, + { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, + { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, + { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, + { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, + { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, + { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, + { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, + { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, + { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, + { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, + { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, + { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, + { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, + { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, + { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, + { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, + { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, + { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, + { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, + { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, + { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, + { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, + { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, + { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, + { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, + { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, + { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, + { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, + { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, + { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, + { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, + { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, + { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, + { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, + { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, + { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, + { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, + { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, + { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, + { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, + { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, + { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, + { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, + { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, + { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, + { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, + { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, + { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, + { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, + { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, + { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, + { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, + { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, + { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, + { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, + { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, + { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, + { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, + { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, + { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, + { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, + { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, + { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, + { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, + { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, + { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, + { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, + { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, + { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, + { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, + { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, + { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, + { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, + { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, + { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, + { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, + { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, + { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, + { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, + { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, + { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, + { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, + { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, + { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, + { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, + { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, + { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, + { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, + { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, + { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, + { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, + { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, + { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, + { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, + { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } + ] + }; + +var randomcountriesData1 = [ + { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, + { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, + { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, + { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, + { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, + { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, + { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, +]; + +module mapcomponenet { + $(function () { + var mapsample = new ej.datavisualization.Map($("#map"), { + enableAnimation: true, + navigationControl: { + enableNavigation: true, + orientation: 'vertical', + absolutePosition: { x: 5, y: 15 }, + dockPosition: 'none' + }, + layers: [ + { + layerType: 'geometry', + enableMouseHover: false, + enableSelection: false, + shapeSettings: { + fill: "#626171", + autoFill: false, + highlightStroke: "white", + stroke: "white", + strokeThickness: 0.5, + highlightColor: "#BFBFBF" + }, + shapeData: world_map, + legendSettings: { dockOnMap: false } + } + ] + }); + }); +} + + + + + + +module MenuComponent { + $(function () { + var sample = new ej.Menu($("#syncfusionProducts"),{ + width: "100%", + animationType: ej.AnimationType.Default, + cssClass: 'gradient-lime ', + enableAnimation: true, + enableSeparator: true, + height: 40, + htmlAttributes: { "aria-label": "menu" }, + menuType: "normalmenu", + orientation: ej.Orientation.Horizontal, + showRootLevelArrows: true, + showSubLevelArrows: true, + subMenuDirection: ej.Direction.Right, + titleText: "Menu", + }); + }); +} + + +module NavigationDrawerComponent { + $(function () { + var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { + targetId: "butdrawer", + contentId: "content_container", + type: "overlay", + direction: "left", + enableListView: true, + listViewSettings: { + width: 300, + selectedItemIndex: 0 + }, + position: "normal" + }); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#butdrawer").parent().children("h2").text(text); + }); + }); +} + + + +module PDFViewerComponent { + $(function () { + var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { + serviceUrl:(window).baseurl+ "api/PdfViewer", + isResponsive: true + }); + }); +} + + + +module PivotChartOlap { + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; + }, + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotChartRelational { + + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; + }, + }); + }); +} + + + +module PivotGaugeOlap { + + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGaugeRelational { + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], + values: [ + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +module PivotGridOlap { + + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGridRelational { + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + }); +} + + + +module PivotTreeMap { + $(function () { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + dataSource: { + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } + }); + }); +} + + + +module ProgressBarComponent { + $(function () { + var sample = new ej.ProgressBar($("#progressBar"),{ + width: 200, + value: 45, + height: 20, + enablePersistence: true, + maxValue: 200, + minValue: 0, + showRoundedCorner: true, + text: 'loading...' + }); + }); + +} + + + + +declare var rteObj: any; +declare var data: any; +var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; +var rteEle = $("#rteSample1"); +module RadialMenuComponent { + $(function () { + + if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { + var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { + imageClass: "imageclass", + backImageClass: "backimageclass", + targetElementId: "radialtarget1" + }); + $("#radialtarget1").parent().css("position", "relative"); + } + else { + $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); + } + var rteInstance = new ej.RTE($("#rteSample1"), { + width: "100%", + minWidth: "10px", + change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, + select: (e) => { + var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, + // To get Iframe positions + iframeY = e.event.clientY, iframeX = e.event.clientX, + // To set Radial Menu position within target + x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), + y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); + radialEle.ejRadialMenu("setPosition", x, y); + radialEle.focus(); + $('iframe').contents().find('body').blur(); + }, + showToolbar: false, + showContextMenu: false + }); + $(window).resize(function () { + if (ej.isMobile() && ej.isPortrait()) + $('#defaultradialmenu').css({ "left": 25 }); + }); + }); +} + + +function bold(e: any) { + + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("bold"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function italic(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("italic"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function undo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("undo"); + action -= 1; + if (action == 0) + radialEle.ejRadialMenu("disableItem", "Undo"); + radialEle.ejRadialMenu("enableItem", "Redo"); + radialEle.focus(); +} +function redo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("redo"); + action += 1; + if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); + radialEle.ejRadialMenu("enableItem", "Undo"); + radialEle.focus(); +} + + +module RadialSliderComponent { + $(function () { + var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { + innerCircleImageUrl: "images/radialslider/chevron-right.png" + }); + }); +} + + +module rangecomponent { + $(function () { + var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { + enableDeferredUpdate: true, + padding: "15", + allowSnapping: true, + selectedRangeSettings: { + start: "2010/5/1", end: "2011/10/1" + }, + isResponsive: true, + tooltipSettings: { + visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" + }, + load: () => { + var rn = $("#RangeNavigator").data("ejRangeNavigator"); + rn.model.series = [ + { + type: 'line', + dataSource: data.Open, xName: "XValue", yName: "YValue", + fill: '#69D2E7' + } + ]; + }, + loaded: function () { + var sender = $("#RangeNavigator").data("ejRangeNavigator"); + var theme = (window).themeStyle + (window).themeColor + (window).themeVarient; + if (theme) { + switch (theme) { + case "flatazurelight": + theme = "azurelight"; + break; + case "flatlimelight": + theme = "limelight"; + break; + case "flatsaffronlight": + theme = "saffronlight"; + break; + case "gradientazurelight": + theme = "gradientazure"; + break; + case "gradientlimelight": + theme = "gradientlime"; + break; + case "gradientsaffronlight": + theme = "gradientsaffron"; + break; + case "flatazuredark": + theme = "azuredark"; + break; + case "flatlimedark": + theme = "limedark"; + break; + case "flatsaffrondark": + theme = "saffrondark"; + break; + case "gradientazuredark": + theme = "gradientazuredark"; + break; + case "gradientlimedark": + theme = "gradientlimedark"; + break; + case "gradientsaffrondark": + theme = "gradientsaffrondark"; + break; + case "flathigh-contrast-01dark": + theme = "highcontrast01"; + break; + case "flathigh-contrast-02dark": + theme = "highcontrast02"; + break; + case "flatmateriallight": + theme = "material"; + break; + case "flatoffice-365light": + theme = "office"; + break; + default: + theme = "flatlight"; + break; + } + sender.model.theme = theme; + } + } + + }); + }); +} +var data; +data = GetData(); + +function GetData() { + var series1:any[]=[]; + var series2:any[]= []; + var value = 100; + var value1 = 120; + for (var i = 1; i < 730; i++) { + + if (Math.random() > .5) { + value += Math.random(); + value1 += Math.random(); + } else { + value -= Math.random(); + value1 -= Math.random(); + } + var point1 = { XValue: new Date(2010, 0, i), YValue: value }; + var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; + series1.push(point1); + series2.push(point2); + } + + data = { Open: series1, Close: series2 }; + return data; +}; + + + +module RatingComponent { + $(function () { + + var sample1 = new ej.Rating($("#fullRating"),{ + value: 4, + precision: ej.Rating.Precision.Full, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: ej.Orientation.Horizontal, + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample2 = new ej.Rating($("#halfRating"),{ + precision: ej.Rating.Precision.Half, + value: 3.5, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample3 = new ej.Rating($("#exactRating"),{ + precision: ej.Rating.Precision.Exact, + value: 3.7, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + }); +} + + + +module ReportViewerComponent { + $(function () { + var report = new ej.ReportViewer($("#DefaultReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "ConditionalFormating.rdl", + isResponsive: true + }); + }); +} + + + +var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; +module RibbonComponent { + $(function () { + var sample = new ej.Ribbon($("#defaultRibbon"), { + width: "100%", + expandPinSettings: { + toolTip: "Collapse the Ribbon" + }, + collapsePinSettings: { + toolTip: "Pin the Ribbon" + }, + applicationTab: { + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + }, + tabs: [{ + id: "home", text: "HOME", groups: [{ + text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "new", + text: "New", + toolTip: "New", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-new", + click: "onClick" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "paste", + text: "paste", + toolTip: "Paste", + splitButtonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-ribbonpaste", + targetID: "pasteSplit", + buttonMode: "dropdown", + click: "onClick", + arrowPosition: ej.ArrowPosition.Bottom + } + } + ], + defaults: { + type: "splitbutton", + width: 50, + height: 70 + } + }, + { + groups: [{ + id: "cut", + text: "Cut", + toolTip: "Cut", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + click: "onClick", + prefixIcon: "e-icon e-ribbon e-ribboncut" + } + }, + { + id: "copy", + text: "Copy", + toolTip: "Copy", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + click: "onClick", + prefixIcon: "e-icon e-ribbon e-ribboncopy" + } + }, + { + id: "clear", + text: "Clear", + toolTip: "Clear All", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + click: "onClick", + prefixIcon: "e-icon e-ribbon clearAll" + } + }], + defaults: { + type: "button", + width: 60, + isBig: false + } + }] + }, + { + text: "Font", alignType: "rows", content: [{ + groups: [{ + id: "fontfamily", + toolTip: "Font", + dropdownSettings: { + dataSource: fontfamily, + text: "Segoe UI", + select: "onClick", + width: 150 + } + }, + { + id: "fontsize", + toolTip: "FontSize", + dropdownSettings: { + dataSource: fontsize, + text: "1pt", + select: "onClick", + width: 65 + } + }], + defaults: { + type: "dropdownlist", + height: 28 + } + }, + { + groups: [{ + id: "bold", + toolTip: "Bold", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Bold", + activeText: "Bold", + click: "onClick", + defaultPrefixIcon: "e-icon e-ribbon bold", + activePrefixIcon: "e-icon e-ribbon bold" + } + }, + { + id: "italic", + toolTip: "Italic", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Italic", + activeText: "Italic", + click: "onClick", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", + activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" + } + }, + { + id: "underline", + text: "Underline", + toolTip: "Underline", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Underline", + activeText: "Underline", + click: "onClick", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", + activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" + } + }, + { + id: "strikethrough", + text: "strikethrough", + toolTip: "Strikethrough", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Strikethrough", + activeText: "Strikethrough", + click: "onClick", + defaultPrefixIcon: "e-icon e-ribbon strikethrough", + activePrefixIcon: "e-icon e-ribbon strikethrough" + } + }, + { + id: "superscript", + text: "superscript", + toolTip: "Superscript", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-superscripticon" + } + }, + { + id: "subscript", + text: "subscript", + toolTip: "Subscript", + enableSeparator: true, + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-subscripticon" + } + }, + { + id: "fontcolor", + text: "Font Color", + toolTip: "Font Color", + type: ej.Ribbon.Type.Custom, + contentID: "fontcolor" + }, + { + id: "fillcolor", + text: "Fill Color", + toolTip: "Fill Color", + type: ej.Ribbon.Type.Custom, + contentID: "fillcolor" + } + ], + defaults: { + isBig: false + } + }] + }, + { + text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ + { + groups: [{ + id: "bullet", + text: "Bullet Format", + toolTip: "Bullets", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-bullet" + } + }, + { + id: "number", + text: "Number Format", + toolTip: "Numbering", + enableSeparator: true, + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-numbericon" + } + }, + { + id: "textindent", + text: "Indent", + toolTip: "Text Indent", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-indent" + } + }, + { + id: "textoudent", + text: "Outdent", + toolTip: "Text Outdent", + enableSeparator: true, + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-outdent" + } + }, + { + id: "sortascending", + text: "Sort", + toolTip: "Sort", + enableSeparator: true, + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-sort" + } + }, + { + id: "border", + text: "Border", + toolTip: "Border", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-border" + } + }], + defaults: { + type: "button", + isBig: false + } + }, + { + groups: [{ + id: "alignleft", + text: "JustifyLeft", + toolTip: "Align Left", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignleft" + } + }, + { + id: "aligncenter", + text: "JustifyCenter", + toolTip: "Align Center", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon aligncenter" + } + }, + { + id: "alignright", + text: "JustifyRight", + toolTip: "Align Right", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignright" + } + }, + { + id: "justify", + text: "JustifyFull", + toolTip: "Justify", + enableSeparator: true, + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon justify" + } + }, + { + id: "uppercase", + text: "Upper Case", + toolTip: "Upper Case", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-uppercase" + } + }, + { + id: "lowercase", + text: "Lower Case", + toolTip: "Lower Case", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-lowercase" + } + }], + defaults: { + type: "button", + isBig: false + } + }] + }, + { + text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "undo", + text: "Undo", + toolTip: "Undo", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-undo" + } + }, + { + id: "redo", + text: "Redo", + toolTip: "Redo", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-redo" + } + } + ], + defaults: { + type: "button", + width: 40, + height: 70 + } + }] + }, + { + text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "zoomin", + text: "Zoom In", + toolTip: "Zoom In", + buttonSettings: { + width: 58, + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomin" + } + }, + { + id: "zoomout", + text: "Zoom Out", + toolTip: "Zoom Out", + buttonSettings: { + width: 70, + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomout" + } + }, + { + id: "fullscreen", + text: "Full Screen", + toolTip: "Full Screen", + buttonSettings: { + width: 73, + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-fullscreen" + } + } + ], + defaults: { + type: "button", + height: 70 + } + }] + }] + },{ + id: "insert", text: "INSERT", groups: [{ + text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "tables", + text: "Tables", + toolTip: "Tables", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-table" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + }, + { + text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "pictures", + text: "Pictures", + toolTip: "Pictures", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-picture" + } + }, + { + id: "videos", + text: "Videos", + toolTip: "Videos", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-video" + } + }, + { + id: "shapes", + text: "Shapes", + toolTip: "Shapes", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-shape" + } + }, + { + id: "charts", + text: "Charts", + toolTip: "Charts", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-chart" + } + } + ], + defaults: { + type: "button", + width: 56, + height: 70 + } + }] + }, + { + text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "comments", + text: "Comments", + toolTip: "Comments", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-comment" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "text", + text: "Text", + toolTip: "Text", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-text", + width: 50 + } + }, + { + id: "datetime", + text: "Date Time", + toolTip: "DateTime", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-datetimenew" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "hyperlink", + text: "Hyperlink", + toolTip: "Hyperlink", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-hyperlink" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "equation", + text: "Equation", + toolTip: "Equation", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-equation" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "printlayout", + text: "Print Layout", + toolTip: "Print Layout", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-printlayout" + } + } + ], + defaults: { + type: "button", + width: 80, + height: 70 + } + }] + }, + { + text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "print", + text: "Print", + toolTip: "Print", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-print" + } + }, + { + id: "save", + text: "Save", + toolTip: "Save", + buttonSettings: { + click: "onClick", + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-save" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + } + ] + } + ], + create: function createControl(args) { + var ribbon = $("#defaultRibbon").data("ejRibbon"); + $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); + $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); + } + }); + }); +} +function colorHandler(args:any) { + (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); +} +function onClick(args:any) { + let val:any, prop = args.text; + val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; + if (action1.indexOf(val) != -1) + $("#contenteditor").empty(); + else if (action2.indexOf(val) != -1) + document.execCommand(val, false, null); + else if (fontfamily.indexOf(prop) != -1) + document.execCommand("FontName", false, prop); + else if (fontsize.indexOf(prop) != -1) + document.execCommand("FontSize", false, prop.replace("pt", "")); + else + $("#contenteditor").append("

Action: " + val + " Triggered

"); +} + + +module RotatorComponent { + $(function () { + var rotatorInstance = new ej.Rotator($("#sliderContent"), { + slideWidth: "100%", + frameSpace: "0px", + slideHeight: "auto", + displayItemsCount: "1", + navigateSteps: "1", + pagerPosition:"outside", + orientation: "horizontal", + showPager: true, + enabled: true, + showCaption: true, + allowKeyboardNavigation: true, + showPlayButton: true, + isResponsive:true, + animationType: "slide", + }); + }); +} + + + +module RTEComponent { + $(function () { + var sample = new ej.RTE($("#rteSample"),{ + width: "100%", + minWidth: "150px", + showFooter: true, + showHtmlSource: true, + allowEditing: true, + allowKeyboardNavigation: true, + autoFocus: true, + autoHeight: true, + colorPaletteColumns: 10, + colorPaletteRows: 5, + cssClass: 'gradient-lime', + enableResize: true, + enableTabKeyNavigation: true, + fileBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + imageBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + isResponsive: true, + showClearAll: true, + showClearFormat: true, + showDimensions: true, + showCharCount: true, + tools: { + formatStyle: ["format"], + edit: ["findAndReplace"], + font: ["fontName", "fontSize", "fontColor", "backgroundColor"], + style: ["bold", "italic", "underline", "strikethrough"], + alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], + lists: ["unorderedList", "orderedList"], + clipboard: ["cut", "copy", "paste"], + doAction: ["undo", "redo"], + indenting: ["outdent", "indent"], + clear: ["clearFormat", "clearAll"], + links: ["createLink", "removeLink"], + images: ["image"], + media: ["video"], + tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], + effects: ["superscript", "subscript"], + casing: ["upperCase", "lowerCase"], + view: ["fullScreen", "zoomIn", "zoomOut"], + print: ["print"], + customUnorderedList: [{ + name: "unOrderInsert", + tooltip: "Custom UnOrderList", + css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", + text: "Smiley", + listImage: "url('../content/images/rte/Smiley-GIF.gif')" + }], + customOrderedList: [{ + name: "orderInsert", + tooltip: "Custom OrderList", + css: "e-rte-toolbar-icon e-rte-listitems customOrder", + text: "Lower-Greek", + listStyle: "lower-greek" + }] + } + }); + }); + +} + + + +module ScheduleComponent { + $(function () { + var sample = new ej.Schedule($("#Schedule1"), { + width: "100%", + height: "525px", + currentDate: new Date(2017, 5, 5), + timeScale: { + minorSlotCount: 4, + majorSlot: 60 + }, + contextMenuSettings: { + enable: true, + menuItems: { + appointment: [ + { id: "open", text: "Open Appointment" }, + { id: "delete", text: "Delete Appointment" }, + { id: "customMenu3", text: "Menu Item 3" }, + { id: "customMenu4", text: "Menu Item 4" } + ], + cells: [ + { id: "new", text: "New Appointment" }, + { id: "recurrence", text: "New Recurring Appointment" }, + { id: "today", text: "Today" }, + { id: "gotodate", text: "Go to date" }, + { id: "settings", text: "Settings" }, + { id: "view", text: "View", parentId: "settings" }, + { id: "timemode", text: "TimeMode", parentId: "settings" }, + { id: "view_Day", text: "Day", parentId: "view" }, + { id: "view_Week", text: "Week", parentId: "view" }, + { id: "view_Workweek", text: "Workweek", parentId: "view" }, + { id: "view_Month", text: "Month", parentId: "view" }, + { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, + { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, + { id: "workhours", text: "Work Hours", parentId: "settings" }, + { id: "customMenu1", text: "Menu Item 1" }, + { id: "customMenu2", text: "Menu Item 2" } + ] + } + }, + resources: [{ + field: "ownerId", + title: "Owner", + name: "Owners", allowMultiple: true, + resourceSettings: { + dataSource: [ + { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, + { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, + { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } + ], + text: "text", id: "id", groupId: "groupId", color: "color" + } + }], + appointmentSettings: { + dataSource: new ej.DataManager((window).ResourcesData).executeLocal(new ej.Query().take(10)), + id: "Id", + subject: "Subject", + startTime: "StartTime", + endTime: "EndTime", + description: "Description", + allDay: "AllDay", + recurrence: "Recurrence", + recurrenceRule: "RecurrenceRule", + resourceFields: "ownerId" + } + }); + }); +} + + + +module ScrollerComponent { + $(function () { + var scrollerSample = new ej.Scroller($("#scrollcontent"), { + height: "300px", + width: "100%" + }); + $(window).bind('resize', function () { + scrollerSample.refresh(); + }); + + }); +} + + + +module SignatureComponent { + $(function () { + var basicSignature = new ej.Signature($("#signature"), { + height: "400px", + isResponsive: true, + strokeWidth: 3 + }); + }); +} + + + + +module SliderComponent { + $(function () { + var slider = new ej.Slider($("#minSlider"), { + sliderType: "MinRange", + value: 60, + minValue: 0, + maxValue: 100 + }); + var rangeslider = new ej.Slider($("#rangeSlider"), { + sliderType: "Range", + values: [30, 60], + minValue: 0 + }); + + }); +} + + + + + + +module linesparkline { + $(function () { + + var sparklinesample = new ej.Sparkline($("#line"), { + dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], + tooltip: { + visible: true, + font: { size:"12px" } + }, + type: "line", + size: { height: "40", width:"170" }, + }); + }); +} + +module columnsparkline { + $(function () { + var sparkcolumnsample = new ej.Sparkline($("#column"), { + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + negativePointColor: "red", + highPointColor: "blue", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + type: "column", + size: { height: "100", width: "150" }, + }); + }); +} + +module areasparkline { + $(function () { + var sparkareasample = new ej.Sparkline($("#area"), { + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + markerSettings: { visible: true }, + highPointColor: "blue", + lowPointColor: "orange", + type: "area", + opacity: 0.5, + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "100", width: "150" }, + }); + }); +} + +module windlosssparkline { + $(function () { + var sparkwinlosssample = new ej.Sparkline($("#winloss"), { + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + type: "winloss", + size: { height: "100", width: "150" }, + }); + }); +} + +module piesparkline1 { + $(function () { + var sparkpiesample1 = new ej.Sparkline($("#pie1"), { + dataSource: [4, 6, 7], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline2 { + $(function () { + var sparkpiesample2 = new ej.Sparkline($("#pie2"), { + dataSource: [8, 9, 1,], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline3 { + $(function () { + var sparkpiesample3 = new ej.Sparkline($("#pie3"), { + dataSource: [2, 3, 5], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline4 { + $(function () { + var sparkpiesample4 = new ej.Sparkline($("#pie4"), { + dataSource: [10, 12, 11], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + + + +module SplitterComponent { + $(function () { + var splitterInstance = new ej.Splitter($("#outterSpliter"), { + height: "250px", + width: "50%", + orientation: ej.Orientation.Vertical, + properties: [{}, { paneSize: 80 }], + isResponsive:true + }); + var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { + isResponsive:true, + }); + }); +} + + + +module SpreadsheetComponent { +$(function () { + var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { + scrollSettings: { + height: 550, + }, + importSettings: { + importMapper: (window).baseurl + "api/Spreadsheet/Import" + }, + exportSettings: { + excelUrl: (window).baseurl + "api/Spreadsheet/ExcelExport", + csvUrl: (window).baseurl + "api/Spreadsheet/CsvExport", + pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" + }, + sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} + }); + }); +} + + + +var default_data: Array = [ + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } +]; + +module sunburstcomponent { + $(function () { + var sunburstsample = new ej.SunburstChart($("#Sunburst"), { + valueMemberPath: "EmployeesCount", + levels: [ + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} + ], + dataSource: default_data, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, + load: function () { + var sender = $("#Sunburst").data("ejSunburstChart"); + var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; + SunBurstTheme = SunBurstTheme.toString(); + if (SunBurstTheme.indexOf("dark") > -1 || SunBurstTheme.indexOf("contrast") > -1) + SunBurstTheme = "flatdark"; + else + SunBurstTheme = "flatlight"; + sender.model.theme = SunBurstTheme; + }, + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'}, + }); + }); +} + + + +module TabComponent { + $(function () { + var sample = new ej.Tab($("#defaultTab"),{ + width: "500px", + collapsible: true, + events: "click", + heightAdjustMode: ej.Tab.HeightAdjustMode.Content, + showCloseButton: true, + showRoundedCorner: false + }); + }); +} + + + +module TagCloudComponent { + + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, + { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, + { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, + { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, + { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, + { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, + { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, + { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, + { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, + { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, + { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, + { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, + { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, + { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, + { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, + { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } + ]; + + $(function () { + var sample = new ej.TagCloud($("#techWebList"), { + titleText: "Tech Sites", + dataSource: websiteCollection, + cssClass: "gradient-lime", + fields: { + text: "text", url: "url", frequency: "frequency" + } + }); + }); +} + + +module EditorComponent { + $(function () { + var num = new ej.NumericTextbox($("#numeric"), { + value: 30, + minValue: 1, + maxValue: 100, + name: "numeric", + width: "100%" + }); + var per = new ej.PercentageTextbox($("#percent"), { + value: 60, + minValue: 10, + maxValue: 1000, + name: "percent", + width: "100%" + }); + var cur = new ej.CurrencyTextbox($("#currency"), { + value: 100, + minValue: 10, + maxValue: 1000, + name: "currency", + width: "100%" + }); + var mask = new ej.MaskEdit($("#maskedit"), { + name: "mask", + value: "4242422424", + maskFormat: "99 999-99999", + width: "100%" + }) + }); +} + + +module TileViewComponent { + $(function () { + var tile1 = new ej.Tile($("#tile1"), { + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' + }); + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + }); + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', + }); + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', + }); + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', + }); + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} + }); + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} + }); + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} + }); + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} + }); + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} + }); + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} + }); + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} + }); + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} + }); + }); +} + + + +module TimePickerComponent { + $(function () { + var timeSample = new ej.TimePicker($("#timepick"), { + width: "100%" + }); + }); +} + + + + +module ToolbarComponent { + $(function () { + var sample = new ej.Toolbar($("#editingToolbar"),{ + width: "100%", + cssClass: "gradient-lime", + enableSeparator: true, + isResponsive: true, + orientation: ej.Orientation.Horizontal, + showRoundedCorner: true + }); + }); +} + + + +module TooltipComponent { + $(function () { + + var sample1 = new ej.Tooltip($("#link1"),{ + content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample2 = new ej.Tooltip($("#link2"),{ + content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center" + } + }, + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample3 = new ej.Tooltip($("#link3"),{ + content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center", + }, + }, + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + }); +} + + + +module TreeGridComponent { + $(function () { + var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); +}); +} + + + +var population_data: Array = [ + { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, + { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, + { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, + { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, + { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, + { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, + { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, + { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, + { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, + { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, + { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, + { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, + { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } +]; + +module treemapcomponent { + $(function () { + var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { + leafItemSettings: { showLabels: true, labelPath: "Country" }, + rangeColorMapping: [ + { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, + { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, + { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, + { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } + ], + levels: [ + { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } + ], + dataSource: population_data, + colorValuePath: "Growth", + weightValuePath: "Population", + borderThickness: 0, + showLegend: true + }); + }); +} + + + +module TreeViewComponent { + $(function () { + var tree = new ej.TreeView($("#treeView"), { + allowEditing: true, + allowDragAndDrop: true, + allowDropChild: true, + allowDropSibling: true, + }); + }); +} + + + + +module UploadboxComponent { + + $(function () { + var sample = new ej.Uploadbox($("#UploadDefault"),{ + saveUrl: (window).baseurl + "api/uploadbox/Save", + removeUrl: (window).baseurl + "api/uploadbox/Remove", + buttonText: { + browse: "Choose File", upload: "Upload", cancel: "Cancel" + }, + cssClass: "gradient- purple", + dialogAction: { + modal: false, closeOnComplete: false, drag: true + }, + extensionsAllow: ".zip", + multipleFilesSelection: true, + showFileDetails: true + }); + }); + +} + + + +module WaitingPopupComponent { + $(function () { + var sample = new ej.WaitingPopup($("#target"),{ + showOnInit: true, + showImage: true, + text: 'waiting…', + target: "#target", + appendTo: "#waiting" + }); + }); + +} diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 77332f6a6d..7584d0ba4c 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 16.1 +// Type definitions for ej.web.all 16.2 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.1.0.37 +* version : 16.2.0.41 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -23226,10 +23226,9 @@ declare namespace ej { getCurrentViewData(): any[]; /** Get the data of given row index in grid. - * @param {number} Pass the index of the row to get the corresponding data * @returns {any} */ - getDataByIndex(rowIndex: number): any; + getDataByIndex(): any; /** Get the column field name from the given header text in grid. * @param {string} Pass header text of the column to get its corresponding field name @@ -24810,6 +24809,10 @@ declare namespace ej { */ isShiftKeyPressed?: boolean; + /** Returns the cancel option value. + */ + cancel?: boolean; + /** Returns the grid model. */ model?: any; @@ -30849,6 +30852,10 @@ declare namespace ej { */ beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; + /** Triggers before rendering multiple series with multiple axes. + */ + beforeSeriesRender?(e: BeforeSeriesRenderEventArgs): void; + /** Triggers when performing drill up/down operation in the pivot chart control. */ drillSuccess?(e: DrillSuccessEventArgs): void; @@ -30915,6 +30922,13 @@ declare namespace ej { element?: any; } + export interface BeforeSeriesRenderEventArgs { + + /** series - Instance of the series which is about to get rendered + */ + data?: any; + } + export interface DrillSuccessEventArgs { /** returns the current instance of PivotChart. @@ -33114,10 +33128,6 @@ declare namespace ej { */ load?(e: LoadEventArgs): void; - /** Triggers before populating the pivot engine from datasource. - */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - /** Triggers when drill up/down happens in PivotTreeMap control. And it returns the outer HTML of PivotTreeMap control. */ drillSuccess?(e: DrillSuccessEventArgs): void; @@ -33180,13 +33190,6 @@ declare namespace ej { element?: any; } - export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotTreeMap control. - */ - treeMapObject?: any; - } - export interface DrillSuccessEventArgs { /** return the HTML element of PivotTreeMap control. @@ -35392,6 +35395,11 @@ declare namespace ej { */ clearFilter(): void; + /** To clear the sorted columns in Gantt. + * @returns {void} + */ + clearSorting(): void; + /** To collapse all the parent items in Gantt * @returns {void} */ @@ -35450,6 +35458,16 @@ declare namespace ej { */ filterContent(ejPredicate: Gantt.EjPredicate): void; + /** To get available column collection in Gantt. + * @returns {void} + */ + getColumns(): void; + + /** To get the column collection which are used to edit the task by using task add/edit dialog in resource view. + * @returns {void} + */ + getResourceViewEditColumns(): void; + /** To hide the column by using header text * @param {string} you can pass a header text of a column to hide * @returns {void} @@ -35500,6 +35518,12 @@ declare namespace ej { */ selectMultipleRows(rowIndexes: any[]): void; + /** Method to set scroll top value for Gantt control. + * @param {number} Pass a value to set top position of vertical scroll bar. + * @returns {void} + */ + setScrollTop(Top: number): void; + /** Positions the splitter by the specified column index. * @param {number} Set the splitter position based on column index. * @returns {void} @@ -35553,6 +35577,13 @@ declare namespace ej { */ updateRecordByIndex(index: number, data: any): void; + /** To update the schedule start date and schedule end date of project. + * @param {string} New schedule start date of project + * @param {string} New schedule end date of project + * @returns {void} + */ + updateScheduleDates(startDate: string, endDate: string): void; + /** To change an existing Gantt ID by new ID value dynamically * @param {number} you can pass an existing ID value to be change * @param {number} you can pass a new ID value to be change @@ -37237,7 +37268,7 @@ declare namespace ej { /** Specifies the list of toolbar items to be rendered in Gantt toolbar * @Default {[]} */ - toolbarItems?: any[]; + toolbarItems?: Array; /** Allows the user to insert custom toolbar items. */ @@ -37386,6 +37417,49 @@ declare namespace ej { } + enum ToolbarItems { + + ///Enables the add icon in toolbar + Add, + + ///Enables the edit icon in toolbar + Edit, + + ///Enables the edit icon in toolbar + Delete, + + ///Enables the update icon in toolbar + Update, + + ///Enables the cancel icon in toolbar + Cancel, + + ///Enables the search icon in toolbar + Search, + + ///Enables the indent icon in toolbar + Indent, + + ///Enables the outdent icon in toolbar + Outdent, + + ///Enables the expand all icon in toolbar + ExpandAll, + + ///Enables the collapse all icon in toolbar + CollapseAll, + + ///Enables the previous time span icon in toolbar + PrevTimeSpan, + + ///Enables the next time span icon in toolbar + NextTimeSpan, + + ///Enables the excel export toolbar icon + ExcelExport + } + + enum ViewType { ///Displays the project in task view in Gantt. @@ -38083,173 +38157,56 @@ declare namespace ej { */ addRow(data: any, rowPosition: string): void; + /** Clears the filter applied to a specific column. + * @param {string} Pass the column field name to clear filtering done in that column. + * @returns {void} + */ + clearFilter(fieldName: string): void; + /** To clear all the selection in TreeGrid * @param {number} you can pass a row index to clear the row selection. * @returns {void} */ clearSelection(index: number): void; - /** To select cell based on the cell and row index dynamically. - * @param {any[]} array of cell indexes to be select - * @param {boolean} Defines that we need to preserve the previously selected cells or not + /** To clear the sorting from sorted columns in TreeGrid. * @returns {void} */ - selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; - - /** To rename a column with the specified name - * @param {number} Index of the column to be renamed - * @param {string} Header text of the column - * @returns {void} - */ - renameColumn(columnIndex: number, name: string): void; - - /** To delete the specified column - * @param {number} Index of the column to be deleted - * @returns {void} - */ - deleteColumn(columnIndex: number): void; + clearSorting(): void; /** To collapse all the parent items in tree grid * @returns {void} */ collapseAll(): void; - /** To hide the column by using header text - * @param {string} you can pass a header text of a column to hide. - * @returns {void} - */ - hideColumn(headerText: string): void; - - /** Expands the records at specific hierarchical level - * @param {number} you can pass the level as index number to expand - * @returns {void} - */ - expandAtLevel(index: number): void; - /** Collapses the records at specific hierarchical level * @param {number} you can pass the particular level as index. * @returns {void} */ collapseAtLevel(index: number): void; - /** To refresh the changes in tree grid - * @param {any[]} Pass which data source you want to show in tree grid - * @param {any} Pass which data you want to show in tree grid + /** To change the index of the tree column in TreeGrid. + * @param {number} Pass the column index to make the column as treeColumnIndex. * @returns {void} */ - refresh(dataSource: any[], query: any): void; + columnIndex(Index: number): void; - /** Freeze all the columns preceding to the column specified by the field name. - * @param {string} Freeze all Columns before this field column. + /** To delete the specified column + * @param {number} Index of the column to be deleted * @returns {void} */ - freezePrecedingColumns(field: string): void; + deleteColumn(columnIndex: number): void; - /** Freeze/unfreeze the specified column. - * @param {string} Freeze/Unfreeze this field column. - * @param {boolean} Decides to Freeze/Unfreeze this field column. + /** To expand all the root level nodes in TreeGrid. * @returns {void} */ - freezeColumn(field: string, isFrozen: boolean): void; + expandAll(): void; - /** To save the edited cell in TreeGrid + /** Expands the records at specific hierarchical level + * @param {number} you can pass the level as index number to expand * @returns {void} */ - saveCell(): void; - - /** To show the column by using header text - * @param {string} you can pass a header text of a column to show. - * @returns {void} - */ - showColumn(headerText: string): void; - - /** To sorting the data based on the particular fields - * @param {string} you can pass a name of column to sort. - * @param {string} you can pass a sort direction to sort the column. - * @returns {void} - */ - sortColumn(fieldName: string, columnSortDirection: string): void; - - /** To move the TreeGrid rows programmatically with from index ,to index and position. - * @param {number} you can pass drag Index of the row - * @param {number} you can pass target Index of the row. - * @param {string} you can pass the drop position as above,below,child - * @returns {void} - */ - moveRow(fromIndex: number, toIndex: number, position: string): void; - - /** To reorder the column with field name and target index values - * @param {string} you can pass a name of column to reorder. - * @param {string} you can pass a target column index to be inserted. - * @returns {void} - */ - reorderColumn(fieldName: string, targetIndex: string): void; - - /** To get the updated data source of TreeGrid. - * @returns {any[]} - */ - getUpdatedRecords(): any[]; - - /** Sends request to navigate to a specific page in TreeGrid. - * @param {number} Pass the page index to perform paging at specified page index. - * @returns {void} - */ - gotoPage(PageIndex: number): void; - - /** To change the checkbox selection to any column. - * @param {string} Pass the column field name to check box selection to that column. - * @returns {void} - */ - updateCheckboxColumn(fieldName: string): void; - - /** Gets the selected cell(s) element details in TreeGrid. - * @returns {any[]} - */ - getSelectedCells(): any[]; - - /** Sets the minimum responsive width for TreeGrid. - * @param {string} Pass the minimum responsive width, above which the TreeGrid needs to work in responsive mode. - * @returns {void} - */ - updateResponsiveMinWidth(width: string): void; - - /** To open the dialog to add new record/row in TreeGrid. - * @returns {void} - */ - showAddDialog(): void; - - /** To open the dialog to edit a row/record in TreeGrid. - * @param {number} Pass the index of row to be edit. - * @returns {void} - */ - showEditDialog(Index: number): void; - - /** Sets the scroll left and scroll top offsets of TreeGrid. - * @param {string} Pass a value to set left position of horizontal scroll bar. - * @param {string} Pass a value to set top position of vertical scroll bar. - * @returns {void} - */ - scrollOffset(Left: string, Top: string): void; - - /** Gets the scroll top offset of TreeGrid. - * @returns {number} - */ - getScrollTopOffset(): number; - - /** Gets the scroll left offset of TreeGrid. - * @returns {number} - */ - getScrollLeftOffset(): number; - - /** Sets the scroll top offset of TreeGrid to 0. - * @returns {void} - */ - scrollToTop(): void; - - /** Sets the scroll top offset of TreeGrid to maximum value. - * @returns {void} - */ - scrollToBottom(): void; + expandAtLevel(index: number): void; /** To expand and collapse an item in TreeGrid using item’s index. * @param {number} Pass the row index of row to expand/collapse. @@ -38257,16 +38214,11 @@ declare namespace ej { */ expandCollapseRow(Index: number): void; - /** To expand all the root level nodes in TreeGrid. + /** To expand collapse the total summary row. + * @param {boolean} Decides to expand/collapse the total summary * @returns {void} */ - expandAll(): void; - - /** Show/Hide the detail row of a specific record. - * @param {number} Pass the row index of record to show/hide the detail row. - * @returns {void} - */ - showHideDetailsRow(rowIndex: number): void; + expandCollapseTotalSummary(expanded: boolean): void; /** Sends filtering request to filter a column in TreeGrid. * @param {string} Pass the field name of the column. @@ -38286,16 +38238,30 @@ declare namespace ej { */ filterContent(ejPredicate: TreeGrid.EjPredicate): void; - /** To change the index of the tree column in TreeGrid. - * @param {number} Pass the column index to make the column as treeColumnIndex. + /** Freeze/unfreeze the specified column. + * @param {string} Freeze/Unfreeze this field column. + * @param {boolean} Decides to Freeze/Unfreeze this field column. * @returns {void} */ - columnIndex(Index: number): void; + freezeColumn(field: string, isFrozen: boolean): void; - /** To clear the sorting from sorted columns in TreeGrid. + /** Freeze all the columns preceding to the column specified by the field name. + * @param {string} Freeze all Columns before this field column. * @returns {void} */ - clearSorting(): void; + freezePrecedingColumns(field: string): void; + + /** Gets the column object of specific column. + * @param {string} Pass the column field name to get details of that column. + * @returns {any} + */ + getColumnByField(fieldName: string): any; + + /** Gets the column object of specific column. + * @param {string} Pass the column header text to get details of that column. + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; /** Gets the column index of specific column with data source field. * @param {string} Pass the column field name to get its index. @@ -38309,23 +38275,144 @@ declare namespace ej { */ getFieldNameByHeaderText(headerText: string): string; - /** Gets the column object of specific column. - * @param {string} Pass the column header text to get details of that column. - * @returns {any} + /** Gets the scroll left offset of TreeGrid. + * @returns {number} */ - getColumnByHeaderText(headerText: string): any; + getScrollLeftOffset(): number; - /** Clears the filter applied to a specific column. - * @param {string} Pass the column field name to clear filtering done in that column. + /** Gets the scroll top offset of TreeGrid. + * @returns {number} + */ + getScrollTopOffset(): number; + + /** Gets the selected cell(s) element details in TreeGrid. + * @returns {any[]} + */ + getSelectedCells(): any[]; + + /** To get the updated data source of TreeGrid. + * @returns {any[]} + */ + getUpdatedRecords(): any[]; + + /** Sends request to navigate to a specific page in TreeGrid. + * @param {number} Pass the page index to perform paging at specified page index. * @returns {void} */ - clearFilter(fieldName: string): void; + gotoPage(PageIndex: number): void; - /** Gets the column object of specific column. - * @param {string} Pass the column field name to get details of that column. - * @returns {any} + /** To hide the column by using header text + * @param {string} you can pass a header text of a column to hide. + * @returns {void} */ - getColumnByField(fieldName: string): any; + hideColumn(headerText: string): void; + + /** To move the TreeGrid rows programmatically with from index ,to index and position. + * @param {number} you can pass drag Index of the row + * @param {number} you can pass target Index of the row. + * @param {string} you can pass the drop position as above,below,child + * @returns {void} + */ + moveRow(fromIndex: number, toIndex: number, position: string): void; + + /** To refresh the changes in tree grid + * @param {any[]} Pass which data source you want to show in tree grid + * @param {any} Pass which data you want to show in tree grid + * @returns {void} + */ + refresh(dataSource: any[], query: any): void; + + /** To rename a column with the specified name + * @param {number} Index of the column to be renamed + * @param {string} Header text of the column + * @returns {void} + */ + renameColumn(columnIndex: number, name: string): void; + + /** To reorder the column with field name and target index values + * @param {string} you can pass a name of column to reorder. + * @param {string} you can pass a target column index to be inserted. + * @returns {void} + */ + reorderColumn(fieldName: string, targetIndex: string): void; + + /** To save the edited cell in TreeGrid + * @returns {void} + */ + saveCell(): void; + + /** Sets the scroll left and scroll top offsets of TreeGrid. + * @param {string} Pass a value to set left position of horizontal scroll bar. + * @param {string} Pass a value to set top position of vertical scroll bar. + * @returns {void} + */ + scrollOffset(Left: string, Top: string): void; + + /** Sets the scroll top offset of TreeGrid to maximum value. + * @returns {void} + */ + scrollToBottom(): void; + + /** Sets the scroll top offset of TreeGrid to 0. + * @returns {void} + */ + scrollToTop(): void; + + /** To select cell based on the cell and row index dynamically. + * @param {any[]} array of cell indexes to be select + * @param {boolean} Defines that we need to preserve the previously selected cells or not + * @returns {void} + */ + selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; + + /** To open the dialog to add new record/row in TreeGrid. + * @returns {void} + */ + showAddDialog(): void; + + /** To show the column by using header text + * @param {string} you can pass a header text of a column to show. + * @returns {void} + */ + showColumn(headerText: string): void; + + /** To open the dialog to edit a row/record in TreeGrid. + * @param {number} Pass the index of row to be edit. + * @returns {void} + */ + showEditDialog(Index: number): void; + + /** Show/Hide the detail row of a specific record. + * @param {number} Pass the row index of record to show/hide the detail row. + * @returns {void} + */ + showHideDetailsRow(rowIndex: number): void; + + /** To sorting the data based on the particular fields + * @param {string} you can pass a name of column to sort. + * @param {string} you can pass a sort direction to sort the column. + * @returns {void} + */ + sortColumn(fieldName: string, columnSortDirection: string): void; + + /** To change the checkbox selection to any column. + * @param {string} Pass the column field name to check box selection to that column. + * @returns {void} + */ + updateCheckboxColumn(fieldName: string): void; + + /** To update the value of TreeGrid row by using row index. + * @param {number} index of record to be updated + * @param {any} object with modified field value + * @returns {void} + */ + updateRecordByIndex(index: number, data: any): void; + + /** Sets the minimum responsive width for TreeGrid. + * @param {string} Pass the minimum responsive width, above which the TreeGrid needs to work in responsive mode. + * @returns {void} + */ + updateResponsiveMinWidth(width: string): void; } export namespace TreeGrid { @@ -38350,16 +38437,16 @@ declare namespace ej { export interface Model { - /** Enables or disables the ability to resize the column width interactively. - * @Default {false} - */ - allowColumnResize?: boolean; - /** Enables or disables the option for column reordering * @Default {false} */ allowColumnReordering?: boolean; + /** Enables or disables the ability to resize the column width interactively. + * @Default {false} + */ + allowColumnResize?: boolean; + /** Enables or disables the ability to drag and drop the row interactively to reorder the rows. * @Default {false} */ @@ -38381,6 +38468,16 @@ declare namespace ej { */ allowMultiSorting?: boolean; + /** Enables/disables pagination of rows in TreeGrid + * @Default {false} + */ + allowPaging?: boolean; + + /** Enables or disables the toolbar searching in TreeGrid. + * @Default {false} + */ + allowSearching?: boolean; + /** Enables or disables the ability to select a row interactively. * @Default {true} */ @@ -38391,16 +38488,6 @@ declare namespace ej { */ allowSorting?: boolean; - /** Enables or disables the toolbar searching in TreeGrid. - * @Default {false} - */ - allowSearching?: boolean; - - /** Enables/disables pagination of rows in TreeGrid - * @Default {false} - */ - allowPaging?: boolean; - /** Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. * @Default {false} */ @@ -38410,23 +38497,38 @@ declare namespace ej { */ altRowTemplateID?: string; - /** Specifies the mapping property path for the expand status of a record in data source. + /** Specifies the template for cell tooltip + * @Default {null} */ - expandStateMapping?: string; + cellTooltipTemplate?: string; /** Specifies the mapping property path for sub tasks in datasource */ childMapping?: string; - /** Option for adding columns; each column has the option to bind to a field in the dataSource. + /** Enables or disables the expandable/collapsible footer summary row. By default expander icon for footer summary will be rendered in first column of first summary row. + * @Default {false} */ - columns?: Column[]; + collapsibleTotalSummary?: boolean; /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. * @Default {[]} */ columnDialogFields?: any[]; + /** Specifies the settings for column resize + */ + columnResizeSettings?: ColumnResizeSettings; + + /** Option for adding columns; each column has the option to bind to a field in the dataSource. + */ + columns?: Column[]; + + /** Defines the common width for all the columns in TreeGrid + * @Default {150} + */ + commonWidth?: number; + /** Options for displaying and customizing context menu items. */ contextMenuSettings?: ContextMenuSettings; @@ -38440,10 +38542,14 @@ declare namespace ej { */ dataSource?: any[]; - /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. - * @Default {ej.TreeGrid.HeaderTextOverflow.None} + /** Specifies the template for details view */ - headerTextOverflow?: ej.TreeGrid.HeaderTextOverflow|string; + detailsTemplate?: string; + + /** Specifies the row height of the details view + * @Default {100} + */ + detailsRowHeight?: number; /** Options for displaying and customizing the tooltip. This tooltip will show the preview of the row that is being dragged. */ @@ -38463,6 +38569,11 @@ declare namespace ej { */ enableCollapseAll?: boolean; + /** Gets or sets a value that indicates whether to enable load on demand approach, for rendering child records and page records. + * @Default {false} + */ + enableLoadOnDemand?: boolean; + /** Specifies whether to resize TreeGrid whenever window size changes. * @Default {false} */ @@ -38473,33 +38584,18 @@ declare namespace ej { */ enableVirtualization?: boolean; - /** Gets or sets a value that indicates whether to enable load on demand approach, for rendering child records and page records. - * @Default {false} + /** Specifies the mapping property path for the expand status of a record in data source. */ - enableLoadOnDemand?: boolean; - - /** Specifies the settings for column resize - */ - columnResizeSettings?: ColumnResizeSettings; - - /** Defines the common width for all the columns in TreeGrid - * @Default {150} - */ - commonWidth?: number; + expandStateMapping?: string; /** Options for filtering and customizing filter actions. */ filterSettings?: FilterSettings; - /** Specifies the localization information to customize the User Interface (UI) to support regional language and culture - * @Default {en-US} + /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. + * @Default {ej.TreeGrid.HeaderTextOverflow.None} */ - locale?: string; - - /** Enables or disables internal parsing of a row. When disabled this property, row will be displayed using the defined template without any internal event bindings. - * @Default {true} - */ - parseRowTemplate?: boolean; + headerTextOverflow?: ej.TreeGrid.HeaderTextOverflow|string; /** Specifies the name of the field in the dataSource, which contains the id of that row. */ @@ -38510,19 +38606,24 @@ declare namespace ej { */ isResponsive?: boolean; - /** Specifies the name of the field in the dataSource, which contains the parent's id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential - * data. + /** Specifies the localization information to customize the User Interface (UI) to support regional language and culture + * @Default {en-US} */ - parentIdMapping?: string; + locale?: string; /** Specifies the options for customizing the pager. */ pageSettings?: PageSettings; - /** Specifies the template for cell tooltip - * @Default {null} + /** Specifies the name of the field in the dataSource, which contains the parent's id. This is necessary to form a parent-child hierarchy, if the dataSource contains self-referential + * data. */ - cellTooltipTemplate?: string; + parentIdMapping?: string; + + /** Enables or disables internal parsing of a row. When disabled this property, row will be displayed using the defined template without any internal event bindings. + * @Default {true} + */ + parseRowTemplate?: boolean; /** Specifies ej.Query to select data from the dataSource. This property is applicable only when the dataSource is ej.DataManager. * @Default {null} @@ -38538,30 +38639,34 @@ declare namespace ej { */ rowTemplateID?: string; - /** Specifies the index of the selected row. - * @Default {-1} + /** Specifies the toolbar searching customizations. */ - selectedRowIndex?: number; + searchSettings?: SearchSettings; /** Specifies the selected cell information on rendering TreeGrid. */ selectedCellIndexes?: SelectedCellIndex[]; + /** Specifies the index of the selected row. + * @Default {-1} + */ + selectedRowIndex?: number; + /** Specifies the settings for row and cell selection. */ selectionSettings?: SelectionSettings; - /** Enables/disables the options for inserting , deleting and renaming columns. - * @Default {false} - */ - showColumnOptions?: boolean; - /** Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose Columns item from this popup, * a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. * @Default {false} */ showColumnChooser?: boolean; + /** Enables/disables the options for inserting , deleting and renaming columns. + * @Default {false} + */ + showColumnOptions?: boolean; + /** Specifies the visibility of details view * @Default {false} */ @@ -38572,29 +38677,21 @@ declare namespace ej { */ showDetailsRowInfoColumn?: boolean; - /** Specifies the template for details view + /** Specifies whether to show tooltip when mouse is hovered on the cell. + * @Default {true} */ - detailsTemplate?: string; + showGridCellTooltip?: boolean; - /** Specifies the row height of the details view - * @Default {100} + /** Specifies whether to show tooltip for the cells, which has expander button. + * @Default {true} */ - detailsRowHeight?: number; + showGridExpandCellTooltip?: boolean; /** Gets or sets a value that indicates stacked header should be shown on TreeGrid layout when the property “stackedHeaderRows” is set. * @Default {false} */ showStackedHeader?: boolean; - /** Gets or sets an object that indicates to managing the collection of stacked header rows for the treegrid. - * @Default {[]} - */ - stackedHeaderRows?: StackedHeaderRow[]; - - /** Specifies the toolbar searching customizations. - */ - searchSettings?: SearchSettings; - /** Specifies the visibility of summary row * @Default {false} */ @@ -38605,21 +38702,6 @@ declare namespace ej { */ showTotalSummary?: boolean; - /** Specifies the summary row collection object to be displayed - * @Default {[]} - */ - summaryRows?: SummaryRow[]; - - /** Specifies whether to show tooltip when mouse is hovered on the cell. - * @Default {true} - */ - showGridCellTooltip?: boolean; - - /** Specifies whether to show tooltip for the cells, which has expander button. - * @Default {true} - */ - showGridExpandCellTooltip?: boolean; - /** Options for setting width and height for TreeGrid. */ sizeSettings?: SizeSettings; @@ -38628,10 +38710,25 @@ declare namespace ej { */ sortSettings?: SortSettings; + /** Gets or sets an object that indicates to managing the collection of stacked header rows for the TreeGrid. + * @Default {[]} + */ + stackedHeaderRows?: StackedHeaderRow[]; + + /** Specifies the summary row collection object to be displayed + * @Default {[]} + */ + summaryRows?: SummaryRow[]; + /** Options for displaying and customizing the toolbar items. */ toolbarSettings?: ToolbarSettings; + /** Specifies the height of footer summary container. + * @Default {90} + */ + totalSummaryHeight?: number; + /** Specifies the index of the column that needs to have the expander button. By default, cells in the first column contain the expander button. * @Default {0} */ @@ -38653,6 +38750,14 @@ declare namespace ej { */ beginEdit?(e: BeginEditEventArgs): void; + /** Triggered after selected a cell + */ + cellSelected?(e: CellSelectedEventArgs): void; + + /** Triggered before selecting a cell + */ + cellSelecting?(e: CellSelectingEventArgs): void; + /** Triggered after collapsed the TreeGrid record */ collapsed?(e: CollapsedEventArgs): void; @@ -38661,29 +38766,29 @@ declare namespace ej { */ collapsing?(e: CollapsingEventArgs): void; - /** Triggered when you start to drag a column - */ - columnDragStart?(e: ColumnDragStartEventArgs): void; - /** Triggered while dragging a column */ columnDrag?(e: ColumnDragEventArgs): void; + /** Triggered when you start to drag a column + */ + columnDragStart?(e: ColumnDragStartEventArgs): void; + /** Triggered when a column is dropped */ columnDrop?(e: ColumnDropEventArgs): void; - /** Triggered after a column resized + /** Triggered when a column has been resized */ - columnResized?(e: ColumnResizedEventArgs): void; + columnResizeEnd?(e: ColumnResizeEndEventArgs): void; /** Triggered while start to resize a column */ columnResizeStart?(e: ColumnResizeStartEventArgs): void; - /** Triggered when a column has been resized + /** Triggered after a column resized */ - columnResizeEnd?(e: ColumnResizeEndEventArgs): void; + columnResized?(e: ColumnResizedEventArgs): void; /** Triggered while Context Menu is rendered in TreeGrid control */ @@ -38697,14 +38802,14 @@ declare namespace ej { */ detailsDataBound?(e: DetailsDataBoundEventArgs): void; - /** Triggered when details template pop-up is shown. - */ - detailsShown?(e: DetailsShownEventArgs): void; - /** Triggered when details template pop-up is hidden. */ detailsHidden?(e: DetailsHiddenEventArgs): void; + /** Triggered when details template pop-up is shown. + */ + detailsShown?(e: DetailsShownEventArgs): void; + /** Triggered after saved the modified cellValue in TreeGrid */ endEdit?(e: EndEditEventArgs): void; @@ -38725,6 +38830,14 @@ declare namespace ej { */ queryCellInfo?(e: QueryCellInfoEventArgs): void; + /** Triggered while clicking a row, even when allowSelection property is disabled. + */ + recordClick?(e: RecordClickEventArgs): void; + + /** Triggered during record double click action, even when allowSelection property is disabled. + */ + recordDoubleClick?(e: RecordDoubleClickEventArgs): void; + /** Triggered while rendering each row */ rowDataBound?(e: RowDataBoundEventArgs): void; @@ -38745,14 +38858,6 @@ declare namespace ej { */ rowDropActionBegin?(e: RowDropActionBeginEventArgs): void; - /** Triggered before selecting a cell - */ - cellSelecting?(e: CellSelectingEventArgs): void; - - /** Triggered after selected a cell - */ - cellSelected?(e: CellSelectedEventArgs): void; - /** Triggered after the row is selected. */ rowSelected?(e: RowSelectedEventArgs): void; @@ -38761,14 +38866,6 @@ declare namespace ej { */ rowSelecting?(e: RowSelectingEventArgs): void; - /** Triggered while clicking a row, even when allowSelection property is disabled. - */ - recordClick?(e: RecordClickEventArgs): void; - - /** Triggered during record double click action, even when allowSelection property is disabled. - */ - recordDoubleClick?(e: RecordDoubleClickEventArgs): void; - /** Triggered when toolbar item is clicked in TreeGrid. */ toolbarClick?(e: ToolbarClickEventArgs): void; @@ -38854,7 +38951,7 @@ declare namespace ej { */ cancel?: boolean; - /** Returns the treegrid element which is going to be print + /** Returns the TreeGrid element which is going to be print */ element?: any; @@ -38886,6 +38983,88 @@ declare namespace ej { columnIndex?: number; } + export interface CellSelectedEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the cell index on the selection. + */ + cellIndex?: number; + + /** Returns the row index on the selection + */ + rowIndex?: number; + + /** Returns the selecting cell element + */ + targetCell?: any; + + /** Returns the selecting row element + */ + targetRow?: any; + + /** Returns the selecting record object + */ + data?: any; + + /** Returns the Gantt object Model + */ + model?: any; + + /** Returns the previously selected row data + */ + previousData?: any; + + /** Returns the previously selected cell index + */ + previousCellIndex?: any; + + /** Returns the previously selected row index + */ + previousRowIndex?: any; + + /** Returns the previously selected cell element + */ + previousTargetCell?: any; + + /** Returns the previously selected row element + */ + previousTargetRow?: any; + } + + export interface CellSelectingEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the cell index on the selection. + */ + cellIndex?: number; + + /** Returns the row index on the selection + */ + rowIndex?: number; + + /** Returns the selecting cell element + */ + targetCell?: any; + + /** Returns the selecting row element + */ + targetRow?: any; + + /** Returns the selecting record object + */ + data?: any; + + /** Returns the Gantt object Model + */ + model?: any; + } + export interface CollapsedEventArgs { /** Returns the cancel option value. @@ -38936,29 +39115,6 @@ declare namespace ej { expanded?: boolean; } - export interface ColumnDragStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is dragged - */ - draggedColumn?: any; - - /** Returns the index of the column being dragged - */ - draggedColumnIndex?: number; - } - export interface ColumnDragEventArgs { /** Returns the cancel option value. @@ -38994,6 +39150,29 @@ declare namespace ej { canDrop?: boolean; } + export interface ColumnDragStartEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data which is dragged + */ + draggedColumn?: any; + + /** Returns the index of the column being dragged + */ + draggedColumnIndex?: number; + } + export interface ColumnDropEventArgs { /** Returns the cancel option value. @@ -39025,68 +39204,6 @@ declare namespace ej { targetColumnIndex?: number; } - export interface ColumnResizedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data which is resized - */ - column?: any; - - /** Returns the index of the column being resized. - */ - columnIndex?: number; - - /** Returns resized column width after resized. - */ - newWidth?: number; - - /** Returns resized column width before resizing - */ - oldWidth?: number; - } - - export interface ColumnResizeStartEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the control model values. - */ - model?: any; - - /** Returns the event Type. - */ - type?: string; - - /** Returns the column data in which the resizing started - */ - column?: any; - - /** Returns the column index in which the resizing started - */ - columnIndex?: number; - - /** Returns column width before dragging - */ - oldWidth?: number; - - /** Returns initial column element object. - */ - target?: any; - } - export interface ColumnResizeEndEventArgs { /** Returns the cancel option value. @@ -39126,6 +39243,68 @@ declare namespace ej { target?: any; } + export interface ColumnResizeStartEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data in which the resizing started + */ + column?: any; + + /** Returns the column index in which the resizing started + */ + columnIndex?: number; + + /** Returns column width before dragging + */ + oldWidth?: number; + + /** Returns initial column element object. + */ + target?: any; + } + + export interface ColumnResizedEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the control model values. + */ + model?: any; + + /** Returns the event Type. + */ + type?: string; + + /** Returns the column data which is resized + */ + column?: any; + + /** Returns the index of the column being resized. + */ + columnIndex?: number; + + /** Returns resized column width after resized. + */ + newWidth?: number; + + /** Returns resized column width before resizing + */ + oldWidth?: number; + } + export interface ContextMenuOpenEventArgs { /** Returns the cancel option value. @@ -39191,6 +39370,25 @@ declare namespace ej { type?: string; } + export interface DetailsHiddenEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the TreeGrid model + */ + model?: any; + + /** Returns the data collection of hidden details Template + */ + rowData?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface DetailsShownEventArgs { /** Returns the cancel option value. @@ -39218,25 +39416,6 @@ declare namespace ej { type?: string; } - export interface DetailsHiddenEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the TreeGrid model - */ - model?: any; - - /** Returns the data collection of hidden details Template - */ - rowData?: any; - - /** Returns the name of the event. - */ - type?: string; - } - export interface EndEditEventArgs { /** Returns the cancel option value. @@ -39352,6 +39531,68 @@ declare namespace ej { column?: any; } + export interface RecordClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + + export interface RecordDoubleClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; + } + export interface RowDataBoundEventArgs { /** Returns the cancel option value. @@ -39511,88 +39752,6 @@ declare namespace ej { type?: string; } - export interface CellSelectingEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; - } - - export interface CellSelectedEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the cell index on the selection. - */ - cellIndex?: number; - - /** Returns the row index on the selection - */ - rowIndex?: number; - - /** Returns the selecting cell element - */ - targetCell?: any; - - /** Returns the selecting row element - */ - targetRow?: any; - - /** Returns the selecting record object - */ - data?: any; - - /** Returns the Gantt object Model - */ - model?: any; - - /** Returns the previously selected row data - */ - previousData?: any; - - /** Returns the previously selected cell index - */ - previousCellIndex?: any; - - /** Returns the previously selected row index - */ - previousRowIndex?: any; - - /** Returns the previously selected cell element - */ - previousTargetCell?: any; - - /** Returns the previously selected row element - */ - previousTargetRow?: any; - } - export interface RowSelectedEventArgs { /** Returns the cancel option value. @@ -39647,68 +39806,6 @@ declare namespace ej { previousTreeGridRow?: any; } - export interface RecordClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the element of clicked cell. - */ - cell?: any; - - /** Returns the index of the clicked cell. - */ - cellIndex?: number; - - /** Returns the data of clicked cell. - */ - cellValue?: any; - - /** Returns the element of the clicked row. - */ - row?: any; - - /** Returns the index of the clicked row. - */ - rowIndex?: number; - - /** Returns the column name of the clicked cell. - */ - columnName?: string; - } - - export interface RecordDoubleClickEventArgs { - - /** Returns the cancel option value. - */ - cancel?: boolean; - - /** Returns the element of clicked cell. - */ - cell?: any; - - /** Returns the index of the clicked cell. - */ - cellIndex?: number; - - /** Returns the data of clicked cell. - */ - cellValue?: any; - - /** Returns the element of the clicked row. - */ - row?: any; - - /** Returns the index of the clicked row. - */ - rowIndex?: number; - - /** Returns the column name of the clicked cell. - */ - columnName?: string; - } - export interface ToolbarClickEventArgs { /** Returns the cancel option value. @@ -39732,6 +39829,14 @@ declare namespace ej { type?: string; } + export interface ColumnResizeSettings { + + /** Specifies the mode for column resizing + * @Default {ej.TreeGrid.ColumnResizeMode.Normal} + */ + columnResizeMode?: ej.TreeGrid.ColumnResizeMode|string; + } + export interface ColumnsCommand { /** Gets or sets an object to customize command button with available ejButton properties. @@ -39745,6 +39850,16 @@ declare namespace ej { export interface Column { + /** Enables/disables cell selection. + * @Default {false} + */ + allowCellSelection?: boolean; + + /** Enables or disables the ability to edit a row or cell. + * @Default {false} + */ + allowEditing?: boolean; + /** Enables or disables the ability to filter the rows based on this column. * @Default {false} */ @@ -39755,15 +39870,38 @@ declare namespace ej { */ allowFilteringBlankContent?: boolean; + /** Enables or disables the ability to freeze/unfreeze the columns + * @Default {false} + */ + allowFreezing?: boolean; + /** Enables or disables the ability to sort the rows based on this column/field. * @Default {false} */ allowSorting?: boolean; - /** Enables/disables cell selection. + /** Specifies the template ID or the template string of the AngularJS script element to enable column template for a column. + */ + angularTemplate?: string; + + /** Sets the clip mode for TreeGrid cell as ellipsis or clipped content(both header and content) + * @Default {ej.TreeGrid.ClipMode.Clip} + */ + clipMode?: ej.TreeGrid.ClipMode|string; + + /** Gets or sets an object to define a command column in TreeGrid. + * @Default {[]} + */ + commands?: ColumnsCommand[]; + + /** Gets or sets a value that indicates to display a column value as checkbox or string * @Default {false} */ - allowCellSelection?: boolean; + displayAsCheckbox?: boolean; + + /** To bind the dropdown data for TreeGrid column mapped with ejDropDownList + */ + dropdownData?: string; /** To customize the ej controls defined in TreeGrid column with their native property. */ @@ -39779,26 +39917,10 @@ declare namespace ej { */ editType?: ej.TreeGrid.EditingType|string; - /** To bind the dropdown data for TreeGrid column mapped with ejDropDownList - */ - dropdownData?: string; - /** Specifies the name of the field from the dataSource to bind with this column. */ field?: string; - /** Specifies the template string of the script element to enable column template for a column. - */ - template?: string; - - /** Specifies the template ID of the script element to enable column template for a column. - */ - templateID?: string; - - /** Specifies the template ID or the template string of the AngularJS script element to enable column template for a column. - */ - angularTemplate?: string; - /** Specifies the type of the editor control to be used to filter the rows. * @Default {ej.TreeGrid.EditingType.String} */ @@ -39809,102 +39931,85 @@ declare namespace ej { */ filterType?: ej.TreeGrid.FilterType|string; - /** Header text of the column. - * @Default {null} - */ - headerText?: string; - - /** Gets or sets a value that indicates to display a column value as checkbox or string - * @Default {false} - */ - displayAsCheckbox?: boolean; - - /** Enables or disables the checkbox visibility in a column for checkbox selection. - * @Default {false} - */ - showCheckbox?: boolean; - - /** Controls the visibility of the column. - * @Default {true} - */ - visible?: boolean; - - /** Gets or sets a value for treegrid column width - */ - width?: number; - - /** Specifies the header template value for the column header - */ - headerTemplateID?: string; - /** Specifies the display format of a column * @Default {null} */ format?: any; - /** Specifies whether the column is a template column - * @Default {false} + /** Specifies the header template value for the column header */ - isTemplateColumn?: boolean; + headerTemplateID?: string; + + /** Header text of the column. + * @Default {null} + */ + headerText?: string; /** Specifies the alignment of the column header text * @Default {ej.TextAlign.Left} */ headerTextAlign?: ej.TextAlign|string; - /** Specifies whether the column is frozen - * @Default {false} - */ - isFrozen?: boolean; - - /** Specifies the text alignment for the column - * @Default {ej.TextAlign.Left} - */ - textAlign?: ej.TextAlign|string; - - /** Enables or disables the ability to edit a row or cell. - * @Default {false} - */ - allowEditing?: boolean; - - /** Gets or sets an object to define a command column in TreeGrid. - * @Default {[]} - */ - commands?: ColumnsCommand[]; - - /** We can include or exclude particular column from column visibility list in column menu. - * @Default {true} - */ - showInColumnChooser?: boolean; - - /** Sets the clip mode for TreeGrid cell as ellipsis or clipped content(both header and content) - * @Default {ej.TreeGrid.ClipMode.Clip} - */ - clipMode?: ej.TreeGrid.ClipMode|string; - - /** Sets the tooltip template for the specific column. - * @Default {null} - */ - tooltip?: string; - /** Sets the tooltip template for the column header * @Default {null} */ headerTooltip?: string; - /** specifies the conditions for saving data to the database while adding or editing the fields. + /** Specifies whether the column is frozen + * @Default {false} */ - validationRules?: any; + isFrozen?: boolean; + + /** Specifies whether the column is a template column + * @Default {false} + */ + isTemplateColumn?: boolean; /** Gets or sets the priority value of the column. It is used to show/hide TreeGrid columns in responsive mode. * @Default {-1} */ priority?: number; - /** Enables or disables the ability to freeze/unfreeze the columns + /** Enables or disables the checkbox visibility in a column for checkbox selection. * @Default {false} */ - allowFreezing?: boolean; + showCheckbox?: boolean; + + /** We can include or exclude particular column from column visibility list in column menu. + * @Default {true} + */ + showInColumnChooser?: boolean; + + /** Specifies the template string of the script element to enable column template for a column. + */ + template?: string; + + /** Specifies the template ID of the script element to enable column template for a column. + */ + templateID?: string; + + /** Specifies the text alignment for the column + * @Default {ej.TextAlign.Left} + */ + textAlign?: ej.TextAlign|string; + + /** Sets the tooltip template for the specific column. + * @Default {null} + */ + tooltip?: string; + + /** specifies the conditions for saving data to the database while adding or editing the fields. + */ + validationRules?: any; + + /** Controls the visibility of the column. + * @Default {true} + */ + visible?: boolean; + + /** Gets or sets a value for TreeGrid column width + */ + width?: number; } export interface ContextMenuSettings { @@ -39912,7 +40017,7 @@ declare namespace ej { /** Option for adding items to context menu. * @Default {[]} */ - contextMenuItems?: any[]; + contextMenuItems?: Array; /** Shows/hides the context menu. * @Default {false} @@ -39960,6 +40065,11 @@ declare namespace ej { */ beginEditAction?: ej.TreeGrid.BeginEditAction|string; + /** Specifies the template ID for the custom dialog. + * @Default {null} + */ + dialogEditorTemplateID?: string; + /** specifies the edit mode in TreeGrid , "cellEditing" is for cell type editing and "rowEditing" is for entire row. * @Default {ej.TreeGrid.EditMode.CellEditing} */ @@ -39970,51 +40080,53 @@ declare namespace ej { */ rowPosition?: ej.TreeGrid.RowPosition|string; - /** Specifies the template ID for the custom dialog. - * @Default {null} - */ - dialogEditorTemplateID?: string; - /** Enable or disable the confirmation dialog while deleting the record. * @Default {false} */ showDeleteConfirmDialog?: boolean; } - export interface ColumnResizeSettings { - - /** Specifies the mode for column resizing - * @Default {ej.TreeGrid.ColumnResizeMode.Normal} - */ - columnResizeMode?: ej.TreeGrid.ColumnResizeMode|string; - } - export interface FilterSettingsFilteredColumn { - /** Specifies the value to be filtered in TreeGrid. - */ - value?: string; - /** Specifies the field where filtering has to be performed. */ field?: string; + /** Specifies the filter condition to filtered column. See operator + */ + operator?: string; + /** Specifies the predicate(and/or) value to perform filtering. */ predicate?: string; - /** Specifies the filter condition to filtered column. See operator + /** Specifies the value to be filtered in TreeGrid. */ - operator?: string; + value?: string; } export interface FilterSettings { + /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode. + * @Default {false} + */ + enableCaseSensitivity?: boolean; + + /** Enables or disables the ability to filter the columns with empty, null and undefined values. + * @Default {true} + */ + enableComplexBlankFilter?: boolean; + /** Specifies the mode on which column filtering should start * @Default {immediate} */ filterBarMode?: string; + /** Specifies the mode of filtering to filter the record with or without hierarchy. + * @Default {ej.TreeGrid.FilterHierarchyMode.Parent} + */ + filterHierarchyMode?: ej.TreeGrid.FilterHierarchyMode|string; + /** Specifies the type of column filtering. * @Default {ej.TreeGrid.FilterType.FilterBar} */ @@ -40029,25 +40141,15 @@ declare namespace ej { * @Default {1000} */ maxFilterChoice?: number; - - /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode. - * @Default {false} - */ - enableCaseSensitivity?: boolean; - - /** Enables or disables the ability to filter the columns with empty, null and undefined values. - * @Default {true} - */ - enableComplexBlankFilter?: boolean; - - /** Specifies the mode of filtering to filter the record with or without hierarchy. - * @Default {ej.TreeGrid.FilterHierarchyMode.Parent} - */ - filterHierarchyMode?: ej.TreeGrid.FilterHierarchyMode|string; } export interface PageSettings { + /** Specifies the current page to display at load time. + * @Default {1} + */ + currentPage?: number; + /** Using this property we can specify the number of pages should pager contains, according to this count TreeGrid height will be updated. * @Default {8} */ @@ -40058,16 +40160,6 @@ declare namespace ej { */ pageSize?: number; - /** Get the value of records which is bound to TreeGrid. The totalRecordsCount value is calculated based on the datasource bound to TreeGrid. - * @Default {null} - */ - totalRecordsCount?: number; - - /** Specifies the current page to display at load time. - * @Default {1} - */ - currentPage?: number; - /** Specifies the mode of record count in a page, whether it should count all the records or the root to count zero level parent records. * @Default {ej.TreeGrid.PageSizeMode.All} */ @@ -40082,32 +40174,48 @@ declare namespace ej { * @Default {null} */ template?: string; + + /** Get the value of records which is bound to TreeGrid. The totalRecordsCount value is calculated based on the datasource bound to TreeGrid. + * @Default {null} + */ + totalRecordsCount?: number; + } + + export interface SearchSettings { + + /** Default Value + * @Default {[]} + */ + fields?: any[]; + + /** Default Value + * @Default {true} + */ + ignoreCase?: boolean; + + /** Default Value + */ + key?: string; + + /** Specifies the operator for the search key words in toolbar searching. + * @Default {contains} + */ + operator?: string; } export interface SelectedCellIndex { + /** Specifies the cell index to be selected in the row. + */ + cellIndex?: number; + /** Specifies the row index of the cell to be selected in TreeGrid control */ rowIndex?: number; - - /** Specifies the cell index to be selected in the row. - * @Default { } - */ - cellIndex?: number; } export interface SelectionSettings { - /** Specifies the type of selection whether to select row or cell. - * @Default {ej.TreeGrid.SelectionMode.Row} - */ - selectionMode?: ej.TreeGrid.SelectionMode|string; - - /** Specifies the type of selection whether single, multiple or checkbox. - * @Default {ej.TreeGrid.SelectionType.Single} - */ - selectionType?: ej.TreeGrid.SelectionType|string; - /** Enables or disables the selection by hierarchy in check box selection * @Default {true} */ @@ -40117,6 +40225,48 @@ declare namespace ej { * @Default {true} */ enableSelectAll?: boolean; + + /** Specifies the type of selection whether to select row or cell. + * @Default {ej.TreeGrid.SelectionMode.Row} + */ + selectionMode?: ej.TreeGrid.SelectionMode|string; + + /** Specifies the type of selection whether single, multiple or checkbox. + * @Default {ej.TreeGrid.SelectionType.Single} + */ + selectionType?: ej.TreeGrid.SelectionType|string; + } + + export interface SizeSettings { + + /** Height of the TreeGrid. + * @Default {450px} + */ + height?: string; + + /** Width of the TreeGrid. + * @Default {100%} + */ + width?: string; + } + + export interface SortSettingsSortedColumn { + + /** Specifies the sort direction in TreeGrid + */ + direction?: string; + + /** Specifies the field to be sorted in TreeGrid + */ + field?: string; + } + + export interface SortSettings { + + /** Option to add columns based on which the rows have to be sorted recursively. + * @Default {[]} + */ + sortedColumns?: SortSettingsSortedColumn[]; } export interface StackedHeaderRowsStackedHeaderColumn { @@ -40155,34 +40305,8 @@ declare namespace ej { stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; } - export interface SearchSettings { - - /** Default Value - * @Default {[]} - */ - fields?: any[]; - - /** Default Value - */ - key?: string; - - /** Specifies the operator for the search key words in toolbar searching. - * @Default {contains} - */ - operator?: string; - - /** Default Value - * @Default {true} - */ - ignoreCase?: boolean; - } - export interface SummaryRowsSummaryColumn { - /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. - */ - summaryType?: ej.TreeGrid.SummaryType|string; - /** Specifies summary column used to perform the summary calculation. */ dataMember?: string; @@ -40191,6 +40315,10 @@ declare namespace ej { */ displayColumn?: string; + /** Specifies the format to be applied on the summary column value. + */ + format?: string; + /** Specifies the text to be displayed before the summary column value. */ prefix?: string; @@ -40199,52 +40327,20 @@ declare namespace ej { */ suffix?: string; - /** Specifies the format to be applied on the summary column value. + /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. */ - format?: string; + summaryType?: ej.TreeGrid.SummaryType|string; } export interface SummaryRow { - /** Specifies the title for summary row collection in TreeGrid - */ - title?: string; - /** Specifies the summary columns in the summary rows. */ summaryColumns?: SummaryRowsSummaryColumn[]; - } - export interface SizeSettings { - - /** Height of the TreeGrid. - * @Default {null} + /** Specifies the title for summary row collection in TreeGrid */ - height?: string; - - /** Width of the TreeGrid. - * @Default {null} - */ - width?: string; - } - - export interface SortSettingsSortedColumn { - - /** Specifies the field to be sorted in TreeGrid - */ - field?: string; - - /** Specifies the sort direction in TreeGrid - */ - direction?: string; - } - - export interface SortSettings { - - /** Option to add columns based on which the rows have to be sorted recursively. - * @Default {[]} - */ - sortedColumns?: SortSettingsSortedColumn[]; + title?: string; } export interface ToolbarSettingsCustomToolbarItem { @@ -40264,6 +40360,10 @@ declare namespace ej { export interface ToolbarSettings { + /** Allows the user to insert custom toolbar items. + */ + customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; + /** Shows/hides the toolbar. * @Default {false} */ @@ -40272,13 +40372,48 @@ declare namespace ej { /** Specifies the list of toolbar items to be rendered in TreeGrid toolbar * @Default {[]} */ - toolbarItems?: any[]; - - /** Allows the user to insert custom toolbar items. - */ - customToolbarItems?: ToolbarSettingsCustomToolbarItem[]; + toolbarItems?: Array; } + enum ColumnResizeMode { + + ///At load time column are rendered with given width value, while resizing the column only current column width is changed + FixedColumns, + + ///At load time columns are stretched with control width,while resizing the column, current column width updated based on next column + Normal, + + ///In this mode columns are stretched with control width in load time and on resizing action. + NextColumn + } + + + enum ClipMode { + + ///Shows ellipsis for the overflown cell. + Ellipsis, + + ///Truncate the text in the cell. + Clip + } + + + enum UnboundType { + + ///Unbound type to perform edit action + Edit, + + ///Unbound type to perform save action + Save, + + ///Unbound type to perform delete action + Delete, + + ///Unbound type to perform cancel action + Cancel + } + + enum EditingType { ///It Specifies String edit type. @@ -40314,39 +40449,16 @@ declare namespace ej { } - enum UnboundType { + enum ContextMenuItems { - ///Unbound type to perform edit action + ///Enables the add menu item in context menu + Add, + + ///Enables the edit menu item in context menu Edit, - ///Unbound type to perform save action - Save, - - ///Unbound type to perform delete action - Delete, - - ///Unbound type to perform cancel action - Cancel - } - - - enum ClipMode { - - ///Shows ellipsis for the overflown cell. - Ellipsis, - - ///Truncate the text in the cell. - Clip - } - - - enum HeaderTextOverflow { - - ///You can disable the word wrap - None, - - ///You can wrap the header content - Wrap + ///Enables the edit menu item in context menu + Delete } @@ -40392,19 +40504,6 @@ declare namespace ej { } - enum ColumnResizeMode { - - ///At load time column are rendered with given width value, while resizing the column only current column width is changed - FixedColumns, - - ///At load time columns are stretched with control width,while resizing the column, current column width updated based on next column - Normal, - - ///In this mode columns are stretched with control width in load time and on resizing action. - NextColumn - } - - enum FilterHierarchyMode { ///Shows the filtered record with parent record @@ -40421,6 +40520,16 @@ declare namespace ej { } + enum HeaderTextOverflow { + + ///You can disable the word wrap + None, + + ///You can wrap the header content + Wrap + } + + enum PageSizeMode { ///To count all the parent and child records. @@ -40494,6 +40603,40 @@ declare namespace ej { FalseCount } + + enum ToolbarItems { + + ///Enables the add icon in toolbar + Add, + + ///Enables the edit icon in toolbar + Edit, + + ///Enables the edit icon in toolbar + Delete, + + ///Enables the update icon in toolbar + Update, + + ///Enables the cancel icon in toolbar + Cancel, + + ///Enables the expand all icon in toolbar + ExpandAll, + + ///Enables the collapse all icon in toolbar + CollapseAll, + + ///Enables the PDF export icon in toolbar + PdfExport, + + ///Enables the excel export icon in toolbar + ExcelExport, + + ///Enables the printing icon in toolbar + Print + } + } class GroupButton extends ej.Widget { @@ -42652,9 +42795,10 @@ declare namespace ej { /** This method is used to set the width for the columns in the Spreadsheet. * @param {any[]|any} Pass the column index and width of the columns. + * @param {number} Optional. If sheetIdx is specified, it will set the width for columns to the specified sheet else it will use active sheet. * @returns {void} */ - setWidthToColumns(widthColl: any[]|any): void; + setWidthToColumns(widthColl: any[]|any, sheetIndex?: number): void; /** This method is used to rename the active sheet. * @param {string} Pass the sheet name that you want to change the current active sheet name. @@ -46184,6 +46328,33 @@ declare namespace ej { */ zoomTo(zoomValue: number): void; + /** Searches the target text in the PDF document and highlights the occurrences in the pages. + * @param {string} The text to be searched in the pages in the PDF viewer. + * @returns {void} + */ + searchText(targetText: string): void; + + /** Searches the next occurrence of the searched text from the current occurrence in the PDF viewer control. + * @returns {void} + */ + searchNext(): void; + + /** Searches the previous occurrence of the searched text from the current occurrence in the PDF viewer control. + * @returns {void} + */ + searchPrevious(): void; + + /** Searches the target text with its casing. + * @param {boolean} Specifies whether the text search must be performed with match case or not. + * @returns {void} + */ + matchCase(enableMatchCase: boolean): void; + + /** Cancels the text search and removes the highlighted occurrences from the PDF viewer. + * @returns {void} + */ + cancelSearchText(): void; + /** Adds annotations to the PDF document. * @param {ej.PdfViewer.AnnotationType} type of the annotation to be added in the PDF document. * @returns {void} @@ -48201,6 +48372,410 @@ declare namespace ej { } + class ReportDesigner extends ej.Widget { + static fn: ReportDesigner; + constructor(element: JQuery | Element, options?: ReportDesigner.Model); + static Locale: any; + model: ReportDesigner.Model; + defaults: ReportDesigner.Model; + + /** Determines whether a copy operation is possible. + * @returns {boolean} + */ + canCopy(): boolean; + + /** Determines whether a cut operation is possible. + * @returns {boolean} + */ + canCut(): boolean; + + /** Determines whether a delete operation is possible. + * @returns {boolean} + */ + canRemove(): boolean; + + /** Determines whether a paste operation is possible. + * @returns {boolean} + */ + canPaste(): boolean; + + /** Returns the bool value indicating whether the user can redo the previous action in the report. + * @returns {boolean} + */ + canRedo(): boolean; + + /** Returns a bool value indicating whether the user can undo the previous action in the report. + * @returns {boolean} + */ + canUndo(): boolean; + + /** Copies the selected ReportItem from design panel to Report Designer internal clipboard. + * @returns {void} + */ + copy(): void; + + /** Cuts the selected ReportItem from design panel to Report Designer internal clipboard. + * @returns {void} + */ + cut(): void; + + /** Deletes the selected item from the report. + * @returns {void} + */ + remove(): void; + + /** Returns the bool value that specifies whether the report has changes or not. + * @returns {boolean} + */ + hasReportChanges(): boolean; + + /** Returns the bool value that specifies whether the currently processing report is a new report or not. + * @returns {boolean} + */ + isNewReport(): boolean; + + /** Returns the bool value that specifies whether the currently processing report is a new server report or not. + * @returns {boolean} + */ + isNewServerReport(): boolean; + + /** Returns the bool value that specifies whether the currently processing report is obtained from the server or local. + * @returns {boolean} + */ + isServerReport(): boolean; + + /** To create a new report. + * @returns {void} + */ + newReport(): void; + + /** To create a new report in the server. + * @returns {void} + */ + newServerReport(): void; + + /** This method opens the report from the ReportServer. + * @returns {void} + */ + openReport(): void; + + /** To open the report client browse dialog. + * @returns {void} + */ + openReportFromDevice(): void; + + /** To open the report open server browse dialog. + * @returns {void} + */ + openServerReportDialog(): void; + + /** Pastes the selected ReportItem from Report Designer internal clipboard to design panel. + * @returns {void} + */ + paste(): void; + + /** Reverses the action of the last Undo command. + * @returns {void} + */ + redo(): void; + + /** This method saves the report into the ReportServer. + * @returns {void} + */ + saveReport(): void; + + /** To open the report save server browse dialog. + * @returns {void} + */ + saveServerReportDialog(): void; + + /** To download the designed report. + * @returns {void} + */ + saveToDevice(): void; + + /** To show the report design. + * @returns {void} + */ + showDesign(): void; + + /** To open the new report dialog. + * @returns {void} + */ + showNewReportDialog(): void; + + /** To open the server browse dialog. + * @returns {void} + */ + showOpenSaveReportDialog(): void; + + /** To show the report preview. + * @returns {void} + */ + showPreview(): void; + + /** Reverses the last action that was performed. + * @returns {void} + */ + undo(): void; + } + export namespace ReportDesigner { + + export interface Model { + + /** Specifies the locale for report designer. + * @Default {en-US} + */ + locale?: string; + + /** Gets or Sets the report path of server. + * @Default {null} + */ + reportPath?: string; + + /** Gets or Sets the reports server URL. + * @Default {null} + */ + reportServerUrl?: string; + + /** Gets or sets the serviceAuthorizationToken to access the Report Server API services. + * @Default {empty} + */ + serviceAuthorizationToken?: string; + + /** Gets or Sets the URL of the WebAPI service; it will be used for processing the report. + * @Default {null} + */ + serviceUrl?: string; + + /** Specifies the toolbar settings. + */ + toolbarSettings?: ToolbarSettings; + + /** This event will be triggered before AJAX loads. + */ + ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; + + /** This event will be triggered when AJAX result is failed. + */ + ajaxError?(e: AjaxErrorEventArgs): void; + + /** This event will be triggered when AJAX result is succeeded. + */ + ajaxSuccess?(e: AjaxSuccessEventArgs): void; + + /** This event will be triggered when the Report Designer widget is created. + */ + create?(e: CreateEventArgs): void; + + /** This event will be triggered when the Report Designer widget is destroyed. + */ + destroy?(e: DestroyEventArgs): void; + + /** This event will be triggered while clicking open menu items. + */ + openReportClick?(e: OpenReportClickEventArgs): void; + + /** This event will be triggered when the report is modified. + */ + reportModified?(e: ReportModifiedEventArgs): void; + + /** This event will be triggered when the report is opened. + */ + reportOpened?(e: ReportOpenedEventArgs): void; + + /** This event will be triggered when the report is saved. + */ + reportSaved?(e: ReportSavedEventArgs): void; + + /** This event will be triggered when the save menu items are clicked. + */ + saveReportClick?(e: SaveReportClickEventArgs): void; + + /** This event will be triggered while clicking the toolbar items. + */ + toolbarClick?(e: ToolbarClickEventArgs): void; + + /** This event will be triggered on rendering the Report Designer toolbar. + */ + toolbarRendering?(e: ToolbarRenderingEventArgs): void; + } + + export interface AjaxBeforeLoadEventArgs { + + /** AJAX headers, we can pass any custom header through this property. + */ + headers?: any[]; + + /** To pass the custom data while AJAX post back. + */ + data?: any; + + /** Token of report designer. + */ + reportDesignerToken?: string; + + /** Token of ReportingService. + */ + serviceAuthorizationToken?: string; + + /** Action type of AJAX call back. + */ + actionType?: string; + } + + export interface AjaxErrorEventArgs { + } + + export interface AjaxSuccessEventArgs { + } + + export interface CreateEventArgs { + } + + export interface DestroyEventArgs { + } + + export interface OpenReportClickEventArgs { + + /** DOM of the clicked target. + */ + target?: JQuery; + + /** Name of selected item. + */ + select?: string; + } + + export interface ReportModifiedEventArgs { + + /** Specifies whether the report is modified or not. + */ + isModified?: boolean; + + /** Name of Opened Report. + */ + reportName?: string; + } + + export interface ReportOpenedEventArgs { + + /** Specifies whether report opened from device or server. + */ + isServerReport?: boolean; + + /** Name of Opened Report. + */ + reportName?: string; + } + + export interface ReportSavedEventArgs { + + /** Specifies whether report opened from device or server. + */ + isServerReport?: boolean; + + /** States whether report is downloaded from ReportServer. + */ + reportAction?: string; + } + + export interface SaveReportClickEventArgs { + + /** DOM of the clicked target. + */ + target?: JQuery; + + /** Name of selected item. + */ + select?: string; + } + + export interface ToolbarClickEventArgs { + + /** DOM of the clicked target. + */ + target?: JQuery; + + /** Name of clicked item. + */ + click?: string; + } + + export interface ToolbarRenderingEventArgs { + } + + export interface ToolbarSettings { + + /** Shows or hides the grouped items in the toolbar with the help of enum ej.ReportDesigner.ToolbarItems. + * @Default {ej.ReportDesigner.ToolbarItems.All} + */ + items?: ej.ReportDesigner.ToolbarItems|string; + + /** Shows or hides the toolbar. + * @Default {true} + */ + showToolbar?: boolean; + + /** Specifies the toolbar template ID. + * @Default {empty} + */ + templateId?: string; + } + + enum ToolbarItems { + + ///Creates a new, blank report. + New, + + ///Displays the Open dialog box to retrieve an existing report. + Open, + + ///Saves the active report to a specified location. + Save, + + ///Removes the selected item from the active report. + Cut, + + ///Copies selected text or object to the clipboard. + Copy, + + ///Pastes the item that cut or copied into (the position of the insertion point) the report from the clipboard. + Paste, + + ///Deletes the selected item or text from the report. + Delete, + + ///Reverses the last action or deletes the last entry that is typed. + Undo, + + ///Reverses the action of the last Undo command. + Redo, + + ///Used to "zoom in" to get a close-up view of a report or "zoom out" to see more of the page at a reduced size. + Zoom, + + ///Previews the active report in report viewer. + Preview, + + ///Enables/Disables the gridline in active report. + GridLine, + + ///Enables header area in the report. + Header, + + ///Enables footer area in the report. + Footer, + + ///Switches from preview to design view of the report. + EditDesign, + + ///Shows all the toolbar items. + All + } + + } + } declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { @@ -64292,6 +64867,16 @@ declare namespace ej.datavisualization { * @returns {void} */ zoom(level: number, isAnimate: boolean): void; + + /** Method to reload the shape marker with updated values. + * @returns {void} + */ + refreshLayer(): void; + + /** Add markers dynamically based on layer and sublayer index value. + * @returns {void} + */ + addMarkers(): void; } export namespace Map { @@ -64413,6 +64998,10 @@ declare namespace ej.datavisualization { */ Click?(e: ClickEventArgs): void; + /** Fires on clicking the legend item. + */ + legendItemClick?(e: LegendItemClickEventArgs): void; + /** Fires, on double clicking the map. */ doubleClick?(e: DoubleClickEventArgs): void; @@ -64424,6 +65013,18 @@ declare namespace ej.datavisualization { /** Fires before loading the map. */ onLoad?(e: OnLoadEventArgs): void; + + /** Triggers while entering the hovered marker shape. + */ + markerEnter?(e: MarkerEnterEventArgs): void; + + /** Triggers while leaving the hovered marker shape. + */ + markerLeave?(e: MarkerLeaveEventArgs): void; + + /** Triggers after refreshing the map items. + */ + refreshed?(e: RefreshedEventArgs): void; } export interface MarkerSelectedEventArgs { @@ -64518,6 +65119,27 @@ declare namespace ej.datavisualization { originalEvent?: any; } + export interface LegendItemClickEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the map model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** startX - X-coordinate of legend item in pixel LegendItem - Instance of the legend item object that is about to be rendered style - Options to customize the legend item + * styles such as border, color, size, etc…, symbolShape - Name of the legend item shape. Use this option to customize legend item shape before rendering map - Instance + * of the map object corresponding to the legend item + */ + data?: any; + } + export interface DoubleClickEventArgs { /** Returns double clicked shape object. @@ -64547,8 +65169,50 @@ declare namespace ej.datavisualization { type?: string; } + export interface MarkerEnterEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the map model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + } + + export interface MarkerLeaveEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the map model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + } + + export interface RefreshedEventArgs { + + /** Refresh and load the map. + */ + originalEvent?: any; + } + export interface ZoomSettings { + /** Specifies animation duration for map shapes while zooming. + * @Default {600} + */ + animationDuration?: string; + /** Enables or Disables the zooming of map * @Default {true} */ @@ -64806,6 +65470,11 @@ declare namespace ej.datavisualization { */ showLegend?: boolean; + /** Toggle the visibility of the legend. + * @Default {false} + */ + toggleVisibility?: boolean; + /** to get title of legend setting * @Default {null} */ @@ -65639,6 +66308,11 @@ declare namespace ej.datavisualization { * @returns {void} */ refresh(): void; + + /** Method to drilldown the treemap. + * @returns {void} + */ + drillDown(): void; } export namespace TreeMap { @@ -65711,6 +66385,16 @@ declare namespace ej.datavisualization { */ enableDrillDown?: boolean; + /** Specifies to drill the particular data of the treemap. + * @Default {null} + */ + drillDownValue?: string; + + /** Specifies to render particular level of the treemap. + * @Default {0} + */ + drillDownLevel?: number; + /** Controls whether Treemap has to be responsive while resizing the window. * @Default {true} */ @@ -68109,6 +68793,11 @@ declare namespace ej.datavisualization { */ margin?: ConnectorsLabelsMargin; + /** Sets the padding for connector label. + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + padding?: any; + /** Sets the value which is used to drag the label within certain bounds. * @Default {null} */ @@ -69323,6 +70012,11 @@ declare namespace ej.datavisualization { */ overflowType?: ej.datavisualization.Diagram.OverflowType|string; + /** To set the padding of the node label + * @Default {ej.datavisualization.Diagram.Padding()} + */ + padding?: any; + /** Defines whether the label is editable or not * @Default {false} */ @@ -70713,6 +71407,10 @@ declare namespace ej.datavisualization { BridgeObstacle, //Enables connector to be selected and dragged. Interaction, + //Enables the Routing for an connector + Routing, + //Inherit the routing option defined in the diagram constraints. + InheritRouting, //Enables all constraints Default, } @@ -70919,6 +71617,8 @@ declare namespace ej.datavisualization { ZoomTextEditor, //Enables/Disables the drag and drop of element from one diagram to the other FloatElements, + //Enables the routing for an connector in diagram + Routing, //Enables all Constraints Default, } @@ -74355,6 +75055,9 @@ interface JQuery { ejRecurrenceEditor(options?: ej.RecurrenceEditor.Model): JQuery; ejRecurrenceEditor(memberName: any, value?: any, param?: any): any; + ejReportDesigner(options?: ej.ReportDesigner.Model): JQuery; + ejReportDesigner(memberName: any, value?: any, param?: any): any; + ejReportViewer(options?: ej.ReportViewer.Model): JQuery; ejReportViewer(memberName: any, value?: any, param?: any): any; @@ -74501,6 +75204,7 @@ interface JQuery { data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; data(key: "ejRating"): ej.Rating; data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; + data(key: "ejReportDesigner"): ej.ReportDesigner; data(key: "ejReportViewer"): ej.ReportViewer; data(key: "ejResizable"): ej.Resizable; data(key: "ejRibbon"): ej.Ribbon; diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 35b4e39798..85574e3c91 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -44,6 +44,13 @@ client.indices.delete({ }, (error) => { }); +client.indices.delete({ + index: 'test_index', + ignoreUnavailable: true +}).then((body) => { +}, (error) => { +}); + client.deleteByQuery({ index: 'test_index', type: 'test_type', diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index 2cfd14f689..c791db72c3 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -1143,6 +1143,7 @@ export interface IndicesDeleteParams extends GenericParams { timeout?: TimeSpan; masterTimeout?: TimeSpan; index: NameList; + ignoreUnavailable?: boolean; } export interface IndicesDeleteAliasParams extends GenericParams { diff --git a/types/electron-devtools-installer/electron-devtools-installer-tests.ts b/types/electron-devtools-installer/electron-devtools-installer-tests.ts index 798e6ad223..ddc7711afe 100644 --- a/types/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/types/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -7,7 +7,6 @@ import installExtension, { MOBX_DEVTOOLS } from 'electron-devtools-installer'; - installExtension(EMBER_INSPECTOR); installExtension(REACT_DEVELOPER_TOOLS); installExtension(BACKBONE_DEBUGGER); @@ -19,4 +18,7 @@ installExtension(REACT_PERF); installExtension(CYCLEJS_DEVTOOL); installExtension(APOLLO_DEVELOPER_TOOLS); installExtension(MOBX_DEVTOOLS); -installExtension('abcdefghijkl'); \ No newline at end of file +installExtension('abcdefghijkl'); +installExtension([EMBER_INSPECTOR, JQUERY_DEBUGGER]); +installExtension(['extension', 'another-extension']); +installExtension([REACT_DEVELOPER_TOOLS, 'MOBX_DEVTOOLS']); diff --git a/types/electron-devtools-installer/index.d.ts b/types/electron-devtools-installer/index.d.ts index 88649cd0a8..92d94044d7 100644 --- a/types/electron-devtools-installer/index.d.ts +++ b/types/electron-devtools-installer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for electron-devtools-installer v2.0.1 +// Type definitions for electron-devtools-installer v2.2.4 // Project: https://github.com/MarshallOfSound/electron-devtools-installer // Definitions by: Robin Van den Broeck // M. Fatih Mar @@ -11,7 +11,7 @@ declare module "electron-devtools-installer" { } // Default installation function - export default function (extensionReference: ExtensionReference | string, forceDownload?: boolean): Promise; + export default function (extensionReference: ExtensionReference | string | Array, forceDownload?: boolean): Promise; // Devtools themself export const EMBER_INSPECTOR: ExtensionReference; @@ -25,4 +25,4 @@ declare module "electron-devtools-installer" { export const CYCLEJS_DEVTOOL: ExtensionReference; export const APOLLO_DEVELOPER_TOOLS: ExtensionReference; export const MOBX_DEVTOOLS: ExtensionReference; -} \ No newline at end of file +} diff --git a/types/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts index f956910b78..06cadf97f0 100644 --- a/types/electron-packager/electron-packager-tests.ts +++ b/types/electron-packager/electron-packager-tests.ts @@ -2,7 +2,7 @@ import packager = require("electron-packager"); function callback(err: Error, appPaths: string[]) { const msg = err.message; - const index = appPaths.indexOf("test"); + const index = appPaths.indexOf("test"); } function completeFunction(buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) { @@ -13,6 +13,8 @@ function ignoreFunction(path: string) { return true; } +// this is the obsolete API and will be removed in a future version + packager({ dir: ".", name: "myapplication", @@ -30,6 +32,29 @@ packager({ } }, callback); +function onCompleted(appPaths: string | string[]) { +} + +function onError(error: Error) { +} + +packager({ + dir: ".", + name: "myapplication", + platform: "win32", + arch: "all", + electronVersion: "0.34.0", + win32metadata: { + CompanyName: "Acme CO", + FileDescription: "My application", + OriginalFilename: "myapp.exe", + ProductName: "Application", + InternalName: "roadrunner", + "requested-execution-level": "highestAvailable", + "application-manifest": "manifest.xml" + } +}).then(onCompleted).catch(onError); + packager({ dir: ".", name: "myapplication", @@ -44,7 +69,7 @@ packager({ "requested-execution-level": "requireAdministrator", "application-manifest": "manifest.xml" } -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -52,14 +77,14 @@ packager({ platform: "all", arch: "all", electronVersion: "0.34.0" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", name: "myapplication", electronVersion: "0.34.0", all: true -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -67,7 +92,7 @@ packager({ electronVersion: "0.34.0", arch: "arm64", executableName: "myapp" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -110,7 +135,7 @@ packager({ "requested-execution-level": "asInvoker", "application-manifest": "manifest.xml" } -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -142,7 +167,7 @@ packager({ extendInfo: "plist.txt", helperBundleId: "23223f", osxSign: true -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -161,7 +186,7 @@ packager({ ignore: ignoreFunction, packageManager: "cnpm", platform: "linux" -}, callback); +}).then(onCompleted).catch(onError); packager({ dir: ".", @@ -192,4 +217,4 @@ packager({ "myapp2" ] }] -}, callback); +}).then(onCompleted).catch(onError); diff --git a/types/electron-packager/index.d.ts b/types/electron-packager/index.d.ts index 6e430ecdb2..0e438ebc6e 100644 --- a/types/electron-packager/index.d.ts +++ b/types/electron-packager/index.d.ts @@ -1,14 +1,28 @@ -// Type definitions for electron-packager 10.1 +// Type definitions for electron-packager 12.0 // Project: https://github.com/electron-userland/electron-packager // Definitions by: Maxime LUCE // Juan Jimenez-Anca // John Kleinschmidt +// Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export = electronPackager; +/** + * This will: + * - Find or download the correct release of Electron + * - Use that version of electron to create a app in /-- + * + * You should be able to launch the app on the platform you built for. If not, check your settings and try again. + * + * @param opts - Options to configure packaging. + * + * @returns A promise containing the path(s) to the newly created application(s) + */ +declare function electronPackager(opts: electronPackager.Options): Promise; + /** * This will: * - Find or download the correct release of Electron @@ -18,6 +32,8 @@ export = electronPackager; * * @param opts - Options to configure packaging. * @param callback - Callback which is called when packaging is done or an error occured. + * + * @deprecated since version 12.0 */ declare function electronPackager(opts: electronPackager.Options, callback: electronPackager.finalCallback): void; diff --git a/types/electron-unhandled/electron-unhandled-tests.ts b/types/electron-unhandled/electron-unhandled-tests.ts new file mode 100644 index 0000000000..42444658f8 --- /dev/null +++ b/types/electron-unhandled/electron-unhandled-tests.ts @@ -0,0 +1,5 @@ +import * as unhandled from "electron-unhandled"; + +unhandled({ logger: 'foo' }); // $ExpectError +unhandled({ showDialog: 'bar' }); // $ExpectError +unhandled({ logger: (err: Error) => {}, showDialog: true }); // $ExpectType void diff --git a/types/electron-unhandled/index.d.ts b/types/electron-unhandled/index.d.ts new file mode 100644 index 0000000000..d560e05b80 --- /dev/null +++ b/types/electron-unhandled/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for electron-unhandled 1.1 +// Project: https://github.com/sindresorhus/electron-unhandled +// Definitions by: Olegs Jeremejevs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace unhandled { + interface Options { + logger?: (err: Error) => void; + showDialog?: boolean; + } +} + +declare function unhandled(options?: unhandled.Options): void; + +export = unhandled; diff --git a/types/electron-unhandled/tsconfig.json b/types/electron-unhandled/tsconfig.json new file mode 100644 index 0000000000..fa790385fe --- /dev/null +++ b/types/electron-unhandled/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "electron-unhandled-tests.ts" + ] +} diff --git a/types/electron-unhandled/tslint.json b/types/electron-unhandled/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/electron-unhandled/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index b891bbe1d1..b071662326 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -526,7 +526,7 @@ declare module 'ember-data' { * invoking the callback with the name of each relationship and its relationship * descriptor. */ - eachRelationship(callback: Function, binding: any): any; + eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; /** * Represents the model's class name as a string. This can be used to look up the model's class name through * `DS.Store`'s modelFor method. @@ -577,7 +577,7 @@ declare module 'ember-data' { * invoking the callback with the name of each relationship and its relationship * descriptor. */ - static eachRelationship(callback: Function, binding: any): any; + static eachRelationship(callback: (name: string, details: RelationshipMeta) => void, binding?: any): any; /** * Given a callback, iterates over each of the types related to a model, * invoking the callback with the related type's class. Each type will be diff --git a/types/ember-data/test/relationships.ts b/types/ember-data/test/relationships.ts index df43387bb4..06795c0e26 100644 --- a/types/ember-data/test/relationships.ts +++ b/types/ember-data/test/relationships.ts @@ -12,6 +12,20 @@ const Polymorphic = DS.Model.extend({ paymentMethods: DS.hasMany('payment-method', { polymorphic: true }) }); +Polymorphic.eachRelationship(() => ''); +Polymorphic.eachRelationship(() => '', {}); +Polymorphic.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); +let p = Polymorphic.create(); +p.eachRelationship(() => ''); +p.eachRelationship(() => '', {}); +p.eachRelationship((n, meta) => { + let s: string = n; + let m: 'belongsTo' | 'hasMany' = meta.kind; +}); + class Comment extends DS.Model { author = DS.attr('string'); } diff --git a/types/ember-qunit/ember-qunit-tests.ts b/types/ember-qunit/ember-qunit-tests.ts index 6ddb4e5454..acd9650f98 100644 --- a/types/ember-qunit/ember-qunit-tests.ts +++ b/types/ember-qunit/ember-qunit-tests.ts @@ -2,6 +2,7 @@ import Ember from 'ember'; import hbs from 'htmlbars-inline-precompile'; import { module } from 'qunit'; import { + start, test, skip, moduleFor, @@ -137,3 +138,5 @@ module('x-foo', function(hooks) { module('foo service', function(hooks) { setupTest(hooks); }); + +start(); diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index 9dc93b980b..5dbfb49401 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -97,6 +97,48 @@ declare module 'ember-qunit' { export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; + + interface QUnitStartOptions { + /** + * If `false` tests will not be loaded automatically. + */ + loadTests?: boolean; + + /** + * If `false` the test container will not be setup based on `devmode`, + * `dockcontainer`, or `nocontainer` URL params. + */ + setupTestContainer?: boolean; + + /** + * If `false` tests will not be automatically started (you must run + * `QUnit.start()` to kick them off). + */ + startTests?: boolean; + + /** + * If `false` the default Ember.Test adapter will not be updated. + */ + setupTestAdapter?: boolean; + + /** + * `false` opts out of the default behavior of setting `Ember.testing` + * to `true` before all tests and back to `false` after each test will. + */ + setupEmberTesting?: boolean; + + /** + * If `false` validation of `Ember.onerror` will be disabled. + */ + setupEmberOnerrorValidation?: boolean; + + /** + * If `false` test isolation validation will be disabled. + */ + setupTestIsolationValidatoin?: boolean; + } + + export function start(options?: QUnitStartOptions): void; } declare module 'qunit' { diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 56a0879ae5..93babaa0a7 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -7,6 +7,7 @@ // Theron Cross // Martin Feckie // Alex LaFroscia +// Mike North // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -111,6 +112,8 @@ declare module 'ember' { | 'render' | 'afterRender' | 'destroy'; + type QueryParamTypes = 'boolean' | 'number' | 'array' | 'string'; + type QueryParamScopeTypes = 'controller' | 'model'; type ObserverMethod = | (keyof Target) @@ -308,6 +311,10 @@ declare module 'ember' { * Given a fullName return a corresponding instance. */ lookup(fullName: string, options?: {}): any; + /** + * Given a fullName return a corresponding factory. + */ + factoryFor(fullName: string, options?: {}): any; } const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; @@ -321,11 +328,11 @@ declare module 'ember' { */ resolveRegistration(fullName: string): Function; /** - * Registers a factory that can be used for dependency injection (with + * Registers a factory or value that can be used for dependency injection (with * `inject`) or for service lookup. Each factory is registered with * a full name including two parts: `type:name`. */ - register(fullName: string, factory: Function, options?: { singleton?: boolean, instantiate?: boolean }): any; + register(fullName: string, factory: any, options?: { singleton?: boolean, instantiate?: boolean }): any; /** * Unregister a factory. */ @@ -473,6 +480,11 @@ declare module 'ember' { **/ Router: Router; registry: Registry; + /** + * Initialize the application and return a promise that resolves with the `Application` + * object when the boot process is complete. + */ + boot(): Promise; } /** The `ApplicationInstance` encapsulates all of the stateful aspects of a @@ -738,7 +750,11 @@ declare module 'ember' { replaceRoute(name: string, ...args: any[]): void; transitionToRoute(name: string, ...args: any[]): void; model: any; - queryParams: string[] | Array<{ [key: string]: { type: string } }>; + queryParams: string | string[] | Array<{ [key: string]: { + type?: QueryParamTypes, + scope?: QueryParamScopeTypes, + as?: string + }}>; target: Object; } const ControllerMixin: Ember.Mixin; @@ -1100,6 +1116,12 @@ declare module 'ember' { * Unregister a factory. */ unregister(fullName: string): any; + + /** + * Initialize the `EngineInstance` and return a promise that resolves + * with the instance itself when the boot process is complete. + */ + boot(): Promise; } /** * This mixin defines the common interface implemented by enumerable objects @@ -1173,7 +1195,7 @@ declare module 'ember' { * key. You can pass an optional second argument with the target value. Otherwise * this will match any property that evaluates to false. */ - rejectBy(key: string, value?: string): NativeArray; + rejectBy(key: string, value?: any): NativeArray; /** * Returns the first item in the array for which the callback returns true. * This method works similar to the `filter()` method defined in JavaScript 1.6 @@ -1492,25 +1514,25 @@ declare module 'ember' { __ember_mixin__: never; static create( - args?: T & ThisType> + args?: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> ): Mixin; static create( - arg1: T1 & ThisType>, - arg2: T2 & ThisType>, - arg3: T3 & ThisType>, - arg4: T4 & ThisType> + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & ThisType> ): Mixin; } /** @@ -1984,6 +2006,19 @@ declare module 'ember' { */ transitionTo(name: string, ...object: any[]): Transition; + // https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo + /** + * Perform a synchronous transition into another route without attempting to resolve promises, + * update the URL, or abort any currently active asynchronous transitions + * (i.e. regular transitions caused by transitionTo or URL changes). + * + * @param name the name of the route or a URL + * @param object the model(s) or identifier(s) to be used while + * transitioning to the route. + * @returns the Transition object associated with this attempted transition + */ + intermediateTransitionTo(name: string, ...object: any[]): Transition; + // properties /** * The controller associated with this route. @@ -3337,7 +3372,48 @@ declare module 'ember' { /** * The Router service is the public API that provides component/view layer access to the router. */ - class RouterService extends Ember.Service { + export class RouterService extends Ember.Service { + // + /** + Name of the current route. + This property represent the logical name of the route, + which is comma separated. + For the following router: + ```app/router.js + Router.map(function() { + this.route('about'); + this.route('blog', function () { + this.route('post', { path: ':post_id' }); + }); + }); + ``` + It will return: + * `index` when you visit `/` + * `about` when you visit `/about` + * `blog.index` when you visit `/blog` + * `blog.post` when you visit `/blog/some-post-id` + */ + readonly currentRouteName: string; + // + /** + Current URL for the application. + This property represent the URL path for this route. + For the following router: + ```app/router.js + Router.map(function() { + this.route('about'); + this.route('blog', function () { + this.route('post', { path: ':post_id' }); + }); + }); + ``` + It will return: + * `/` when you visit `/` + * `/about` when you visit `/about` + * `/blog` when you visit `/blog` + * `/blog/some-post-id` when you visit `/blog/some-post-id` + */ + readonly currentURL: string; // /** * Determines whether a route is active. @@ -3741,6 +3817,11 @@ declare module '@ember/routing/router' { export default class EmberRouter extends Ember.Router { } } +declare module '@ember/routing/router-service' { + import { RouterService } from 'ember'; + export default class extends RouterService { } +} + declare module '@ember/runloop' { import Ember from 'ember'; export const begin: typeof Ember.run.begin; diff --git a/types/ember/test/application-instance.ts b/types/ember/test/application-instance.ts index dfda446463..9ae22e5f26 100644 --- a/types/ember/test/application-instance.ts +++ b/types/ember/test/application-instance.ts @@ -1,4 +1,5 @@ import ApplicationInstance from '@ember/application/instance'; +import hbs from 'htmlbars-inline-precompile'; const appInstance = ApplicationInstance.create(); appInstance.register('some:injection', class Foo {}); @@ -11,7 +12,18 @@ appInstance.register('some:injection', class Foo {}, { instantiate: false, }); +appInstance.register('templates:foo/bar', hbs`

Hello World

`); + appInstance.register('some:injection', class Foo {}, { singleton: false, instantiate: true, }); + +appInstance.factoryFor('router:main'); +appInstance.lookup('route:basic'); + +appInstance.boot(); + +(async function() { + await appInstance.boot(); +}()); diff --git a/types/ember/test/engine-instance.ts b/types/ember/test/engine-instance.ts new file mode 100644 index 0000000000..c74914dea5 --- /dev/null +++ b/types/ember/test/engine-instance.ts @@ -0,0 +1,26 @@ +import EngineInstance from '@ember/engine/instance'; + +const engineInstance = EngineInstance.create(); +engineInstance.register('some:injection', class Foo {}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: true, +}); + +engineInstance.register('some:injection', class Foo {}, { + instantiate: false, +}); + +engineInstance.register('some:injection', class Foo {}, { + singleton: false, + instantiate: true, +}); + +engineInstance.factoryFor('router:main'); +engineInstance.lookup('route:basic'); + +engineInstance.boot(); + +(async function() { + await engineInstance.boot(); +}()); diff --git a/types/ember/test/mixin.ts b/types/ember/test/mixin.ts index 2c417c00da..a89f490a11 100755 --- a/types/ember/test/mixin.ts +++ b/types/ember/test/mixin.ts @@ -44,3 +44,14 @@ const obj = LiteralMixins.create(); assertType(obj.a); assertType(obj.b); assertType(obj.c); + +/* Test composition of mixins */ +const EditableAndCancelableMixin = Ember.Mixin.create(EditableMixin, { + cancelled: false, +}); + +const EditableAndCancelableComment = Ember.Route.extend(EditableAndCancelableMixin); + +const editableAndCancelable = EditableAndCancelableComment.create(); +assertType(editableAndCancelable.isEditing); +assertType(editableAndCancelable.cancelled); diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts index fad5bbc634..84e432dbd3 100755 --- a/types/ember/test/route.ts +++ b/types/ember/test/route.ts @@ -92,4 +92,13 @@ class RouteUsingClass extends Route.extend({ beforeModel(this: RouteUsingClass) { return 'beforeModel can return anything, not just promises'; } + intermediateTransitionWithoutModel() { + this.intermediateTransitionTo('some-route'); + } + intermediateTransitionWithModel() { + this.intermediateTransitionTo('some.other.route', { }); + } + intermediateTransitionWithMultiModel() { + this.intermediateTransitionTo('some.other.route', 1, 2, { }); + } } diff --git a/types/ember/test/router.ts b/types/ember/test/router.ts index c663083679..760e9ed5bc 100755 --- a/types/ember/test/router.ts +++ b/types/ember/test/router.ts @@ -1,4 +1,5 @@ import Ember from 'ember'; +import { assertType } from './lib/assert'; const AppRouter = Ember.Router.extend({ }); @@ -25,6 +26,12 @@ AppRouter.map(function() { const RouterServiceConsumer = Ember.Service.extend({ router: Ember.inject.service('router'), + currentRouteName() { + const x: string = Ember.get(this, 'router').currentRouteName; + }, + currentURL() { + const x: string = Ember.get(this, 'router').currentURL; + }, transitionWithoutModel() { Ember.get(this, 'router') .transitionTo('some-route'); @@ -34,6 +41,11 @@ const RouterServiceConsumer = Ember.Service.extend({ Ember.get(this, 'router') .transitionTo('some.other.route', model); }, + transitionWithMultiModel() { + const model = Ember.Object.create(); + Ember.get(this, 'router') + .transitionTo('some.other.route', model, model); + }, transitionWithModelAndOptions() { const model = Ember.Object.create(); Ember.get(this, 'router') diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json index b4bc966044..676c107f72 100755 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -23,6 +23,7 @@ "test/lib/assert.ts", "test/application.ts", "test/application-instance.ts", + "test/engine-instance.ts", "test/ember-tests.ts", "test/error.ts", "test/event.ts", diff --git a/types/ember__test-helpers/ember__test-helpers-tests.ts b/types/ember__test-helpers/ember__test-helpers-tests.ts new file mode 100644 index 0000000000..9fe9e4c297 --- /dev/null +++ b/types/ember__test-helpers/ember__test-helpers-tests.ts @@ -0,0 +1,95 @@ +/// + +import { test } from 'qunit'; +import Application from '@ember/application'; +import hbs from 'htmlbars-inline-precompile'; +import { + click, + doubleClick, + tap, + focus, + blur, + triggerEvent, + triggerKeyEvent, + fillIn, + render, + find, + findAll, + getRootElement, + pauseTest, + resumeTest, + waitFor, + waitUntil, + settled, + isSettled, + getSettledState, + visit, + currentURL, + currentRouteName, + setApplication +} from '@ember/test-helpers'; + +const MyApp = Application.extend({ modulePrefix: 'my-app' }); + +setApplication(MyApp.create()); + +test('DOM interactions', async () => { + await render(hbs`
Hello, world
`); + + await click('.message'); + await doubleClick('.message'); + await tap('.message'); + await focus('.message'); + await blur('.message'); + await triggerEvent('.message', 'custom-event'); + await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true }); + await fillIn('.message', 'content'); + + const messageElement = find('.message')!; + await click(messageElement); + await doubleClick(messageElement); + await tap(messageElement); + await focus(messageElement); + await blur(messageElement); + await triggerEvent(messageElement, 'custom-event'); + await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true }); + await fillIn(messageElement, 'content'); + + const allMessages = findAll('.message'); + for (const element of allMessages) { + await click(element); + } + + const root = getRootElement(); + await click(root); +}); + +test('routing helpers', async (assert) => { + await visit('/foo'); + + assert.equal(currentURL(), '/foo'); + assert.equal(currentRouteName(), 'foo'); +}); + +test('pause and resume', async () => { + await pauseTest(); + setTimeout(resumeTest, 1000); +}); + +test('wait helpers', async (assert) => { + await render(hbs`
Hello
`); + + await waitFor('.message', { count: 1, timeout: 10, timeoutMessage: 'uh oh' }); + await waitUntil(() => 'hello', { timeout: 1000, timeoutMessage: 'boom' }); + + await settled(); + assert.ok(isSettled()); + + const { + hasPendingRequests, + hasPendingTimers, + hasPendingWaiters, + hasRunLoop, + pendingRequestCount + } = getSettledState(); +}); diff --git a/types/ember__test-helpers/index.d.ts b/types/ember__test-helpers/index.d.ts new file mode 100644 index 0000000000..067222b425 --- /dev/null +++ b/types/ember__test-helpers/index.d.ts @@ -0,0 +1,220 @@ +// Type definitions for @ember/test-helpers 0.7 +// Project: https://github.com/emberjs/ember-test-helpers +// Definitions by: Dan Freeman +// James C. Davis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +/// + +declare module '@ember/test-helpers' { + // DOM Interaction Helpers + + export type Target = string | Element; + + export { default as click } from '@ember/test-helpers/dom/click'; + export { default as doubleClick } from '@ember/test-helpers/dom/double-click'; + export { default as tap } from '@ember/test-helpers/dom/tap'; + export { default as focus } from '@ember/test-helpers/dom/focus'; + export { default as blur } from '@ember/test-helpers/dom/blur'; + export { default as triggerEvent } from '@ember/test-helpers/dom/trigger-event'; + export { default as triggerKeyEvent } from '@ember/test-helpers/dom/trigger-key-event'; + export { default as fillIn } from '@ember/test-helpers/dom/fill-in'; + + // DOM Query Helpers + + export { default as find } from '@ember/test-helpers/dom/find'; + export { default as findAll } from '@ember/test-helpers/dom/find-all'; + export { default as getRootElement } from '@ember/test-helpers/dom/get-root-element'; + + // Routing Helpers + + export { visit, currentRouteName, currentURL } from '@ember/test-helpers/setup-application-context'; + + // Rendering Helpers + + export { render, clearRender } from '@ember/test-helpers/setup-rendering-context'; + + // Wait Helpers + + export { default as waitFor } from '@ember/test-helpers/dom/wait-for'; + export { default as waitUntil } from '@ember/test-helpers/wait-until'; + export { default as settled, isSettled, getSettledState } from '@ember/test-helpers/settled'; + + // Pause Helpers + + export { pauseTest, resumeTest } from '@ember/test-helpers/setup-context'; + + // Test Framework APIs + + export { setResolver, getResolver } from '@ember/test-helpers/resolver'; + export { default as setupContext, getContext, setContext, unsetContext } from '@ember/test-helpers/setup-context'; + export { default as teardownContext } from '@ember/test-helpers/teardown-context'; + export { default as setupRenderingContext } from '@ember/test-helpers/setup-rendering-context'; + export { default as teardownRenderingContext } from '@ember/test-helpers/teardown-rendering-context'; + export { getApplication, setApplication } from '@ember/test-helpers/application'; + export { default as setupApplicationContext } from '@ember/test-helpers/setup-application-context'; + export { default as teardownApplicationContext } from '@ember/test-helpers/teardown-application-context'; + export { default as validateErrorHandler } from '@ember/test-helpers/validate-error-handler'; +} + +declare module '@ember/test-helpers/dom/click' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/double-click' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/tap' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/focus' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/blur' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target): Promise; +} + +declare module '@ember/test-helpers/dom/trigger-event' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target, eventType: string, options?: object): Promise; +} + +declare module '@ember/test-helpers/dom/trigger-key-event' { + import { Target } from '@ember/test-helpers'; + + export type KeyEvent = 'keydown' | 'keyup' | 'keypress'; + + export interface KeyModifiers { + ctrlKey?: boolean; + altKey?: boolean; + shiftKey?: boolean; + metaKey?: boolean; + } + + export default function(target: Target, eventType: KeyEvent, key: number | string, modifiers?: KeyModifiers): Promise; +} + +declare module '@ember/test-helpers/dom/fill-in' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target, text: string): Promise; +} + +declare module '@ember/test-helpers/dom/find' { + export default function(selector: string): Element | null; +} + +declare module '@ember/test-helpers/dom/find-all' { + export default function(selector: string): Element[]; +} + +declare module '@ember/test-helpers/dom/get-root-element' { + export default function(): Element; +} + +declare module '@ember/test-helpers/setup-application-context' { + export default function(context: Context): Promise; + export function visit(url: string): Promise; + export function currentRouteName(): string; + export function currentURL(): string; +} + +declare module '@ember/test-helpers/setup-rendering-context' { + import { TemplateFactory } from 'htmlbars-inline-precompile'; + + export default function(context: Context): Promise; + export function render(template: TemplateFactory): Promise; + export function clearRender(): Promise; +} + +declare module '@ember/test-helpers/dom/wait-for' { + export interface Options { + timeout?: number; + count?: number; + timeoutMessage?: string; + } + + export default function(selector: string, options?: Options): Promise; +} + +declare module '@ember/test-helpers/wait-until' { + export interface Options { + timeout?: number; + timeoutMessage?: string; + } + + export default function(callback: () => T, options?: Options): Promise; +} + +declare module '@ember/test-helpers/settled' { + export interface SettledState { + hasRunLoop: boolean; + hasPendingTimers: boolean; + hasPendingWaiters: boolean; + hasPendingRequests: boolean; + pendingRequestCount: number; + } + + export default function(): Promise; + export function isSettled(): boolean; + export function getSettledState(): SettledState; +} + +declare module '@ember/test-helpers/setup-context' { + import Resolver from '@ember/application/resolver'; + + export default function(context: C, options?: { resolver?: Resolver }): Promise; + export function getContext(): object; + export function setContext(context: object): void; + export function unsetContext(): void; + + export function pauseTest(): Promise; + export function resumeTest(): void; +} + +declare module '@ember/test-helpers/resolver' { + import Resolver from '@ember/application/resolver'; + + export function setResolver(resolver: Resolver): void; + export function getResolver(): Resolver; +} + +declare module '@ember/test-helpers/teardown-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/teardown-rendering-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/teardown-application-context' { + export default function(context: object): Promise; +} + +declare module '@ember/test-helpers/validate-error-handler' { + import Error from '@ember/error'; + + export default function(callback?: (error: Error) => void): { isValid: boolean, message: string }; +} + +declare module '@ember/test-helpers/application' { + import Application from '@ember/application'; + + export function getApplication(): Application; + export function setApplication(application: Application): void; +} diff --git a/types/ember__test-helpers/tsconfig.json b/types/ember__test-helpers/tsconfig.json new file mode 100644 index 0000000000..de0efdd984 --- /dev/null +++ b/types/ember__test-helpers/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@ember/test-helpers": ["ember__test-helpers"] + } + }, + "files": [ + "index.d.ts", + "ember__test-helpers-tests.ts" + ] +} diff --git a/types/ember__test-helpers/tslint.json b/types/ember__test-helpers/tslint.json new file mode 100644 index 0000000000..4c4fc86ace --- /dev/null +++ b/types/ember__test-helpers/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} diff --git a/types/emoji-mart/dist-es/components/category.d.ts b/types/emoji-mart/dist-es/components/category.d.ts index 8cd4ceefbb..efa52e9988 100644 --- a/types/emoji-mart/dist-es/components/category.d.ts +++ b/types/emoji-mart/dist-es/components/category.d.ts @@ -1,12 +1,11 @@ import React = require('react'); -import { EmojiData } from '..'; - -import { Emoji, EmojiProps, I18n } from '.'; +import { Emoji, EmojiData, EmojiProps, I18n, CategoryName } from '..'; export interface Props { emojis?: Array; hasStickyPosition?: boolean; + id: CategoryName; name: string; native: boolean; perLine: number; diff --git a/types/emoji-mart/dist-es/components/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji.d.ts deleted file mode 100644 index 030ff7ce12..0000000000 --- a/types/emoji-mart/dist-es/components/emoji.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; -export type EmojiSet = 'apple'|'google'|'twitter'|'emojione'|'messenger'|'facebook'; -export type EmojiSheetSize = 16|20|32|64; - -export interface Props { - onOver?(emoji: EmojiData, e: React.MouseEvent): void; - onLeave?(emoji: EmojiData, e: React.MouseEvent): void; - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ - backgroundImageFn?: BackgroundImageFn; - native?: boolean; - forceSize?: boolean; - tooltip?: boolean; - /** defaults to 1 */ - skin?: EmojiSkin; - /** defaults to 64 */ - sheetSize?: EmojiSheetSize; - /** defaults to 'apple' */ - set?: EmojiSet; - size: number; - emoji: string|EmojiData; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const Emoji: React.SFC; - -export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts new file mode 100644 index 0000000000..d86d2b686f --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/emoji.d.ts @@ -0,0 +1,8 @@ +import React = require('react'); + +import { EmojiProps } from '../..'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const Emoji: React.StatelessComponent; + +export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts new file mode 100644 index 0000000000..77888f5a94 --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji/nimble-emoji.d.ts @@ -0,0 +1,12 @@ +import React = require('react'); + +import { EmojiProps, Data } from '../..'; + +export interface NimbleEmojiProps extends EmojiProps { + data: Data; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const NimbleEmoji: React.SFC; + +export { NimbleEmoji as default }; diff --git a/types/emoji-mart/dist-es/components/index.d.ts b/types/emoji-mart/dist-es/components/index.d.ts index 6fc29ecd54..3f05ca5c82 100644 --- a/types/emoji-mart/dist-es/components/index.d.ts +++ b/types/emoji-mart/dist-es/components/index.d.ts @@ -1,4 +1,6 @@ // The other exports on the components folder are not public API export { default as Category, Props as CategoryProps } from './category'; -export { default as Emoji, Props as EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from './emoji'; -export { default as Picker, Props as PickerProps, I18n, PartialI18n, CustomEmoji } from './picker'; +export { default as Emoji } from './emoji/emoji'; +export { default as NimbleEmoji, NimbleEmojiProps } from './emoji/nimble-emoji'; +export { default as Picker } from './picker/picker'; +export { default as NimblePicker, NimblePickerProps } from './picker/nimble-picker'; diff --git a/types/emoji-mart/dist-es/components/picker.d.ts b/types/emoji-mart/dist-es/components/picker.d.ts deleted file mode 100644 index 9f9132df05..0000000000 --- a/types/emoji-mart/dist-es/components/picker.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import React = require('react'); - -import { EmojiData, EmojiSkin } from '..'; - -import { Category, Emoji, EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from '.'; - -// tslint:disable-next-line interface-name -export interface I18n { - search: string; - categories: Record<'search'|'recent'|'people'|'nature'|'foods'|'activity'|'places'|'objects'|'symbols'|'flags'|'custom', string>; - notfound: string; -} - -export type PartialI18n = Partial & { categories: Partial}>; - -export interface CustomEmoji { - // id is overridden by short_names[0] - name: string; - /** Must contain at least one name. The first name is used as the unique id. */ - short_names: string[]; - emoticons?: string[]; - keywords?: string[]; - imageUrl: string; -} - -export interface Props { - /** NOTE: default is not preventable */ - onClick?(emoji: EmojiData, e: React.MouseEvent): void; - perLine?: number; - emojiSize?: number; - i18n?: PartialI18n; - style?: React.CSSProperties; - title?: string; - emoji?: string; - color?: string; - set?: EmojiSet; - skin?: EmojiSkin; - native?: boolean; - backgroundImageFn?: BackgroundImageFn; - sheetSize?: EmojiSheetSize; - emojisToShowFilter?(emoji: EmojiData): boolean; - showPreview?: boolean; - emojiTooltip?: boolean; - include?: string[]; - exclude?: string[]; - recent?: string[]; - autoFocus?: boolean; - /** NOTE: custom emoji are copied into a singleton object on every new mount */ - custom: CustomEmoji[]; -} - -export default class Picker extends React.PureComponent { - // everything inside it is supposed to be private -} diff --git a/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts new file mode 100644 index 0000000000..cc564b2a5e --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/nimble-picker.d.ts @@ -0,0 +1,11 @@ +import React = require('react'); + +import { Data, PickerProps } from '../..'; + +export interface NimblePickerProps extends PickerProps { + data: Data; +} + +export default class NimblePicker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/components/picker/picker.d.ts b/types/emoji-mart/dist-es/components/picker/picker.d.ts new file mode 100644 index 0000000000..01f8a41f8b --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker/picker.d.ts @@ -0,0 +1,7 @@ +import React = require('react'); + +import { PickerProps } from '../..'; + +export default class Picker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/index.d.ts b/types/emoji-mart/dist-es/index.d.ts index e49d37fcf6..bb0c79be3e 100644 --- a/types/emoji-mart/dist-es/index.d.ts +++ b/types/emoji-mart/dist-es/index.d.ts @@ -1,15 +1,30 @@ -export { default as emojiIndex, EmojiData, EmojiSkin } from './utils/emoji-index'; export { default as store, StoreHandlers } from './utils/store'; export { default as frequently } from './utils/frequently'; +export { Data } from './utils/data'; + +export { + PickerProps, + EmojiProps, + I18n, + PartialI18n, + CategoryName +} from './utils/shared-props'; + +export { + emojiIndex, + nimbleEmojiIndex, + EmojiData, + CustomEmoji, + EmojiSkin +} from './utils/emoji-index'; export { Picker, - PickerProps, - I18n, - PartialI18n, - CustomEmoji, + NimblePicker, + NimblePickerProps, Emoji, - EmojiProps, + NimbleEmoji, + NimbleEmojiProps, Category, CategoryProps } from './components'; diff --git a/types/emoji-mart/dist-es/utils/data.d.ts b/types/emoji-mart/dist-es/utils/data.d.ts new file mode 100644 index 0000000000..ad1bc0d229 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/data.d.ts @@ -0,0 +1,73 @@ +export interface Data { + compressed: boolean; + categories: Category[]; + emojis: { [key: string]: Emoji }; + aliases: { [key: string]: string }; +} + +export interface Category { + id: string; + name: string; + emojis: string[]; +} + +export interface Emoji { + name?: string; + a?: string; + unified?: string; + b?: string; + non_qualified?: string; + c?: string; + has_img_apple?: boolean; + d?: boolean; + has_img_google?: boolean; + e?: boolean; + has_img_twitter?: boolean; + f?: boolean; + has_img_emojione?: boolean; + g?: boolean; + has_img_facebook?: boolean; + h?: boolean; + has_img_messenger?: boolean; + i?: boolean; + keywords?: string[]; + j?: string[]; + sheet?: number[]; + k?: number[]; + emoticons?: string[]; + l?: string[]; + text?: string; + m?: string; + short_names?: string[]; + n?: string[]; + added_in?: number; + o?: number; + sheet_x?: number; + sheet_y?: number; + skin_variations?: { [key: string]: SkinVariation }; + obsoleted_by?: string; + obsoletes?: string; +} + +export interface SkinVariation { + unified: string; + non_qualified: null | string; + image: string; + sheet_x: number; + sheet_y: number; + added_in: string; + has_img_apple: boolean; + has_img_google: boolean; + has_img_twitter: boolean; + has_img_emojione: boolean; + has_img_facebook: boolean; + has_img_messenger: boolean; + obsoleted_by?: string; + obsoletes?: string; +} + +export function buildSearch(emoji: Emoji): string; + +export function compress(emoji: Emoji): void; + +export function uncompress(data: Data): void; diff --git a/types/emoji-mart/dist-es/utils/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index.d.ts deleted file mode 100644 index c6499e663c..0000000000 --- a/types/emoji-mart/dist-es/utils/emoji-index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type EmojiSkin = 1|2|3|4|5|6; - -export interface EmojiData { - id: string; - name: string; - colons: string; - /** Reverse mapping to keyof emoticons */ - emoticons: string[]; - unified: string; - skin: EmojiSkin|null; - native: string; -} - -// tslint:disable-next-line strict-export-declare-modifiers -declare const _default: { - search(query: ''): null - search(query: string): EmojiData|null - - emojis: { [emoji: string]: EmojiData } - - /** Mapping of string to keyof emojis */ - emoticons: { [emoticon: string]: string } -}; - -export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts new file mode 100644 index 0000000000..0d1d6b8881 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/emoji-index.d.ts @@ -0,0 +1,14 @@ +import { EmojiData } from './nimble-emoji-index'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + search(query: ''): null; + search(query: string): EmojiData|null; + + emojis: { [emoji: string]: EmojiData }; + + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +}; + +export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts new file mode 100644 index 0000000000..576a5d0cb7 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/index.d.ts @@ -0,0 +1,2 @@ +export { default as emojiIndex } from './emoji-index'; +export { default as nimbleEmojiIndex, EmojiData, CustomEmoji, EmojiSkin } from './nimble-emoji-index'; diff --git a/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts new file mode 100644 index 0000000000..010c313d19 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index/nimble-emoji-index.d.ts @@ -0,0 +1,40 @@ +import { Data } from "../data"; + +import { CategoryName } from '../shared-props'; + +export type EmojiSkin = 1 | 2 | 3 | 4 | 5 | 6; + +export interface BaseEmoji { + id: string; + name: string; + colons: string; + /** Reverse mapping to keyof emoticons */ + emoticons: string[]; + unified: string; + skin: EmojiSkin | null; + native: string; +} + +export interface CustomEmoji { + // id is overridden by short_names[0] + id?: string; + // colons is overridden by :id: + colons?: string; + name: string; + /** Must contain at least one name. The first name is used as the unique id. */ + short_names: string[]; + emoticons?: string[]; + keywords?: string[]; + imageUrl: string; +} + +export type EmojiData = BaseEmoji | CustomEmoji; + +export default class NimbleEmojiIndex { + constructor(data: Data); + search(query: ''): null; + search(query: string): EmojiData[]|null; + emojis: { [emoji: string]: EmojiData }; + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string }; +} diff --git a/types/emoji-mart/dist-es/utils/shared-props.d.ts b/types/emoji-mart/dist-es/utils/shared-props.d.ts new file mode 100644 index 0000000000..c091e24556 --- /dev/null +++ b/types/emoji-mart/dist-es/utils/shared-props.d.ts @@ -0,0 +1,83 @@ +import React = require('react'); + +import { EmojiData, EmojiSkin, CustomEmoji } from './emoji-index/nimble-emoji-index'; + +export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; +export type EmojiSet = 'apple' | 'google' | 'twitter' | 'emojione' | 'messenger' | 'facebook'; +export type EmojiSheetSize = 16 | 20 | 32 | 64; + +export interface EmojiProps { + onOver?(emoji: EmojiData, e: React.MouseEvent): void; + onLeave?(emoji: EmojiData, e: React.MouseEvent): void; + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + fallback?(emoji: EmojiData, props: EmojiProps): React.Component; + /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ + backgroundImageFn?: BackgroundImageFn; + native?: boolean; + forceSize?: boolean; + tooltip?: boolean; + /** defaults to 1 */ + skin?: EmojiSkin; + /** defaults to 64 */ + sheetSize?: EmojiSheetSize; + /** defaults to 52 */ + sheetColumns?: number; + /** defaults to 52 */ + sheetRows?: number; + /** defaults to 'apple' */ + set?: EmojiSet; + size: number; + emoji: string | EmojiData; + html?: boolean; + /** data is omitted here as it should be used for NimbleEmoji only - not emoji */ +} + +export type CategoryName = 'search' | 'recent' | 'people' | 'nature' | 'foods' | 'activity' | 'places' | 'objects' | 'symbols' | 'flags' | 'custom'; + +// tslint:disable-next-line interface-name +export interface I18n { + search: string; + categories: Record; + notfound: string; + skintext: string; +} + +export type PartialI18n = Partial & { categories: Partial }>; + +export interface CustomIcons { + categories: Record React.Component>; +} + +export interface PickerProps { + /** NOTE: default is not preventable */ + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + onSelect?(emoji: EmojiData): void; + onSkinChange?(skin: EmojiSkin): void; + perLine?: number; + emojiSize?: number; + i18n?: PartialI18n; + style?: React.CSSProperties; + title?: string; + emoji?: string; + color?: string; + set?: EmojiSet; + skin?: EmojiSkin; + defaultSkin?: EmojiSkin; + native?: boolean; + backgroundImageFn?: BackgroundImageFn; + sheetSize?: EmojiSheetSize; + emojisToShowFilter?(emoji: EmojiData): boolean; + showPreview?: boolean; + showSkinTones?: boolean; + emojiTooltip?: boolean; + include?: CategoryName[]; + exclude?: CategoryName[]; + recent?: string[]; + autoFocus?: boolean; + /** NOTE: custom emoji are copied into a singleton object on every new mount */ + custom: CustomEmoji[]; + skinEmoji?: string; + notFound?(): React.Component; + notFoundEmoji?: string; + icons?: CustomIcons; +} diff --git a/types/emoji-mart/emoji-mart-tests.tsx b/types/emoji-mart/emoji-mart-tests.tsx index 7b7b8d0471..56b05453a9 100644 --- a/types/emoji-mart/emoji-mart-tests.tsx +++ b/types/emoji-mart/emoji-mart-tests.tsx @@ -1,4 +1,4 @@ -// Port of https://github.com/missive/emoji-mart/blob/master/src/components/emoji.js +// Port of https://github.com/missive/emoji-mart/blob/v2.8.0/stories/index.js import React = require('react'); diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts index 6a8ed65632..38acd9e021 100644 --- a/types/emoji-mart/index.d.ts +++ b/types/emoji-mart/index.d.ts @@ -1,9 +1,8 @@ -// Type definitions for emoji-mart 2.2 +// Type definitions for emoji-mart 2.8 // Project: https://github.com/missive/emoji-mart // Definitions by: Diogo Franco +// Nick Winans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -// These definitions should work with 2.3, but the tests doesn't pass on 2.3. +// TypeScript Version: 2.8 export * from './dist-es'; diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json index 6ecc944e77..d929a3cc01 100644 --- a/types/emoji-mart/tsconfig.json +++ b/types/emoji-mart/tsconfig.json @@ -20,11 +20,17 @@ "files": [ "index.d.ts", "dist-es/components/category.d.ts", - "dist-es/components/emoji.d.ts", + "dist-es/components/emoji/emoji.d.ts", + "dist-es/components/emoji/nimble-emoji.d.ts", "dist-es/components/index.d.ts", - "dist-es/components/picker.d.ts", - "dist-es/utils/emoji-index.d.ts", + "dist-es/components/picker/picker.d.ts", + "dist-es/components/picker/nimble-picker.d.ts", + "dist-es/utils/emoji-index/emoji-index.d.ts", + "dist-es/utils/emoji-index/nimble-emoji-index.d.ts", + "dist-es/utils/emoji-index/index.d.ts", + "dist-es/utils/data.d.ts", "dist-es/utils/frequently.d.ts", + "dist-es/utils/shared-props.d.ts", "dist-es/utils/store.d.ts", "dist-es/index.d.ts", "emoji-mart-tests.tsx" diff --git a/types/emoji-regex/emoji-regex-tests.ts b/types/emoji-regex/emoji-regex-tests.ts new file mode 100644 index 0000000000..6d6b0d25d9 --- /dev/null +++ b/types/emoji-regex/emoji-regex-tests.ts @@ -0,0 +1,3 @@ +import emojiRegex from "emoji-regex"; + +emojiRegex(); // $ExpectType RegExp diff --git a/types/emoji-regex/index.d.ts b/types/emoji-regex/index.d.ts new file mode 100644 index 0000000000..edff690dc7 --- /dev/null +++ b/types/emoji-regex/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for emoji-regex 7.0 +// Project: https://github.com/mathiasbynens/emoji-regex +// Definitions by: iKBAHT +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function createRegExp(): RegExp; +export = createRegExp; diff --git a/types/emoji-regex/tsconfig.json b/types/emoji-regex/tsconfig.json new file mode 100644 index 0000000000..1dfdf53dac --- /dev/null +++ b/types/emoji-regex/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "emoji-regex-tests.ts" + ] +} diff --git a/types/emoji-regex/tslint.json b/types/emoji-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/emoji-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/enhanced-resolve/index.d.ts b/types/enhanced-resolve/index.d.ts index 1cf3a3397a..0a82a4263e 100644 --- a/types/enhanced-resolve/index.d.ts +++ b/types/enhanced-resolve/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for enhanced-resolve v3.0.0 // Project: https://github.com/webpack/enhanced-resolve.git -// Definitions by: e-cloud , Onigoetz +// Definitions by: e-cloud +// Onigoetz +// John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/enzyme-adapter-react-15.4/index.d.ts b/types/enzyme-adapter-react-15.4/index.d.ts index 570cc22e99..2496fb1719 100644 --- a/types/enzyme-adapter-react-15.4/index.d.ts +++ b/types/enzyme-adapter-react-15.4/index.d.ts @@ -2,7 +2,7 @@ // Project: http://airbnb.io/enzyme/ // Definitions by: Nabeelah Ali // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-15/index.d.ts b/types/enzyme-adapter-react-15/index.d.ts index 90149cae55..06659d75b9 100644 --- a/types/enzyme-adapter-react-15/index.d.ts +++ b/types/enzyme-adapter-react-15/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-adapter-react-16/index.d.ts b/types/enzyme-adapter-react-16/index.d.ts index 53f97ccce6..3e567d956b 100644 --- a/types/enzyme-adapter-react-16/index.d.ts +++ b/types/enzyme-adapter-react-16/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/airbnb/enzyme // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EnzymeAdapter } from 'enzyme'; diff --git a/types/enzyme-redux/index.d.ts b/types/enzyme-redux/index.d.ts index ad312d6d1f..e231119b89 100644 --- a/types/enzyme-redux/index.d.ts +++ b/types/enzyme-redux/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Knegusen/enzyme-redux#readme // Definitions by: Dennis Axelsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactWrapper, ShallowWrapper } from 'enzyme'; import { ReactElement } from 'react'; diff --git a/types/enzyme-to-json/index.d.ts b/types/enzyme-to-json/index.d.ts index d2ba70fc8f..1a8cafb23a 100644 --- a/types/enzyme-to-json/index.d.ts +++ b/types/enzyme-to-json/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/adriantoine/enzyme-to-json#readme // Definitions by: Joscha Feth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { ReactWrapper, ShallowWrapper } from 'enzyme'; diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index bbdd8f404f..e1762b843e 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -36,10 +36,18 @@ interface MyComponentState { } class MyComponent extends Component { + handleEcho(value: string) { + return value; + } setState(...args: any[]) { console.log(args); } } +class MyComponentPropsOnly extends Component { + handleEcho(value: string) { + return value; + } +} class AnotherComponent extends Component { setState(...args: any[]) { @@ -78,6 +86,34 @@ function ShallowWrapperTest() { let anotherStatelessWrapper: ShallowWrapper; let anotherComponentWrapper: ShallowWrapper; + // testStatePropsInstanceFn(shallow()); + function testStatePropsInstance() { + const wrapper = shallow(); + + const { + numberProp, // $ExpectType number + stringProp // $ExpectType string + } = wrapper.props(); + const { + stateProperty // $ExpectType string + } = wrapper.state(); + const { + handleEcho // $ExpectType (value: string) => string + } = wrapper.instance(); + + // $ExpectError + wrapper.setState({stateProperty: 123}); + // $ExpectError + wrapper.setState({statePropertyzasd: 'hello'}); + wrapper.setState({stateProperty: 'hello'}); + + // $ExpectError + wrapper.setProps({numberProp: '123'}); + // $ExpectError + wrapper.setProps({numberPropzasd: 'hello'}); + wrapper.setProps({numberProp: 123}); + } + function test_props_state_inferring() { let wrapper: ShallowWrapper; wrapper = shallow(); @@ -340,7 +376,16 @@ function ShallowWrapperTest() { } function test_instance() { - const myComponent: MyComponent = shallowWrapper.instance(); + const myComponent = shallowWrapper.instance() as MyComponent; + myComponent.handleEcho('it works'); + + const wrapper = shallow(); + wrapper.instance().handleEcho('it works'); + + const wrapperPropsOnly = shallow(); + wrapperPropsOnly.setProps({stringProp: 'new value'}); + // $ExpectError + wrapperPropsOnly.instance().handleEcho; } function test_update() { @@ -438,6 +483,33 @@ function ReactWrapperTest() { let anotherStatelessWrapper: ReactWrapper; let anotherComponentWrapper: ReactWrapper; + function testStatePropsInstance() { + const wrapper = mount(); + + const { + numberProp, // $ExpectType number + stringProp // $ExpectType string + } = wrapper.props(); + const { + stateProperty // $ExpectType string + } = wrapper.state(); + const { + handleEcho // $ExpectType (value: string) => string + } = wrapper.instance(); + + // $ExpectError + wrapper.setState({stateProperty: 123}); + // $ExpectError + wrapper.setState({statePropertyzasd: 'hello'}); + wrapper.setState({stateProperty: 'hello'}); + + // $ExpectError + wrapper.setProps({numberProp: '123'}); + // $ExpectError + wrapper.setProps({numberPropzasd: 'hello'}); + wrapper.setProps({numberProp: 123}); + } + function test_prop_state_inferring() { let wrapper: ReactWrapper; wrapper = mount(); @@ -696,7 +768,16 @@ function ReactWrapperTest() { } function test_instance() { - const myComponent: MyComponent = reactWrapper.instance(); + const myComponent = reactWrapper.instance() as MyComponent; + myComponent.handleEcho('it works'); + + const wrapperPropsOnly = mount(); + wrapperPropsOnly.setProps({stringProp: 'new value'}); + // $ExpectError + wrapperPropsOnly.instance().handleEcho; + + const wrapper = mount(); + wrapper.instance().handleEcho('it works'); } function test_update() { diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 0a741460f6..a91f60b3c6 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -7,8 +7,9 @@ // huhuanming // MartynasZilinskas // Torgeir Hovden +// Martin Hochel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// import { ReactElement, Component, AllHTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; @@ -45,7 +46,7 @@ export type EnzymeSelector = string | StatelessComponent | ComponentClass = (intercepter: T) => void; -export interface CommonWrapper

{ +export interface CommonWrapper

> { /** * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. */ @@ -258,7 +259,7 @@ export interface CommonWrapper

{ * * NOTE: can only be called on a wrapper instance that is also the root instance. */ - instance(): Component; + instance(): C; /** * Forces a re-render. Useful to run before checking the render output if something external may be updating @@ -354,8 +355,8 @@ export interface CommonWrapper

{ } // tslint:disable-next-line no-empty-interface -export interface ShallowWrapper

extends CommonWrapper { } -export class ShallowWrapper

{ +export interface ShallowWrapper

extends CommonWrapper { } +export class ShallowWrapper

{ constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps); shallow(options?: ShallowRendererProps): ShallowWrapper; unmount(): this; @@ -440,8 +441,8 @@ export class ShallowWrapper

{ } // tslint:disable-next-line no-empty-interface -export interface ReactWrapper

extends CommonWrapper { } -export class ReactWrapper

{ +export interface ReactWrapper

extends CommonWrapper { } +export class ReactWrapper

{ constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps); unmount(): this; @@ -588,12 +589,14 @@ export interface MountRendererProps { * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that * your tests aren't indirectly asserting on behavior of child components. */ +export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; export function shallow

(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. */ +export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; export function mount

(node: ReactElement

, options?: MountRendererProps): ReactWrapper; export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; diff --git a/types/epilogue/index.d.ts b/types/epilogue/index.d.ts index 3fe56b9e9f..e54f127d9e 100644 --- a/types/epilogue/index.d.ts +++ b/types/epilogue/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/dchester/epilogue // Definitions by: Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 import { Sequelize, diff --git a/types/error-subclass/error-subclass-tests.ts b/types/error-subclass/error-subclass-tests.ts new file mode 100644 index 0000000000..9944bba159 --- /dev/null +++ b/types/error-subclass/error-subclass-tests.ts @@ -0,0 +1,7 @@ +import ErrorSubclass from 'error-subclass'; + +class ExampleError extends ErrorSubclass { + static displayName = 'ExampleError'; +} + +throw new ExampleError('Something went wrong!'); diff --git a/types/error-subclass/index.d.ts b/types/error-subclass/index.d.ts new file mode 100644 index 0000000000..55add2c057 --- /dev/null +++ b/types/error-subclass/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for error-subclass 2.2 +// Project: https://github.com/spudly/error-subclass#readme +// Definitions by: Fitbit +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default class ErrorSubclass extends Error { + static displayName: string; +} diff --git a/types/error-subclass/tsconfig.json b/types/error-subclass/tsconfig.json new file mode 100644 index 0000000000..1574ebeea2 --- /dev/null +++ b/types/error-subclass/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "error-subclass-tests.ts" + ] +} diff --git a/types/error-subclass/tslint.json b/types/error-subclass/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/error-subclass/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/es-feature-detection/es-feature-detection-tests.ts b/types/es-feature-detection/es-feature-detection-tests.ts new file mode 100644 index 0000000000..13b779c1bb --- /dev/null +++ b/types/es-feature-detection/es-feature-detection-tests.ts @@ -0,0 +1,14 @@ +import * as es from "es-feature-detection"; + +const fns = es.builtins(); +if (fns["Array.prototype.includes"]) { + // [].includes +} +const syntax = es.syntax(); +if (syntax["Arrow function"]) { + new Function("() => {}"); +} + +if (fns.es2017.__all && syntax.es2017.__all) { + // support es2017! +} diff --git a/types/es-feature-detection/index.d.ts b/types/es-feature-detection/index.d.ts new file mode 100644 index 0000000000..7c4124ce73 --- /dev/null +++ b/types/es-feature-detection/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for es-feature-detection 2.0 +// Project: https://github.com/Tokimon/es-feature-detection#readme +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 +export type ES2015Builtins = "__all" | "Array.from" | "Array.of" | "Array.prototype.fill" | "Array.prototype.find" | "Array.prototype.findIndex" | "Array.prototype.entries" | "Array.prototype.keys" | + "Array.prototype.copyWithin" | "base64" | "Map" | "Set" | "WeakMap" | "WeakSet" | "Math.imul" | "Math.clz32" | "Math.fround" | "Math.log10" | "Math.log2" | "Math.log1p" | "Math.expm1" | + "Math.cosh" | "Math.sinh" | "Math.tanh" | "Math.acosh" | "Math.asinh" | "Math.hypot" | "Math.trunc" | "Math.sign" | "Math.cbrt" | "Number.isNaN" | "Number.isFinite" | "Number.isInteger" | + "Number.parseInt" | "Number.parseFloat" | "Number.EPSILON" | "Number.MAX_SAFE_INTEGER" | "Number.MIN_SAFE_INTEGER" | "Number.isSafeInteger" | "Object.prototype.__proto__" | "Object.is" | + "Object.setPrototypeOf" | "Object.assign" | "Object.getOwnPropertySymbols" | "Promise" | "Proxy" | "Reflect" | "requestAnimationFrame" | "String.fromCodePoint" | "String.prototype.codePointAt" | + "String.prototype.startsWith" | "String.prototype.endsWith" | "String.prototype.includes" | "String.prototype.repeat" | "String.prototype.normalize" | "String.raw" | "Symbol" | "TypedArrays" | + "new.target"; +export type ES2016Builtins = "__all" | "Array.prototype.includes" | "TypedArray.prototype.includes"; +export type ES2017Builtins = "__all" | "Atomics" | "Object.values" | "Object.entries" | "Object.getOwnPropertyDescriptors" | + "String.prototype.padEnd" | "String.prototype.padStart" | "SharedArrayBuffer"; +export type ES2015Syntax = "__all" | "for...of" | "RegExp.prototype.sticky" | "RegExp.prototype.unicode" | "const" | "let" | "Destructuring" | "Spread Array" | "Spread Function call" | + "Rest parameters" | "Default parameters" | "Arrow function" | "Generator function" | "Binary literals" | "Octal literals" | "Template Strings" | "Shorthand property" | "Shorthand method" | + "Computed property" | "Block level function declaration" | "class"; +export type ES2016Syntax = "__all" | "Exponentiation operator" | "Rest destructuring"; +export type ES2017Syntax = "__all" | "async/await" | "Trailing parameter commas"; +export function builtins(): Record & { + es2015: Record; + es2016: Record; + es2017: Record; +}; +export function syntax(): Record & { + es2015: Record; + es2016: Record; + es2017: Record; +}; diff --git a/types/es-feature-detection/tsconfig.json b/types/es-feature-detection/tsconfig.json new file mode 100644 index 0000000000..1a348b7edc --- /dev/null +++ b/types/es-feature-detection/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "es-feature-detection-tests.ts" + ] +} diff --git a/types/es-feature-detection/tslint.json b/types/es-feature-detection/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/es-feature-detection/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/escape-string-regexp/index.d.ts b/types/escape-string-regexp/index.d.ts index 7a52a312b1..a0b218afe9 100644 --- a/types/escape-string-regexp/index.d.ts +++ b/types/escape-string-regexp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for escape-string-regexp +// Type definitions for escape-string-regexp 1.0 // Project: https://github.com/sindresorhus/escape-string-regexp // Definitions by: kruncher // faergeek diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index 6a81d69c8a..b0c3c1966d 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -446,6 +446,7 @@ let cli: CLIEngine; cli = new CLIEngine({ allowInlineConfig: false }); cli = new CLIEngine({ baseConfig: false }); +cli = new CLIEngine({ baseConfig: { extends: ['lynt'] }}); cli = new CLIEngine({ cache: true }); cli = new CLIEngine({ cacheFile: 'foo' }); cli = new CLIEngine({ configFile: 'foo' }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 89067f97c8..031ab984f7 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -483,7 +483,7 @@ export class CLIEngine { export namespace CLIEngine { class Options { allowInlineConfig?: boolean; - baseConfig?: boolean; + baseConfig?: false | { [name: string]: any }; cache?: boolean; cacheFile?: string; cacheLocation?: string; diff --git a/types/espruino/espruino-tests.ts b/types/espruino/espruino-tests.ts index 5e84a93e65..c1bafc9048 100644 --- a/types/espruino/espruino-tests.ts +++ b/types/espruino/espruino-tests.ts @@ -1,2 +1,17 @@ +import * as wifi from 'Wifi'; + +wifi.connect('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => { + if (err) throw err; + console.log('connected'); +}); + +wifi.startAP('ssid', { password: 'pass', authMode: 'wpa_wpa2' }, err => { + if (err) throw err; + console.log("created"); +}); + +digitalWrite(D2, false); +digitalWrite(D2, true); + I2C1.setup({ scl: D4, sda: D0 }); Serial2.setup(9600, { rx: D16, tx: D17 }); diff --git a/types/espruino/index.d.ts b/types/espruino/index.d.ts index 43d1068230..cb6151e85a 100644 --- a/types/espruino/index.d.ts +++ b/types/espruino/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Espruino 1.94 // Project: http://www.espruino.com/ // Definitions by: Stanislav Berkov +// Jurand Niemczycki // Definitions: https://github.com/borisyankov/DefinitelyTyped declare interface Object { @@ -9,6 +10,7 @@ declare interface Object { declare module "Wifi" { function connect(ssid: string, options: any, callback: (err: any) => any): any; + function startAP(ssid: string, options: any, callback: (err: any) => any): any; } declare module "InfluxDB" { @@ -391,10 +393,10 @@ declare interface Timer { } - // write(data: any[]): any; - // on(event: string, handler: (data: any) => any): any; - // setup(boudrate: number, options: any): any; - // read(chars?: number): string; +// write(data: any[]): any; +// on(event: string, handler: (data: any) => any): any; +// setup(boudrate: number, options: any): any; +// read(chars?: number): string; /** @@ -3598,7 +3600,7 @@ declare function digitalPulse(pin: Pin, value: boolean, time: any): void; * @param value * @url http://www.espruino.com/Reference#l__global_digitalWrite */ -declare function digitalWrite(pin: Pin, value: number): void; +declare function digitalWrite(pin: Pin, value: number | boolean): void; /** *

Get the digital value of the given pin.

diff --git a/types/esri-leaflet/index.d.ts b/types/esri-leaflet/index.d.ts index 3dbd351cb5..df1a9c3752 100644 --- a/types/esri-leaflet/index.d.ts +++ b/types/esri-leaflet/index.d.ts @@ -44,6 +44,7 @@ declare module 'leaflet' { | 'GrayLabels' | 'DarkGrayLabels' | 'ImageryLabels' + | 'ImageryClarity' | 'ImageryTransportation' | 'ShadedReliefLabels' | 'TerrainLabels'; diff --git a/types/eth-lightwallet/eth-lightwallet-tests.ts b/types/eth-lightwallet/eth-lightwallet-tests.ts new file mode 100644 index 0000000000..4907c73cbf --- /dev/null +++ b/types/eth-lightwallet/eth-lightwallet-tests.ts @@ -0,0 +1,3 @@ +import * as lw from "eth-lightwallet"; + +lw.keystore.createVault({}); diff --git a/types/eth-lightwallet/index.d.ts b/types/eth-lightwallet/index.d.ts new file mode 100644 index 0000000000..f55e71884e --- /dev/null +++ b/types/eth-lightwallet/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for eth-lightwallet 3.0 +// Project: https://github.com/ConsenSys/eth-lightwallet#readme +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +export interface ECSignatureBuffer { + v: number; + r: Buffer; + s: Buffer; +} +export namespace signing { + function signTx( + keystore: keystore, + pwDerivedKey: Uint8Array, + rawTx: string, + signingAddress: string + ): string; + function signMsg( + keystore: keystore, + pwDerivedKey: Uint8Array, + rawMsg: string, + signingAddress: string + ): ECSignatureBuffer; + function signMsgHash( + keystore: keystore, + pwDerivedKey: Uint8Array, + msgHash: string, + signingAddress: string + ): ECSignatureBuffer; + function concatSig(signature: any): string; +} + +export class keystore { + static createVault( + options: any, + callback?: (error: Error, keystore: keystore) => void + ): keystore; + static generateRandomSeed(): string; + static isSeedValid(seed: string): boolean; + static deserialize(keystore: string): keystore; + serialize(): string; + keyFromPassword( + password: string, + callback?: (error: Error, pwDerivedKey: Uint8Array) => void + ): Uint8Array; + isDerivedKeyCorrect(pwDerivedKey: Uint8Array): boolean; + generateNewAddress( + pwDerivedKey: Uint8Array, + numberOfAddresses: number + ): void; + getSeed(pwDerivedKey: Uint8Array): string; + exportPrivateKey(address: string, pwDerivedKey: Uint8Array): string; + getAddresses(): string[]; +} + +export interface VaultOptions { + password: string; + seedPhrase: string; + salt?: string; + hdPathString: string; +} diff --git a/types/eth-lightwallet/tsconfig.json b/types/eth-lightwallet/tsconfig.json new file mode 100644 index 0000000000..80eab8563a --- /dev/null +++ b/types/eth-lightwallet/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "eth-lightwallet-tests.ts" + ] +} diff --git a/types/eth-lightwallet/tslint.json b/types/eth-lightwallet/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/eth-lightwallet/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ethereum-protocol/ethereum-protocol-tests.ts b/types/ethereum-protocol/ethereum-protocol-tests.ts new file mode 100644 index 0000000000..a30a691e87 --- /dev/null +++ b/types/ethereum-protocol/ethereum-protocol-tests.ts @@ -0,0 +1,4 @@ +import { CallData, BlockParamLiteral } from 'ethereum-protocol'; +BlockParamLiteral.Earliest; +BlockParamLiteral.Latest; +BlockParamLiteral.Pending; diff --git a/types/ethereum-protocol/index.d.ts b/types/ethereum-protocol/index.d.ts new file mode 100644 index 0000000000..9b967cfc83 --- /dev/null +++ b/types/ethereum-protocol/index.d.ts @@ -0,0 +1,293 @@ +// Type definitions for ethereum-protocol 1.0 +// Project: https://www.npmjs.com/package/ethereum-protocol +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import BigNumber from 'bignumber.js'; + +export type JSONRPCErrorCallback = (err: Error | null, result?: JSONRPCResponsePayload) => void; + +/** + * Do not create your own provider. Use an existing provider from a Web3 or ProviderEngine library + * Read more about Providers in the 0x wiki. + */ +export interface Provider { + sendAsync(payload: JSONRPCRequestPayload, callback: JSONRPCErrorCallback): void; +} + +export type ContractAbi = AbiDefinition[]; + +export type AbiDefinition = FunctionAbi | EventAbi; + +export type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi; + +export type ConstructorStateMutability = 'nonpayable' | 'payable'; +export type StateMutability = 'pure' | 'view' | ConstructorStateMutability; + +export enum AbiType { + Function = 'function', + Constructor = 'constructor', + Event = 'event', + Fallback = 'fallback', +} + +export interface MethodAbi { + type: AbiType.Function; + name: string; + inputs: DataItem[]; + outputs: DataItem[]; + constant: boolean; + stateMutability: StateMutability; + payable: boolean; +} + +export interface ConstructorAbi { + type: AbiType.Constructor; + inputs: DataItem[]; + payable: boolean; + stateMutability: ConstructorStateMutability; +} + +export interface FallbackAbi { + type: AbiType.Fallback; + payable: boolean; +} + +export interface EventParameter extends DataItem { + indexed: boolean; +} + +export interface EventAbi { + type: AbiType.Event; + name: string; + inputs: EventParameter[]; + anonymous: boolean; +} + +export interface DataItem { + name: string; + type: string; + components?: DataItem[]; +} + +export enum OpCode { + DelegateCall = 'DELEGATECALL', + Revert = 'REVERT', + Create = 'CREATE', + Stop = 'STOP', + Invalid = 'INVALID', + CallCode = 'CALLCODE', + StaticCall = 'STATICCALL', + Return = 'RETURN', + Call = 'CALL', + SelfDestruct = 'SELFDESTRUCT', +} + +export interface StructLog { + depth: number; + error: string; + gas: number; + gasCost: number; + memory: string[]; + op: OpCode; + pc: number; + stack: string[]; + storage: { [location: string]: string }; +} + +export interface TransactionTrace { + gas: number; + returnValue: any; + structLogs: StructLog[]; +} + +export type Unit = + | 'kwei' + | 'ada' + | 'mwei' + | 'babbage' + | 'gwei' + | 'shannon' + | 'szabo' + | 'finney' + | 'ether' + | 'kether' + | 'grand' + | 'einstein' + | 'mether' + | 'gether' + | 'tether'; + +export interface JSONRPCRequestPayload { + params: any[]; + method: string; + id: number; + jsonrpc: string; +} + +export interface JSONRPCResponsePayload { + result: any; + id: number; + jsonrpc: string; +} + +export interface AbstractBlock { + number: number | null; + hash: string | null; + parentHash: string; + nonce: string | null; + sha3Uncles: string; + logsBloom: string | null; + transactionsRoot: string; + stateRoot: string; + miner: string; + difficulty: BigNumber; + totalDifficulty: BigNumber; + extraData: string; + size: number; + gasLimit: number; + gasUsed: number; + timestamp: number; + uncles: string[]; +} + +export interface BlockWithoutTransactionData extends AbstractBlock { + transactions: string[]; +} + +export interface BlockWithTransactionData extends AbstractBlock { + transactions: Transaction[]; +} + +export interface Transaction { + hash: string; + nonce: number; + blockHash: string | null; + blockNumber: number | null; + transactionIndex: number | null; + from: string; + to: string | null; + value: BigNumber; + gasPrice: BigNumber; + gas: number; + input: string; +} + +export interface CallTxDataBase { + to?: string; + value?: number | string | BigNumber; + gas?: number | string | BigNumber; + gasPrice?: number | string | BigNumber; + data?: string; + nonce?: number; +} + +export interface TxData extends CallTxDataBase { + from: string; +} + +export interface CallData extends CallTxDataBase { + from?: string; +} + +export interface FilterObject { + fromBlock?: number | string; + toBlock?: number | string; + address?: string; + topics?: LogTopic[]; +} + +export type LogTopic = null | string | string[]; + +export interface DecodedLogEntry
extends LogEntry { + event: string; + args: A; +} + +export interface DecodedLogEntryEvent extends DecodedLogEntry { + removed: boolean; +} + +export interface LogEntryEvent extends LogEntry { + removed: boolean; +} + +export interface LogEntry { + logIndex: number | null; + transactionIndex: number | null; + transactionHash: string; + blockHash: string | null; + blockNumber: number | null; + address: string; + data: string; + topics: string[]; +} + +export interface TxDataPayable extends TxData { + value?: BigNumber; +} + +export interface TransactionReceipt { + blockHash: string; + blockNumber: number; + transactionHash: string; + transactionIndex: number; + from: string; + to: string; + status: null | string | 0 | 1; + cumulativeGasUsed: number; + gasUsed: number; + contractAddress: string | null; + logs: LogEntry[]; +} + +export type ContractEventArg = string | BigNumber | number | boolean; + +export interface DecodedLogArgs { + [argName: string]: ContractEventArg; +} + +export interface LogWithDecodedArgs extends DecodedLogEntry {} +export type RawLog = LogEntry; + +export enum BlockParamLiteral { + Earliest = 'earliest', + Latest = 'latest', + Pending = 'pending', +} + +export type BlockParam = BlockParamLiteral | number; + +export interface RawLogEntry { + logIndex: string | null; + transactionIndex: string | null; + transactionHash: string; + blockHash: string | null; + blockNumber: string | null; + address: string; + data: string; + topics: string[]; +} + +export enum SolidityTypes { + Address = 'address', + Uint256 = 'uint256', + Uint8 = 'uint8', + Uint = 'uint', +} + +/** + * Contains the logs returned by a TransactionReceipt. We attempt to decode the + * logs using AbiDecoder. If we have the logs corresponding ABI, we decode it, + * otherwise we don't. + */ +export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt { + logs: Array | LogEntry>; +} + +export interface TraceParams { + disableMemory?: boolean; + disableStack?: boolean; + disableStorage?: boolean; +} diff --git a/types/ethereum-protocol/package.json b/types/ethereum-protocol/package.json new file mode 100644 index 0000000000..4eeb6b18c8 --- /dev/null +++ b/types/ethereum-protocol/package.json @@ -0,0 +1,4 @@ +{ + "private": true, + "dependencies": { "bignumber.js": "7.2.1" } +} diff --git a/types/ethereum-protocol/tsconfig.json b/types/ethereum-protocol/tsconfig.json new file mode 100644 index 0000000000..5f358a8dec --- /dev/null +++ b/types/ethereum-protocol/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "ethereum-protocol-tests.ts"] +} diff --git a/types/ethereum-protocol/tslint.json b/types/ethereum-protocol/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ethereum-protocol/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ethereumjs-abi/index.d.ts b/types/ethereumjs-abi/index.d.ts index 4314e46cbd..9208712d59 100644 --- a/types/ethereumjs-abi/index.d.ts +++ b/types/ethereumjs-abi/index.d.ts @@ -8,3 +8,5 @@ export function soliditySHA3(argTypes: string[], args: any[]): Buffer; export function soliditySHA256(argTypes: string[], args: any[]): Buffer; export function methodID(name: string, types: string[]): Buffer; +export function simpleEncode(signature: string, ...args: any[]): Buffer; +export function rawDecode(signature: string[], data: Buffer): any[]; diff --git a/types/ethereumjs-util/index.d.ts b/types/ethereumjs-util/index.d.ts index eb47d3a6a9..c5ae356f5b 100644 --- a/types/ethereumjs-util/index.d.ts +++ b/types/ethereumjs-util/index.d.ts @@ -1,15 +1,15 @@ -// Type definitions for ethereumjs-util 5.1 +// Type definitions for ethereumjs-util 5.2 // Project: https://github.com/ethereumjs/ethereumjs-util#readme // Definitions by: Juan J. Jimenez-Anca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -// TODO: import types for [`BN`](https://github.com/indutny/bn.js) -// TODO: MAX_INTEGER as type of BN // TODO: import types for [`rlp`](https://github.com/ethereumjs/rlp) // TODO: import types for [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node/) +import BN = require("bn.js"); + export const SHA3_NULL_S: string; export const SHA3_RLP_ARRAY_S: string; @@ -18,13 +18,11 @@ export const SHA3_RLP_S: string; export function addHexPrefix(str: string): string; -export function arrayContainsArray(superset: any, subset: any, some: any): any; - -export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[]; +export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[] | null; export function bufferToHex(buf: Buffer | Uint8Array): string; -export function bufferToInt(buf: Buffer | Uint8Array): string; +export function bufferToInt(buf: Buffer | Uint8Array): number; export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any}; @@ -34,14 +32,16 @@ export function ecsign(msgHash: Buffer | Uint8Array, privateKey: Buffer | Uint8A export function fromRpcSig(sig: string): {[k: string]: any}; -export function fromSigned(num: Buffer | Uint8Array): any; +export function fromSigned(num: Buffer | Uint8Array): BN; export function generateAddress(from: Buffer | Uint8Array, nonce: Buffer | Uint8Array): Buffer | Uint8Array; -export function hashPersonalMessage(message: string): Buffer | Uint8Array; +export function hashPersonalMessage(message: Buffer | Uint8Array | any[]): Buffer | Uint8Array; export function importPublic(publicKey: Buffer | Uint8Array): Buffer | Uint8Array; +export function isPrecompiled(address: Buffer | Uint8Array): boolean; + export function isValidAddress(address: string): boolean; export function isValidChecksumAddress(address: Buffer | Uint8Array): boolean; @@ -52,11 +52,17 @@ export function isValidPublic(publicKey: Buffer | Uint8Array, sanitize?: boolean export function isValidSignature(v: Buffer | Uint8Array, r: Buffer | Uint8Array, s: Buffer | Uint8Array, homestead?: boolean): boolean; +export function isZeroAddress(address: string): boolean; + +export function keccak(a: Buffer | Uint8Array | any[] | string | number, bits?: number): Buffer | Uint8Array; + +export function keccak256(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; + export function privateToAddress(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; export function privateToPublic(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize: boolean): Buffer | Uint8Array; +export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize?: boolean): Buffer | Uint8Array; export function ripemd160(a: Buffer | Uint8Array | any[] | string | number, padded: boolean): Buffer | Uint8Array; @@ -76,8 +82,10 @@ export function toChecksumAddress(address: string): string; export function toRpcSig(v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): string; -export function toUnsigned(num: any): Buffer | Uint8Array; +export function toUnsigned(num: BN): Buffer | Uint8Array; export function unpad(a: T): T; export function zeros(bytes: number): Buffer | Uint8Array; + +export function zeroAddress(): string; diff --git a/types/evaporate/index.d.ts b/types/evaporate/index.d.ts index 1c415769b8..8e959f6b64 100644 --- a/types/evaporate/index.d.ts +++ b/types/evaporate/index.d.ts @@ -34,7 +34,7 @@ declare namespace Evaporate { s3Acceleration?: boolean; mockLocalStorage?: boolean; encodeFilename?: boolean; - computeContentMd5?: false; + computeContentMd5?: boolean; allowS3ExistenceOptimization?: boolean; onlyRetryForSameFileName?: boolean; timeUrl?: string; @@ -52,7 +52,7 @@ declare namespace Evaporate { customAuthMethod?: null | (( signParams: string, signHeaders: string, - stringToSign: () => string | undefined, + stringToSign: string, signatureDateTime: string, canonicalRequest: string ) => Promise); diff --git a/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts b/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts new file mode 100644 index 0000000000..c83c4b60d3 --- /dev/null +++ b/types/ex-react-native-i18n/ex-react-native-i18n-tests.ts @@ -0,0 +1,8 @@ +import I18n from 'ex-react-native-i18n'; + +I18n.defaultLocale = 'en'; +I18n.fallbacks = true; +I18n.translations = {}; +I18n.locale = 'zh'; + +const deviceLocale: string = I18n.locale; diff --git a/types/ex-react-native-i18n/index.d.ts b/types/ex-react-native-i18n/index.d.ts new file mode 100644 index 0000000000..0b83b06a68 --- /dev/null +++ b/types/ex-react-native-i18n/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for ex-react-native-i18n 0.0 +// Project: https://github.com/xcarpentier/ex-react-native-i18n/ +// Definitions by: LikKee Richie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// Actual version for ex-react-native-i18n is 0.0.4 but 'npm run lint' doesn't allow patch version to pass +import I18n = require("i18n-js"); +// import I18n from 'ex-react-native-i18n'; + +export default I18n; diff --git a/types/ex-react-native-i18n/tsconfig.json b/types/ex-react-native-i18n/tsconfig.json new file mode 100644 index 0000000000..8e6dd691bf --- /dev/null +++ b/types/ex-react-native-i18n/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ex-react-native-i18n-tests.ts" + ] +} diff --git a/types/ex-react-native-i18n/tslint.json b/types/ex-react-native-i18n/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ex-react-native-i18n/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/exceljs/exceljs-tests.ts b/types/exceljs/exceljs-tests.ts index 684fad8719..0f5504fef0 100644 --- a/types/exceljs/exceljs-tests.ts +++ b/types/exceljs/exceljs-tests.ts @@ -1,7 +1,6 @@ import * as Excel from 'exceljs'; import * as stream from 'stream'; import * as fs from 'fs'; -import * as Bluebird from 'bluebird'; // most examples taken and adapted from README.md @@ -464,4 +463,4 @@ worksheet.commit(); workbook.commit().then(() => null); -Excel.config.setValue('promise', Bluebird); +Excel.config.setValue('promise', Promise); diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 4ad0ce1f3c..4c646da1d9 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -5,7 +5,8 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); - await expect(instance).toDisplayDialog(async () => {}); + const dialog = await expect(instance).toDisplayDialog(async () => {}); + console.log(dialog.message()); await expect(instance).toFill("selector", "value"); await expect(instance).toFill("selector", "value", { polling: 777 }); diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 4d599f99fe..7c216f4259 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -1,12 +1,13 @@ // Type definitions for expect-puppeteer 2.2 // Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer // Definitions by: Josh Goldberg +// Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.8 /// -import { ElementHandle, Page } from "puppeteer"; +import { ElementHandle, Page, Dialog } from "puppeteer"; /** * Interval at which pageFunctions may be executed. @@ -39,7 +40,7 @@ interface ExpectPuppeteer { // These must all match the ExpectPuppeteer interface above. // We can't extend from it directly because some method names conflict in type-incompatible ways. toClick(selector: string, options?: ExpectToClickOptions): Promise; - toDisplayDialog(block: () => Promise): Promise; + toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; @@ -54,7 +55,7 @@ declare global { // These must all match the ExpectPuppeteer interface above. // We can't extend from it directly because some method names conflict in type-incompatible ways. toClick(selector: string, options?: ExpectToClickOptions): Promise; - toDisplayDialog(block: () => Promise): Promise; + toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index d9b7edcb5d..0098a14489 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -25,6 +25,7 @@ import { ImagePicker, ImageManipulator, FaceDetector, + Linking, Svg, IntentLauncherAndroid, KeepAwake, @@ -223,8 +224,8 @@ Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY; Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY; async () => { const result = await Audio.Sound.create({uri: 'uri'}, { - volume: 0.5, - rate: 0.6 + volume: 0.55, + rate: 16.5 }, null, true); const sound = result.sound; @@ -267,8 +268,8 @@ const barcodeReadCallback = () => {}; ); async () => { - await Brightness.setBrightnessAsync(.6); - await Brightness.setSystemBrightnessAsync(.7); + await Brightness.setBrightnessAsync(0.65); + await Brightness.setSystemBrightnessAsync(0.75); const br1 = await Brightness.getBrightnessAsync(); const br2 = await Brightness.getSystemBrightnessAsync(); }; @@ -373,10 +374,13 @@ async () => { }; async () => { - const result = await ImageManipulator.manipulate('url', { - rotate: 90 - }, { - compress: 0.5 + const result = await ImageManipulator.manipulate('url', [ + { rotate: 90 }, + { resize: { width: 300 } }, + { resize: { height: 300 } }, + { resize: { height: 300, width: 300 } }, + ], { + compress: 0.75 }); result.height; @@ -400,6 +404,38 @@ async () => { result.faces[0]; }; +async () => { + function isBoolean(x: boolean) { + } + function isString(x: string) { + } + // Two examples of members inherited from react-native Linking + // to prove that inheritence is working. + Linking.addEventListener('url', (e) => { + e.url === ''; + }); + isBoolean(await Linking.canOpenURL('expo://')); + + // Extensions added by expo. + + isString(Linking.makeUrl('path')); + isString(Linking.makeUrl('path', { q: 2, u: 'ery', })); + + const { + path, + queryParams, + } = Linking.parse(''); + isString(path); + isString(queryParams['x'] || ''); + + const { + path: path2, + queryParams: queryParams2, + } = await Linking.parseInitialURLAsync(); + isString(path2); + isString(queryParams2['y'] || ''); +}; + () => ( { /> + diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index e556e5255a..868afd5e56 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -7,8 +7,11 @@ // Fernando Helwanger // Umidbek Karimov // Moshe Feuchtwanger +// Michael Prokopchuk +// Tina Roh +// Nathan Phillip Brink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; @@ -16,6 +19,7 @@ import { ColorPropType, ImageRequireSource, ImageURISource, + LinkingStatic as ReactNativeLinkingStatic, NativeEventEmitter, ViewProps, ViewStyle, @@ -25,7 +29,6 @@ import { export type Axis = number; export type BarCodeReadCallback = (params: { type: string; data: string; }) => void; -export type FloatFromZeroToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1; export type Md5 = string; export type Orientation = 'portrait' | 'landscape'; export type RequireSource = ImageRequireSource; @@ -35,6 +38,7 @@ export type ResizeModeStretch = 'stretch'; export type URISource = ImageURISource; export interface HashMap { [key: string]: any; } +export interface StringHashMap { [key: string]: string; } /** Access the device accelerometer sensor(s) to respond to changes in acceleration in 3d space. */ export namespace Accelerometer { @@ -548,14 +552,16 @@ export type PlaybackStatus = { export interface PlaybackStatusToSet { androidImplementation?: string; - progressUpdateIntervalMillis?: number; - positionMillis?: number; - shouldPlay?: boolean; - rate?: FloatFromZeroToOne; - shouldCorrectPitch?: boolean; - volume?: FloatFromZeroToOne; - isMuted?: boolean; isLooping?: boolean; + isMuted?: boolean; + positionMillis?: number; + progressUpdateIntervalMillis?: number; + /** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */ + rate?: number; + shouldCorrectPitch?: boolean; + shouldPlay?: boolean; + /** A number between `0.0` (silence) and `1.0` (maximum volume). */ + volume?: number; } export type PlaybackSource = RequireSource | { uri: string } | Asset; @@ -668,7 +674,6 @@ export class PlaybackObject { setRateAsync( /** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */ rate: number, - /** A boolean describing if we should correct the pitch for a changed rate. If set to `true`, the pitch of the audio will be corrected (so a rate different than `1.0` will timestretch the audio). */ shouldCorrectPitch: boolean ): Promise; @@ -730,13 +735,32 @@ export class BlurView extends Component { } // #endregion /** - * Brightness + * An API to get and set screen brightness. */ export namespace Brightness { - function setBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; - function getBrightnessAsync(): Promise; - function getSystemBrightnessAsync(): Promise; - function setSystemBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; + /** Sets screen brightness. */ + function setBrightnessAsync( + /** A number between `0` and `1`, representing the desired screen brightness. */ + brightnessValue: number + ): Promise; + + /** + * Gets screen brightness. + * @returns A Promise that is resolved with a number between `0` and `1`, representing the current screen brightness. + */ + function getBrightnessAsync(): Promise; + + /** + * Gets global system screen brightness. + * @returns A Promise that is resolved with a number between `0` and `1`, representing the current system screen brightness. + */ + function getSystemBrightnessAsync(): Promise; + + /** Sets global system screen brightness, requires `WRITE_SETTINGS` permissions on Android. */ + function setSystemBrightnessAsync( + /** A number between `0` and `1`, representing the desired screen brightness. */ + brightnessValue: number + ): Promise; } // #region Camera @@ -769,30 +793,52 @@ export class CameraObject { } export interface CameraProps extends ViewProps { - zoom?: FloatFromZeroToOne; - ratio?: string; - focusDepth?: FloatFromZeroToOne; - type?: string | number; - onCameraReady?: () => void; - onBarCodeRead?: BarCodeReadCallback; + autoFocus?: string | number | boolean; + barCodeTypes?: Array; + faceDetectionClassifications?: number; + faceDetectionLandmarks?: number; faceDetectionMode?: number; flashMode?: string | number; - barCodeTypes?: Array; - whiteBalance?: string | number; - faceDetectionLandmarks?: number; - autoFocus?: string | number | boolean; - faceDetectionClassifications?: number; - onMountError?: () => void; + /** Distance to plane of sharpest focus. A value between `0` and `1`. `0`: infinity focus, `1`: focus as close as possible. Default: `0`. For Android this is available only for some devices and when `useCamera2Api` is set to `true`. */ + focusDepth?: number; + onBarCodeRead?: BarCodeReadCallback; + onCameraReady?: () => void; onFacesDetected?: (options: { faces: TrackedFaceFeature[] }) => void; + onMountError?: () => void; + ratio?: string; ref?: Ref; + type?: string | number; + whiteBalance?: string | number; + /** A value between `0` and `1` being a percentage of device's max zoom. `0`: not zoomed, `1`: maximum zoom. Default: `0`. */ + zoom?: number; } export interface CameraConstants { - readonly Type: string; - readonly FlashMode: string; - readonly AutoFocus: string; - readonly WhiteBalance: string; - readonly VideoQuality: string; + readonly Type: { + back: string; + front: string; + }; + readonly FlashMode: { + on: string; + off: string; + auto: string; + torch: string; + }; + readonly AutoFocus: { + on: string; + off: string; + }; + readonly WhiteBalance: { + auto: string; + sunny: string; + cloudy: string; + shadow: string; + fluorescent: string; + incandescent: string; + }; + readonly VideoQuality: { + [videoQuality: string]: number; + }; readonly BarCodeType: { aztec: string; codabar: string; @@ -878,7 +924,7 @@ export namespace Constants { }; appKey?: string; androidStatusBar?: { - barStyle?: 'lignt-content' | 'dark-content', + barStyle?: 'light-content' | 'dark-content', backgroundColor?: string }; androidShowExponentNotificationInShellApp?: boolean; @@ -1390,12 +1436,24 @@ export namespace Font { } // #region GLView +export interface ExpoWebGLRenderingContext extends WebGLRenderingContext { + endFrameEXP(): void; +} + /** - * GLView + * A View that acts as an OpenGL ES render target. On mounting, an OpenGL ES + * context is created. Its drawing buffer is presented as the contents of + * the View every frame. */ export interface GLViewProps extends ViewProps { - onContextCreate(): void; - msaaSamples: number; + /** + * A function that will be called when the OpenGL ES context is created. + * Passes an object with a WebGLRenderingContext interface as an argument. + */ + onContextCreate(gl: ExpoWebGLRenderingContext): void; + + /** Number of MSAA samples to use on iOS. Defaults to 4. Ignored on Android. */ + msaaSamples?: number; } export class GLView extends Component { } @@ -1458,6 +1516,27 @@ export namespace Gyroscope { * ImageManipulator */ export namespace ImageManipulator { + type Action = Resize | Rotate | Flip | Crop; + + interface Resize { + resize: { width?: number, height?: number }; + } + + interface Rotate { + rotate: number; + } + + interface Flip { + flip?: { vertical?: boolean; horizontal?: boolean }; + } + + interface Crop { + originX: number; + originY: number; + width: number; + height: number; + } + interface ImageResult { uri: string; width: number; @@ -1467,25 +1546,12 @@ export namespace ImageManipulator { interface SaveOptions { base64?: boolean; - compress?: FloatFromZeroToOne; + /** A value in range `0` - `1` specifying compression level of the result image. `1` means no compression and `0` the highest compression. */ + compress?: number; format?: 'jpeg' | 'png'; } - interface CropParameters { - originX: number; - originY: number; - width: number; - height: number; - } - - interface ImageManipulationOptions { - resize?: { width?: number; height?: number }; - rotate?: number; - flip?: { vertical?: boolean; horizontal?: boolean }; - crop?: CropParameters; - } - - function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise; + function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise; } /** @@ -1649,6 +1715,21 @@ export interface LinearGradientProps { export class LinearGradient extends Component { } // #endregion +/** + * Linking + */ +export interface LinkInfo { + path: string; + queryParams: Partial; +} + +export interface LinkingStatic extends ReactNativeLinkingStatic { + makeUrl(path: string, queryParams?: HashMap): string; + parse(url: string): LinkInfo; + parseInitialURLAsync(): Promise; +} +export const Linking: LinkingStatic; + /** * Location */ @@ -2042,6 +2123,8 @@ export interface SvgUseProps extends SvgCommonProps { href: string; x: number | string; y: number | string; + width?: number | string; + height?: number | string; } export interface SvgSymbolProps extends SvgCommonProps { @@ -2188,6 +2271,7 @@ export interface VideoProps { translateY?: number; rotation?: number; ref?: Ref; + style?: StyleProp; } export interface VideoState { diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 4c33d8b13f..b5c327f6a1 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, Ref } from 'react'; diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 803ecccf32..35d1e9be92 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -6,7 +6,7 @@ // Sergio Sánchez // Fernando Helwanger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts index 0a7093e2b7..766c055911 100644 --- a/types/expo/v25/index.d.ts +++ b/types/expo/v25/index.d.ts @@ -7,7 +7,7 @@ // Fernando Helwanger // Umidbek Karimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; diff --git a/types/expo/v26/index.d.ts b/types/expo/v26/index.d.ts index 4e7a0ebdb3..9804579e66 100644 --- a/types/expo/v26/index.d.ts +++ b/types/expo/v26/index.d.ts @@ -6,8 +6,9 @@ // Sergio Sánchez // Fernando Helwanger // Umidbek Karimov +// Tina Roh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import { EventSubscription } from 'fbemitter'; import { Component, ComponentClass, Ref, ComponentType } from 'react'; @@ -787,11 +788,31 @@ export interface CameraProps extends ViewProps { } export interface CameraConstants { - readonly Type: string; - readonly FlashMode: string; - readonly AutoFocus: string; - readonly WhiteBalance: string; - readonly VideoQuality: string; + readonly Type: { + back: string; + front: string; + }; + readonly FlashMode: { + on: string; + off: string; + auto: string; + torch: string; + }; + readonly AutoFocus: { + on: string; + off: string; + }; + readonly WhiteBalance: { + auto: string; + sunny: string; + cloudy: string; + shadow: string; + fluorescent: string; + incandescent: string; + }; + readonly VideoQuality: { + [videoQuality: string]: number; + }; readonly BarCodeType: { aztec: string; codabar: string; @@ -877,7 +898,7 @@ export namespace Constants { }; appKey?: string; androidStatusBar?: { - barStyle?: 'lignt-content' | 'dark-content', + barStyle?: 'light-content' | 'dark-content', backgroundColor?: string }; androidShowExponentNotificationInShellApp?: boolean; @@ -2181,6 +2202,7 @@ export interface VideoProps { translateY?: number; rotation?: number; ref?: Ref; + style?: StyleProp; } export interface VideoState { diff --git a/types/expo__status-bar-height/expo__status-bar-height-tests.ts b/types/expo__status-bar-height/expo__status-bar-height-tests.ts new file mode 100644 index 0000000000..84dd284d12 --- /dev/null +++ b/types/expo__status-bar-height/expo__status-bar-height-tests.ts @@ -0,0 +1,11 @@ +import StatusBarHeight from '@expo/status-bar-height'; + +const onChangeHeight = (height: number) => console.log(`New height: ${height}`); + +StatusBarHeight.addEventListener(onChangeHeight); + +StatusBarHeight.getAsync() + .then((height: number) => console.log(`Current height: ${height}`)) + .catch((error: Error) => console.error('Threw an error in StatusBarHeight.getAsync():', error)); + +StatusBarHeight.removeEventListener(onChangeHeight); diff --git a/types/expo__status-bar-height/index.d.ts b/types/expo__status-bar-height/index.d.ts new file mode 100644 index 0000000000..24331721da --- /dev/null +++ b/types/expo__status-bar-height/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for @expo/status-bar-height 0.0 +// Project: https://github.com/expo/status-bar-height +// Definitions by: Janeene Beeforth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type StatusBarHeightHandler = (height: number) => void; + +export class StatusBarHeight { + /** + * Get the current status bar height + */ + getAsync(): Promise; + /** + * Add 'willChange' event listener + */ + addEventListener(handler: StatusBarHeightHandler): void; + /** + * Remove 'willChange' event listener + */ + removeEventListener(handler: StatusBarHeightHandler): void; +} + +declare const StatusBarHeightStatic: StatusBarHeight; +export default StatusBarHeightStatic; diff --git a/types/expo__status-bar-height/tsconfig.json b/types/expo__status-bar-height/tsconfig.json new file mode 100644 index 0000000000..88649150a0 --- /dev/null +++ b/types/expo__status-bar-height/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@expo/status-bar-height": [ + "expo__status-bar-height" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expo__status-bar-height-tests.ts" + ] +} diff --git a/types/expo__status-bar-height/tslint.json b/types/expo__status-bar-height/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expo__status-bar-height/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/expo__vector-icons/expo__vector-icons-tests.tsx b/types/expo__vector-icons/expo__vector-icons-tests.tsx index 14ccbc7aa4..7d918c917f 100644 --- a/types/expo__vector-icons/expo__vector-icons-tests.tsx +++ b/types/expo__vector-icons/expo__vector-icons-tests.tsx @@ -41,13 +41,9 @@ class Example extends React.Component { } class TabTest extends React.Component<{}, { selectedTab: string }> { - constructor() { - super({}); - - this.state = { - selectedTab: 'tab1' - }; - } + state = { + selectedTab: 'tab1' + }; render() { return ( diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts index 19aadf2a33..529142c0e9 100644 --- a/types/expo__vector-icons/index.d.ts +++ b/types/expo__vector-icons/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/expo/vector-icons // Definitions by: Hyeonsu Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from 'react'; import { TextProps } from 'react-native'; diff --git a/types/express-brute/index.d.ts b/types/express-brute/index.d.ts index b7961ea597..8f1b6fbf11 100644 --- a/types/express-brute/index.d.ts +++ b/types/express-brute/index.d.ts @@ -67,19 +67,19 @@ declare namespace ExpressBrute { * @summary Allows you to override the value of failCallback for this middleware. * @type {Function} */ - failCallback: Function; + failCallback?: Function; /** * @summary Disregard IP address when matching requests if set to true. Defaults to false. * @type {boolean} */ - ignoreIP: boolean; + ignoreIP?: boolean; /** * @summary Key. * @type {any} */ - key: any; + key?: any; } /** @@ -156,5 +156,13 @@ declare namespace ExpressBrute { reset(key: string, callback: (error: any) => void): void; } } + +declare module "express-serve-static-core" { + export interface Request { + brute?: { + reset?: (callback?: () => void) => void + }; + } +} export = ExpressBrute; diff --git a/types/express-fileupload/index.d.ts b/types/express-fileupload/index.d.ts index 89331c066a..060476b109 100644 --- a/types/express-fileupload/index.d.ts +++ b/types/express-fileupload/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for express-fileupload 0.1 +// Type definitions for express-fileupload 0.4 // Project: https://github.com/richardgirges/express-fileupload#readme // Definitions by: Gintautas Miselis +// Sefa Ilkimen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,13 +29,16 @@ declare namespace fileUpload { encoding: string; mimetype: string; data: Buffer; + truncated: boolean; mv(path: string, callback: (err: any) => void): void; + mv(path: string): Promise; } interface Options { debug?: boolean; safeFileNames?: boolean; preserveExtension?: boolean | string | number; + abortOnLimit?: boolean; [property: string]: any; } } diff --git a/types/express-redis-cache/express-redis-cache-tests.ts b/types/express-redis-cache/express-redis-cache-tests.ts new file mode 100644 index 0000000000..3f8976c812 --- /dev/null +++ b/types/express-redis-cache/express-redis-cache-tests.ts @@ -0,0 +1,105 @@ +import express = require('express'); +import redis = require('redis'); +import expressRedisCache = require('express-redis-cache'); + +const app = express(); +const cache = expressRedisCache(); + +expressRedisCache({ host: 'localhsot', port: 6379, auth_pass: 'passw0rd' }); +expressRedisCache({ client: redis.createClient() }); + +cache.on('error', (error) => { + throw new Error('Cache error!'); +}); + +app.get('/', + cache.route(), // cache entry name is `cache.prefix + "/"` + (req, res, next) => { }); + +app.get('/', + cache.route('home'), // cache entry name is now `cache.prefix + "home"` + (req, res, next) => { }); + +app.get('/', + cache.route({ name: 'home' }), // cache entry name is `cache.prefix + "home"` + (req, res, next) => { }); + +app.get('/user/:userid', + // middleware to define cache name + (req, res, next) => { + // set cache name + res.express_redis_cache_name = 'user-' + req.params.userid; + next(); + }, + // cache middleware + cache.route(), + // content middleware + (req, res) => { + res.render('user'); + } +); + +app.get('/user', + // middleware to decide if using cache + (req, res, next) => { + // Use only cache if user not signed in + res.use_express_redis_cache = !req.signedCookies.user; + next(); + }, + cache.route(), // this will be skipped if user is signed in + (req, res) => { + res.render('user'); + } +); + +// Prefix +expressRedisCache({ prefix: 'test' }); + +// Expiration +expressRedisCache({ expire: 60 }); + +app.get('/index.html', + cache.route({ expire: 5000 }), // cache entry will live 5000 seconds + (req, res) => { } +); + +// You can also use the number sugar syntax +cache.route(5000); +// Or +cache.route('index', 5000); + +app.get('/index.html', + cache.route({ + expire: { + 200: 5000, + '4xx': 10, + 403: 5000, + '5xx': 10, + xxx: 1 + } + }), + (req, res) => { } +); + +cache.get((error, entries) => { + if (error) throw error; + entries.forEach(console.log); +}); + +cache.get('home', (error, entries) => {}); + +cache.add( + 'user:info', + JSON.stringify({ id: 1, email: 'john@doe.com' }), + { expire: 60 * 60 * 24, type: 'json' }, + (error, added) => {} +); + +cache.add( + 'user:info', + JSON.stringify({ id: 1, email: 'john@doe.com' }), + (error, added) => {} +); + +cache.del('home', (error, deleted) => {}); +cache.size((error, bytes) => {}); diff --git a/types/express-redis-cache/index.d.ts b/types/express-redis-cache/index.d.ts new file mode 100644 index 0000000000..ffd8c844a6 --- /dev/null +++ b/types/express-redis-cache/index.d.ts @@ -0,0 +1,77 @@ +// Type definitions for express-redis-cache 1.1 +// Project: https://github.com/rv-kip/express-redis-cache +// Definitions by: AJ Livingston +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import events = require('events'); +import express = require('express'); +import redis = require('redis'); + +declare module 'express-serve-static-core' { + interface Response { + express_redis_cache_name?: string; + use_express_redis_cache?: boolean; + } +} + +declare function expressRedisCache(options?: expressRedisCache.Options): expressRedisCache.ExpressRedisCache; +declare namespace expressRedisCache { + class ExpressRedisCache extends events.EventEmitter { + constructor(options?: Options); + static init(options?: Options): ExpressRedisCache; + readonly FOREVER: number; + options: Options; + host: string; + port: string | number; + prefix: string; + auth_pass: string; + connected: boolean; + expire: number; + client: redis.RedisClient; + add(name: string, body: string, options: AddOptions, callback: (error: any, added: Entry) => void): void; + add(name: string, body: string, callback: (error: any, added: Entry) => void): void; + del(name: string, callback: (error: any, deleted: number) => void): void; + get(name: string, callback: (error: any, entries: Entry[]) => void): void; + get(callback: (error: any, entries: Entry[]) => void): void; + route(nameOrOptions: string | RouteOptions, expire?: ExpireOption): express.RequestHandler; + route(expire?: number): express.RequestHandler; + size(callback: (error: any, bytes: number) => void): void; + } + + interface AddOptions { + type?: string; + expire?: number; + } + + interface Entry { + body: string; + touched: number; + expire: number; + type: string; + } + + interface ExpirationConfig { + [statusCode: string]: number; + } + + type ExpireOption = number | ExpirationConfig; + type ExpirationPolicy = (req: express.Request, res: express.Response) => number; + + interface Options { + auth_pass?: string; + client?: redis.RedisClient; + expire?: number; + host?: string; + port?: string | number; + prefix?: string; + } + + interface RouteOptions { + name?: string; + expire?: ExpireOption | ExpirationPolicy; + binary?: boolean; + } +} + +export = expressRedisCache; diff --git a/types/express-redis-cache/tsconfig.json b/types/express-redis-cache/tsconfig.json new file mode 100644 index 0000000000..7884be049e --- /dev/null +++ b/types/express-redis-cache/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-redis-cache-tests.ts" + ] +} diff --git a/types/express-redis-cache/tslint.json b/types/express-redis-cache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-redis-cache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-socket.io-session/express-socket.io-session-tests.ts b/types/express-socket.io-session/express-socket.io-session-tests.ts index 46dd000882..6937952dd6 100644 --- a/types/express-socket.io-session/express-socket.io-session-tests.ts +++ b/types/express-socket.io-session/express-socket.io-session-tests.ts @@ -26,3 +26,19 @@ io.use(sharedsession(session)); io.use(sharedsession(session, { autoSave: true, saveUninitialized: true })); io.use(sharedsession(session, cookieParser)); io.use(sharedsession(session, cookieParser, { autoSave: true, saveUninitialized: true })); + +io.on('connection', (socket) => { + const sessionID = [ + socket.handshake.sessionID, + socket.handshake.session!.id + ]; + const sessionData = [ + socket.handshake.session!['sessionEntry'], + socket.handshake.session!.anotherSessionEntry + ]; + socket.handshake.session!.touch(() => {}); + socket.handshake.session!.regenerate(() => {}); + socket.handshake.session!.save(() => {}); + socket.handshake.session!.reload(() => {}); + socket.handshake.session!.destroy(() => {}); +}); diff --git a/types/express-socket.io-session/index.d.ts b/types/express-socket.io-session/index.d.ts index 39a1fb4ff6..07acac556a 100644 --- a/types/express-socket.io-session/index.d.ts +++ b/types/express-socket.io-session/index.d.ts @@ -7,6 +7,13 @@ import socketio = require('socket.io'); import express = require('express'); +declare module "socket.io" { + interface Handshake { + session?: Express.Session; + sessionID?: string; + } +} + declare function sharedsession( expressSessionMiddleware: express.RequestHandler, cookieParserMiddleware: express.RequestHandler, diff --git a/types/express-winston/express-winston-tests.ts b/types/express-winston/express-winston-tests.ts index 5671160de0..57b93c14f8 100644 --- a/types/express-winston/express-winston-tests.ts +++ b/types/express-winston/express-winston-tests.ts @@ -23,20 +23,14 @@ app.use(expressWinston.logger({ skip: (req, res) => false, statusLevels: ({ error: 'error', success: 'success', warn: 'warn' }), transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ] })); // Logger with minimum options (transport) app.use(expressWinston.logger({ transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ], })); @@ -55,20 +49,14 @@ app.use(expressWinston.errorLogger({ requestFilter: (req, prop) => true, requestWhitelist: ['foo', 'bar'], transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ] })); // Error Logger with min options (transports) app.use(expressWinston.errorLogger({ transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }) + new winston.transports.Console({}) ], })); diff --git a/types/express-winston/index.d.ts b/types/express-winston/index.d.ts index e6184f64b9..a691000dd8 100644 --- a/types/express-winston/index.d.ts +++ b/types/express-winston/index.d.ts @@ -5,7 +5,8 @@ // TypeScript Version: 2.2 import { ErrorRequestHandler, Handler, Request, Response } from 'express'; -import { TransportInstance, Winston } from 'winston'; +import * as winston from 'winston'; +import * as Transport from 'winston-transport'; export type DynamicMetaFunction = (req: Request, res: Response, err: Error) => object; export type DynamicLevelFunction = (req: Request, res: Response, err: Error) => string; @@ -39,11 +40,11 @@ export interface BaseLoggerOptions { } export interface LoggerOptionsWithTransports extends BaseLoggerOptions { - transports: TransportInstance[]; + transports: Transport[]; } export interface LoggerOptionsWithWinstonInstance extends BaseLoggerOptions { - winstonInstance: Winston; + winstonInstance: typeof winston; } export type LoggerOptions = LoggerOptionsWithTransports | LoggerOptionsWithWinstonInstance; @@ -61,11 +62,11 @@ export interface BaseErrorLoggerOptions { } export interface ErrorLoggerOptionsWithTransports extends BaseErrorLoggerOptions { - transports: TransportInstance[]; + transports: Transport[]; } export interface ErrorLoggerOptionsWithWinstonInstance extends BaseErrorLoggerOptions { - winstonInstance: Winston; + winstonInstance: typeof winston; } export type ErrorLoggerOptions = ErrorLoggerOptionsWithTransports | ErrorLoggerOptionsWithWinstonInstance; diff --git a/types/express-winston/package.json b/types/express-winston/package.json new file mode 100644 index 0000000000..0aa4cf368f --- /dev/null +++ b/types/express-winston/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "winston": "^3.0.0" + } +} diff --git a/types/extsprintf/extsprintf-tests.ts b/types/extsprintf/extsprintf-tests.ts new file mode 100644 index 0000000000..4b45462487 --- /dev/null +++ b/types/extsprintf/extsprintf-tests.ts @@ -0,0 +1,8 @@ +import { sprintf, fprintf, printf } from "extsprintf"; + +fprintf({write: (s: string) => {}}, ''); +fprintf({write: (s: string) => {}}, '', {}, [], null, 0, ''); +printf(''); +printf('', {}, [], null, 0, ''); +sprintf(''); // $ExpectType string +sprintf('', {}, [], null, 0, ''); // $ExpectType string diff --git a/types/extsprintf/index.d.ts b/types/extsprintf/index.d.ts new file mode 100644 index 0000000000..29d073b4c5 --- /dev/null +++ b/types/extsprintf/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for extsprintf 1.4 +// Project: https://github.com/joyent/node-extsprintf#readme +// Definitions by: Alex Hankins +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Stream { + write(str: string): void; +} + +export function fprintf(stream: Stream, format: string, ...args: any[]): any; +export function printf(format: string, ...args: any[]): any; +export function sprintf(format: string, ...args: any[]): string; diff --git a/types/extsprintf/tsconfig.json b/types/extsprintf/tsconfig.json new file mode 100644 index 0000000000..bc9783f347 --- /dev/null +++ b/types/extsprintf/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "extsprintf-tests.ts" + ] +} diff --git a/types/extsprintf/tslint.json b/types/extsprintf/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extsprintf/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 07c1227706..e5cbfc2432 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -851,6 +851,12 @@ interface IStaticCanvasOptions { * Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas */ allowTouchScrolling?: boolean; + + /** + * When true, canvas is scaled by devicePixelRatio for better rendering on retina screens + */ + enableRetinaScaling?: boolean; + /** * Indicates whether this canvas will use image smoothing, this is on by default in browsers */ @@ -1644,11 +1650,6 @@ export class Group { * @chainable */ destroy(): Group; - /** - * Returns requested property - * @param prop Property to get - */ - get(prop: string): any; /** * Checks whether this group was moved (since `saveCoords` was called last) * @return true if an object was moved (since fabric.Group#saveCoords was called) @@ -1867,7 +1868,7 @@ export class Image { * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param [imgOptions] Options object */ - static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image; + static fromURL(url: string, callback?: (image: Image) => void, imgOptions?: IImageOptions): Image; /** * Creates an instance of fabric.Image from its object representation * @param object Object to create an instance from @@ -2678,9 +2679,11 @@ export class Object { setCoords(): this; /** * Returns coordinates of object's bounding rectangle (left, top, width, height) + * @param absoluteopt use coordinates without viewportTransform + * @param calculateopt use coordinates of current position instead of .oCoords / .aCoords * @return Object with left, top, width, height properties */ - getBoundingRect(): { left: number; top: number; width: number; height: number }; + getBoundingRect(absoluteopt?: boolean, calculateopt?: boolean): { left: number; top: number; width: number; height: number }; /** * Checks if object is fully contained within area of another object * @param other Object to test diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index 9652dbb86f..6b400a10a7 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -8,25 +8,22 @@ FB.init({ xfbml: true }); -FB.getLoginStatus(function(response: fb.AuthResponse) { +FB.getLoginStatus(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); console.log(response.authResponse.accessToken); }); -FB.getLoginStatus(function(response: fb.AuthResponse) { +FB.getLoginStatus(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); console.log(response.authResponse.accessToken); }, true); -FB.getAuthResponse(function(response: fb.AuthResponse) { - console.log(response); - console.log(response.status); - console.log(response.authResponse.accessToken); -}); +const authResponse: fb.AuthResponse = FB.getAuthResponse(); +console.log(authResponse.accessToken); -FB.login(function(response: fb.AuthResponse) { +FB.login(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); console.log(response.authResponse.accessToken); @@ -34,7 +31,7 @@ FB.login(function(response: fb.AuthResponse) { scope: 'public_profile' }); -FB.logout(function(response: fb.AuthResponse) { +FB.logout(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); console.log(response.authResponse.accessToken); diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index be9f71f6c9..8a635d8995 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -1,12 +1,14 @@ // Type definitions for the Facebook Javascript SDK 2.8 // Project: https://developers.facebook.com/docs/javascript -// Definitions by: Amrit Kahlon +// Definitions by: Amrit Kahlon +// Mahmoud Zohdi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import fb = facebook; declare var FB: fb.FacebookStatic; declare namespace facebook { - + + interface FacebookStatic { api: any; AppEvents: any; @@ -18,15 +20,17 @@ declare namespace facebook { * The synchronous nature of this method is what sets it apart from the other login methods. * * @param callback function to handle the response. + * + * This method is similar in nature to FB.getLoginStatus(), but it returns just the authResponse object. */ - getAuthResponse(callback: (response: AuthResponse) => void): void; + getAuthResponse(): AuthResponse; /** * FB.getLoginStatus() allows you to determine if a user is * logged in to Facebook and has authenticated your app. * * @param callback function to handle the response. */ - getLoginStatus(callback: (response: AuthResponse) => void, roundtrip?: boolean ): void; + getLoginStatus(callback: (response: StatusResponse) => void, roundtrip?: boolean ): void; /** * The method FB.init() is used to initialize and setup the SDK. * @@ -43,13 +47,13 @@ declare namespace facebook { * @param callback function to handle the response. * @param options optional ILoginOption to add params such as scope. */ - login(callback: (response: AuthResponse) => void, options?: LoginOptions): void; + login(callback: (response: StatusResponse) => void, options?: LoginOptions): void; /** * The method FB.logout() logs the user out of your site and, in some cases, Facebook. * * @param callback function to handle the response */ - logout(callback: (response: AuthResponse) => void): void; + logout(callback: (response: StatusResponse) => void): void; /** * @see https://developers.facebook.com/docs/sharing/reference/share-dialog @@ -180,16 +184,17 @@ declare namespace facebook { // RESPONSES // //////////////////////// - interface AuthResponse { + accessToken: string; + expiresIn: number; + signedRequest: string; + userID: string; + grantedScopes?: string; + } + + interface StatusResponse { status: string; - authResponse: { - accessToken: string; - expiresIn: number; - grantedScopes: string; - signedRequest: string; - userID: string; - }; + authResponse: AuthResponse; } interface ShareDialogResponse { diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index 552e7d3eeb..248a0ba96c 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -11,7 +11,8 @@ declare const fakerStatic: Faker.FakerStatic; declare namespace Faker { interface FakerStatic { locale: string; - + setLocale(locale: string): void; + address: { zipCode(format?: string): string; city(format?: number): string; diff --git a/types/feathersjs__authentication-client/index.d.ts b/types/feathersjs__authentication-client/index.d.ts index 9d1972bebc..6594fb7e95 100644 --- a/types/feathersjs__authentication-client/index.d.ts +++ b/types/feathersjs__authentication-client/index.d.ts @@ -53,7 +53,7 @@ export interface Passport { getJWT(): Promise; - verifyJWT(token: string): Promise; + verifyJWT(token: string): Promise; payloadIsValid(payload: string): boolean; diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts index ab6a7f6dbe..7a555071d9 100644 --- a/types/feathersjs__authentication-jwt/index.d.ts +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -8,7 +8,7 @@ import { Application } from '@feathersjs/feathers'; import { Request } from 'express'; import * as self from '@feathersjs/authentication-jwt'; -declare const feathersAuthenticationJwt: ((options?: FeathersAuthenticationJWTOptions) => () => void) & typeof self; +declare const feathersAuthenticationJwt: ((options?: Partial) => () => void) & typeof self; export default feathersAuthenticationJwt; export interface FeathersAuthenticationJWTOptions { @@ -43,10 +43,10 @@ export interface FeathersAuthenticationJWTOptions { /** * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. */ - Verifier: JWTVerifier; + Verifier: typeof Verifier; } -export class JWTVerifier { +export class Verifier { constructor(app: Application, options: any); // the class constructor verify(req: Request, payload: any, done: (error: any, user?: any, info?: any) => void): void; diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index b3a0f60667..1e448dbf4f 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -14,6 +14,7 @@ declare const feathers: (() => Application) & typeof self; export default feathers; export const version: string; +export const SKIP: SkipSymbol; export type Id = number | string; export type NullableId = Id | null; @@ -45,7 +46,9 @@ export interface Paginated { } // tslint:disable-next-line void-return -export type Hook = (hook: HookContext) => (Promise | void); +export type Hook = (hook: HookContext) => (Promise | HookContext | SkipSymbol | void); + +export type SkipSymbol = symbol | '__feathersSkipHooks'; export interface HookContext { app?: Application; diff --git a/types/ffi-napi/ffi-napi-tests.ts b/types/ffi-napi/ffi-napi-tests.ts new file mode 100644 index 0000000000..5965e23e12 --- /dev/null +++ b/types/ffi-napi/ffi-napi-tests.ts @@ -0,0 +1,106 @@ +import ffi = require('ffi-napi'); +import ref = require('ref-napi'); +import Struct = require('ref-struct-di'); +import Union = require('ref-union-di'); +import TArray = require('ref-array-di'); + +{ + const sqlite3 = ref.types.void; + const sqlite3Ptr = ref.refType(sqlite3); + const sqlite3PtrPtr = ref.refType(sqlite3Ptr); + const stringPtr = ref.refType(ref.types.CString); + + const libsqlite3 = ffi.Library('libsqlite3', { + sqlite3_open: [ 'int', [ 'string', sqlite3PtrPtr ] ], + sqlite3_close: [ 'int', [ sqlite3PtrPtr ] ], + sqlite3_exec: [ 'int', [ sqlite3PtrPtr, 'string', 'pointer', 'pointer', stringPtr ] ], + sqlite3_changes: [ 'int', [ sqlite3PtrPtr ]] + }); + + const dbPtrPtr = ref.alloc(sqlite3PtrPtr); + libsqlite3.sqlite3_open("test.sqlite3", dbPtrPtr); +} +{ + const func = ffi.ForeignFunction(new Buffer(10), 'int', [ 'int' ]); + func(-5); + func.async(-5, (err: any, res: any) => {}); +} +{ + const funcPtr = ffi.Callback('int', [ 'int' ], Math.abs); + const func = ffi.ForeignFunction(funcPtr, 'int', [ 'int' ]); +} +{ + const printfPointer = ffi.DynamicLibrary().get('printf'); + const printfGen = ffi.VariadicForeignFunction(printfPointer, 'void', [ 'string' ]); + printfGen()('Hello World!\n'); + printfGen('int')('This is an int: %d\n', 10); + printfGen('string')('This is a string: %s\n', 'hello'); +} +{ + ref.address(new Buffer(1)); + const intBuf = ref.alloc(ref.types.int); + const intWith4 = ref.alloc(ref.types.int, 4); + const buf0 = ref.allocCString('hello world'); + const type = ref.coerceType('int **'); + const val = ref.deref(intBuf); +} +{ + ref.isNull(new Buffer(1)); +} +{ + const str = ref.readCString(new Buffer('hello\0world\0'), 0); + const buf = ref.alloc('int64'); + ref.writeInt64BE(buf, 0, '9223372036854775807'); + const val = ref.readInt64BE(buf, 0); +} +{ + const voidPtrType = ref.refType(ref.types.void); + const buf = ref.alloc('int64'); + ref.writeInt64LE(buf, 0, '9223372036854775807'); +} +{ + const S1 = Struct({ a: ref.types.int }); + const S2 = new Struct({ a: 'int' }); +} +{ + const P = new Struct(); + P.defineProperty('a', ref.types.int); + P.defineProperty('d', 'long'); +} +{ + const SimpleStruct = Struct({ + first : ref.types.byte, + last : ref.types.byte + }); + + const ss = new SimpleStruct({ first: 50, last: 100 }); + ss.first += 200; +} +{ + const ST = Struct(); + const test: ref.Type = ST.fields['t'].type; +} +{ + const CharArray = TArray('char'); + const b = new Buffer('hello', 'ascii'); + const a = new CharArray(b); +} +{ + const Int32Array = TArray(ref.types.int32); + const input = [1, 4, 91, 123123, 5123512, 0, -1]; + const a = new Int32Array(input); +} +{ + const int = ref.types.int; + const IntArray = TArray(int); + + const buf = new Buffer(int.size * 3); + int.set(buf, int.size * 0, 5); + int.set(buf, int.size * 1, 8); + int.set(buf, int.size * 2, 0); + + const array = IntArray.untilZeros(buf); +} +{ + const refCharArr = TArray('char')([1, 3, 5], 2).ref(); +} diff --git a/types/ffi-napi/index.d.ts b/types/ffi-napi/index.d.ts new file mode 100644 index 0000000000..6cfd439e13 --- /dev/null +++ b/types/ffi-napi/index.d.ts @@ -0,0 +1,186 @@ +// Type definitions for node-ffi-napi 2.4 +// Project: https://github.com/node-ffi/node-ffi +// Definitions by: Keerthi Niranjan , Kiran Niranjan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + + +import ref = require('ref-napi'); +import StructType = require('ref-struct-di'); + +/** Provides a friendly API on-top of `DynamicLibrary` and `ForeignFunction`. */ +export interface Library { + /** The extension to use on libraries. */ + EXT: string; + + /** + * @param libFile name of library + * @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}] + * @param lib hash that will be extended + */ + new (libFile: string, funcs?: {[key: string]: any[]}, lib?: object): any; + + /** + * @param libFile name of library + * @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}] + * @param lib hash that will be extended + */ + (libFile: string, funcs?: {[key: string]: any[]}, lib?: object): any; +} +export const Library: Library; + +/** Get value of errno. */ +export function errno(): number; + +export interface Function extends ref.Type { + /** The type of return value. */ + retType: ref.Type; + /** The type of arguments. */ + argTypes: ref.Type[]; + /** Is set for node-ffi functions. */ + ffi_type: Buffer; + abi: number; + + /** Get a `Callback` pointer of this function type. */ + toPointer(fn: (...args: any[]) => any): Buffer; + /** Get a `ForeignFunction` of this function type. */ + toFunction(buf: Buffer): ForeignFunction; +} + +/** Creates and returns a type for a C function pointer. */ +export const Function: { + new (retType: ref.Type | string, argTypes: any[], abi?: number): Function; + (retType: ref.Type | string, argTypes: any[], abi?: number): Function; +}; + +export interface ForeignFunction { + (...args: any[]): any; + async(...args: any[]): void; +} + +/** + * Represents a foreign function in another library. Manages all of the aspects + * of function execution, including marshalling the data parameters for the + * function into native types and also unmarshalling the return from function + * execution. + */ +export const ForeignFunction: { + new (ptr: Buffer, retType: ref.Type | string, argTypes: any[], abi?: number): ForeignFunction; + (ptr: Buffer, retType: ref.Type | string, argTypes: any[], abi?: number): ForeignFunction; +}; + +export interface VariadicForeignFunction { + /** + * What gets returned is another function that needs to be invoked with the rest + * of the variadic types that are being invoked from the function. + */ + (...args: any[]): ForeignFunction; + + /** + * Return type as a property of the function generator to + * allow for monkey patching the return value in the very rare case where the + * return type is variadic as well + */ + returnType: any; +} + +/** + * For when you want to call to a C function with variable amount of arguments. + * i.e. `printf`. + * + * This function takes care of caching and reusing `ForeignFunction` instances that + * contain the same ffi_type argument signature. + */ +export const VariadicForeignFunction: { + new (ptr: Buffer, ret: ref.Type | string, fixedArgs: any[], abi?: number): VariadicForeignFunction; + (ptr: Buffer, ret: ref.Type | string, fixedArgs: any[], abi?: number): VariadicForeignFunction; +}; + +export interface DynamicLibrary { + /** Close library, returns the result of the `dlclose` system function. */ + close(): number; + /** Get a symbol from this library. */ + get(symbol: string): Buffer; + /** Get the result of the `dlerror` system function. */ + error(): string; +} + +/** + * This class loads and fetches function pointers for dynamic libraries + * (.so, .dylib, etc). After the libray's function pointer is acquired, then you + * call `get(symbol)` to retreive a pointer to an exported symbol. You need to + * call `get___` on the pointer to dereference it into its actual value, or + * turn the pointer into a callable function with `ForeignFunction`. + */ +export const DynamicLibrary: { + FLAGS: { + RTLD_LAZY: number; + RTLD_NOW: number; + RTLD_LOCAL: number; + RTLD_GLOBAL: number; + RTLD_NOLOAD: number; + RTLD_NODELETE: number; + RTLD_NEXT: Buffer; + RTLD_DEFAUL: Buffer; + } + + new (path?: string, mode?: number): DynamicLibrary; + (path?: string, mode?: number): DynamicLibrary; +}; + +/** + * Turns a JavaScript function into a C function pointer. + * The function pointer may be used in other C functions that + * accept C callback functions. + */ +export interface Callback { + new (retType: any, argTypes: any[], abi: number, fn: any): Buffer; + new (retType: any, argTypes: any[], fn: any): Buffer; + (retType: any, argTypes: any[], abi: number, fn: any): Buffer; + (retType: any, argTypes: any[], fn: any): Buffer; +} +export const Callback: Callback; + +export const ffiType: { + /** Get a `ffi_type *` Buffer appropriate for the given type. */ + (type: ref.Type | string): Buffer + FFI_TYPE: StructType; +}; + +export function CIF(retType: any, types: any[], abi?: any): Buffer; +export function CIF_var(retType: any, types: any[], numFixedArgs: number, abi?: any): Buffer; +export const HAS_OBJC: boolean; +export const FFI_TYPES: {[key: string]: Buffer}; +export const FFI_OK: number; +export const FFI_BAD_TYPEDEF: number; +export const FFI_BAD_ABI: number; +export const FFI_DEFAULT_ABI: number; +export const FFI_FIRST_ABI: number; +export const FFI_LAST_ABI: number; +export const FFI_SYSV: number; +export const FFI_UNIX64: number; +export const RTLD_LAZY: number; +export const RTLD_NOW: number; +export const RTLD_LOCAL: number; +export const RTLD_GLOBAL: number; +export const RTLD_NOLOAD: number; +export const RTLD_NODELETE: number; +export const RTLD_NEXT: Buffer; +export const RTLD_DEFAULT: Buffer; +export const LIB_EXT: string; +export const FFI_TYPE: StructType; + +/** Default types. */ +export const types: { + void: ref.Type; int64: ref.Type; ushort: ref.Type; + int: ref.Type; uint64: ref.Type; float: ref.Type; + uint: ref.Type; long: ref.Type; double: ref.Type; + int8: ref.Type; ulong: ref.Type; Object: ref.Type; + uint8: ref.Type; longlong: ref.Type; CString: ref.Type; + int16: ref.Type; ulonglong: ref.Type; bool: ref.Type; + uint16: ref.Type; char: ref.Type; byte: ref.Type; + int32: ref.Type; uchar: ref.Type; size_t: ref.Type; + uint32: ref.Type; short: ref.Type; +}; diff --git a/types/ffi-napi/node-ffi-napi-buffer.d.ts b/types/ffi-napi/node-ffi-napi-buffer.d.ts new file mode 100644 index 0000000000..fa817e1662 --- /dev/null +++ b/types/ffi-napi/node-ffi-napi-buffer.d.ts @@ -0,0 +1,50 @@ +// DefinitelyTyped: partial + +interface Buffer { + /** Shorthand for `ref.address`. */ + address(): number; + /** Shorthand for `ref.deref`. */ + deref(): any; + /** Shorthand for `ref.isNull`. */ + isNull(): boolean; + /** Shorthand for `ref.readCString`. */ + readCString(offset?: number): string; + /** Shorthand for `ref.readInt64BE`. */ + readInt64BE(offset?: number): string; + /** Shorthand for `ref.readInt64LE`. */ + readInt64LE(offset?: number): string; + /** Shorthand for `ref.readObject`. */ + readObject(offset?: number): string; + /** Shorthand for `ref.readPointer`. */ + readPointer(offset?: number): string; + /** Shorthand for `ref.readUInt64BE`. */ + readUInt64BE(offset?: number): string; + /** Shorthand for `ref.readUInt64LE`. */ + readUInt64LE(offset?: number): string; + /** Shorthand for `ref.ref`. */ + ref(): Buffer; + /** Shorthand for `ref.reinterpret`. */ + reinterpret(size: number, offset?: number): Buffer; + /** Shorthand for `ref.reinterpretUntilZeros`. */ + reinterpretUntilZeros(size: number, offset?: number): Buffer; + /** Shorthand for `ref.writeCString`. */ + writeCString(offset: number, input: string, encoding?: string): void; + /** Shorthand for `ref.writeInt64BE`. */ + writeInt64BE(offset: number, input: number | string): any; + /** Shorthand for `ref.writeInt64LE`. */ + writeInt64LE(offset: number, input: number | string): any; + /** Shorthand for `ref.writeObject`. */ + writeObject(offset: number, object: object): void; + /** Shorthand for `ref.writePointer`. */ + writePointer(offset: number, pointer: Buffer): void; + /** Shorthand for `ref.writeUInt64BE`. */ + writeUInt64BE(offset: number, input: number | string): any; + /** Shorthand for `ref.writeUInt64LE`. */ + writeUInt64LE(offset: number, input: number | string): any; + + /** + * Generate string for inspecting. + * String includes the hex-encoded memory address of the Buffer instance. + */ + inspect(): string; +} diff --git a/types/ffi-napi/tsconfig.json b/types/ffi-napi/tsconfig.json new file mode 100644 index 0000000000..c914c55679 --- /dev/null +++ b/types/ffi-napi/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-ffi-napi-buffer.d.ts", + "ffi-napi-tests.ts" + ] +} diff --git a/types/ffi-napi/tslint.json b/types/ffi-napi/tslint.json new file mode 100644 index 0000000000..c5fa24ca82 --- /dev/null +++ b/types/ffi-napi/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + + "rules": { + "no-consecutive-blank-lines": [true, 3], + "ban-types": [false] + } +} diff --git a/types/ffi/index.d.ts b/types/ffi/index.d.ts index 76e197e841..cf562cea06 100644 --- a/types/ffi/index.d.ts +++ b/types/ffi/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for node-ffi 0.1 +// Type definitions for node-ffi 0.2 // Project: https://github.com/rbranson/node-ffi -// Definitions by: Paul Loyd +// Definitions by: Paul Loyd , Waiting Song // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -135,12 +135,13 @@ export const DynamicLibrary: { * The function pointer may be used in other C functions that * accept C callback functions. */ -export const Callback: { +export interface Callback { new (retType: any, argTypes: any[], abi: number, fn: any): Buffer; new (retType: any, argTypes: any[], fn: any): Buffer; (retType: any, argTypes: any[], abi: number, fn: any): Buffer; (retType: any, argTypes: any[], fn: any): Buffer; -}; +} +export const Callback: Callback; export const ffiType: { /** Get a `ffi_type *` Buffer appropriate for the given type. */ diff --git a/types/fibjs/UNUSED_FILES.txt b/types/fibjs/UNUSED_FILES.txt new file mode 100644 index 0000000000..2a6c4b5a1c --- /dev/null +++ b/types/fibjs/UNUSED_FILES.txt @@ -0,0 +1 @@ +declare/_test_env.d.ts \ No newline at end of file diff --git a/types/fibjs/declare/Buffer.d.ts b/types/fibjs/declare/Buffer.d.ts new file mode 100644 index 0000000000..867283e703 --- /dev/null +++ b/types/fibjs/declare/Buffer.d.ts @@ -0,0 +1,1131 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 二进制数据缓存对象,用于 io 读写的数据处理 + * @detail Buffer 对象为全局基础类,在任何时候都可以直接以 new Buffer(...) 创建:,```JavaScript,var buf = new Buffer();,``` + */ + +declare class Class_Buffer extends Class__object { + + /** + * class prop + * + * + * @brief 获取缓存对象的尺寸 + * + * @readonly + * @type Integer + */ + + length: number + + + + /** + * + * @brief 缓存对象构造函数 + * @param datas 初始化数据数组 + * + * + * + */ + constructor(datas: any[]); + + /** + * + * @brief 缓存对象构造函数 + * @param datas 初始化数据数组 + * + * + * + */ + constructor(datas: ArrayBuffer); + + /** + * + * @brief 缓存对象构造函数 + * @param datas 初始化数据数组 + * + * + * + */ + constructor(datas: ArrayLike); + + /** + * + * @brief 缓存对象构造函数 + * @param datas 初始化数据数组 + * + * + * + */ + constructor(datas: ArrayBufferView); + + /** + * + * @brief 缓存对象构造函数 + * @param buffer 初始化Buffer对象 + * + * + * + */ + constructor(buffer: Class_Buffer); + + /** + * + * @brief 缓存对象构造函数 + * @param str 初始化字符串,字符串将以 utf-8 格式写入,缺省则创建一个空对象 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * + * + * + */ + constructor(str: string, codec?: string/** = "utf8"*/); + + /** + * + * @brief 缓存对象构造函数 + * @param size 初始化缓冲区大小 + * + * + * + */ + constructor(size?: number/** = 0*/); + + /** + * + * @brief 检测给定的变量是否是 Buffer 对象 + * @param v 给定需要检测的变量 + * @return 传入对象是否 Buffer 对象 + * + * + * + */ + static isBuffer(v: any): boolean; + + /** + * + * @brief 通过其他 Buffer 创建 Buffer 对象 + * @param buffer 给定 Buffer 类型变量用于创建 Buffer 对象 + * @param byteOffset 指定数据起始位置,起始为 0 + * @param length 指定数据长度,起始位 -1,表示剩余所有数据 + * @return 返回 Buffer 实例 + * + * + * + */ + static from(buffer: Class_Buffer, byteOffset?: number/** = 0*/, length?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 通过字符串创建 Buffer 对象 + * @param str 初始化字符串,字符串将以 utf-8 格式写入 + * @param byteOffset 指定数据起始位置,起始为 0 + * @param length 指定数据长度,起始位 -1,表示剩余所有数据 + * @return 返回 Buffer 实例 + * + * + * + */ + static from(str: string, byteOffset?: number/** = 0*/, length?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 通过字符串创建 Buffer 对象 + * @param str 初始化字符串,字符串将以 utf-8 格式写入,缺省则创建一个空对象 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回 Buffer 实例 + * + * + * + */ + static from(str: string, codec?: string/** = "utf8"*/): Class_Buffer; + + /** + * + * @brief 拼接多个缓存区中的数据 + * @param buflist 待拼接的Buffer数组 + * @param cutLength 截取多少个Buffer对象 + * @return 拼接后产生的新 Buffer 对象 + * + * + * + */ + static concat(buflist: any[], cutLength?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 分配一个指定长度的新缓存区。如果大小为0,将创建一个零长度的缓存区。 + * @param size 缓冲区的所需长度 + * @param fill 预先填充新缓冲区的值,可使用 string/buffer/integer 值类型。 默认值:0 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 填充好的新 Buffer 对象 + * + * + * + */ + static alloc(size: number, fill?: number/** = 0*/, codec?: string/** = "utf8"*/): Class_Buffer; + + /** + * + * @brief 分配一个指定长度的新缓存区。如果大小为0,将创建一个零长度的缓存区。 + * @param size 缓冲区的所需长度 + * @param fill 预先填充新缓冲区的值,可使用 string/buffer/integer 值类型。 默认值:0 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 填充好的新 Buffer 对象 + * + * + * + */ + static alloc(size: number, fill?: string/** = ""*/, codec?: string/** = "utf8"*/): Class_Buffer; + + /** + * + * @brief 分配一个指定长度的新缓存区。如果大小为0,将创建一个零长度的缓存区。 + * @param size 缓冲区的所需长度 + * @param fill 预先填充新缓冲区的值,可使用 string/buffer/integer 值类型。 默认值:0 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 填充好的新 Buffer 对象 + * + * + * + */ + static alloc(size: number, fill: Class_Buffer, codec?: string/** = "utf8"*/): Class_Buffer; + + /** + * + * @brief 分配一个指定长度的新缓存区。如果大小为0,将创建一个零长度的缓存区。 + * @param size 缓冲区的所需长度 + * @return 指定尺寸的新 Buffer 对象 + * + * + * + */ + static allocUnsafe(size: number): Class_Buffer; + + /** + * + * @brief 分配一个指定长度的新缓存区。如果大小为0,将创建一个零长度的缓存区。 + * @param size 缓冲区的所需长度 + * @return 指定尺寸的新 Buffer 对象 + * + * + * + */ + static allocUnsafeSlow(size: number): Class_Buffer; + + /** + * + * @brief 返回字符串的实际字节长度 + * @param str 待取字节的字符串,如果str为 ArrayBuffer/TypedArray/DataView/Buffer 对象,则返回它们的实际长度 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回实际字节长度 + * + * + * + */ + static byteLength(str: string, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 返回字符串的实际字节长度 + * @param str 待取字节的字符串,如果str为 ArrayBuffer/TypedArray/DataView/Buffer 对象,则返回它们的实际长度 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回实际字节长度 + * + * + * + */ + static byteLength(str: ArrayBuffer, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 返回字符串的实际字节长度 + * @param str 待取字节的字符串,如果 str 为 ArrayBuffer/TypedArray/DataView/Buffer 对象,则返回它们的实际长度 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回实际字节长度 + * + * + * + */ + static byteLength(str: ArrayBufferView, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 返回字符串的实际字节长度 + * @param str 待取字节的字符串,如果str为 ArrayBuffer/TypedArray/DataView/Buffer 对象,则返回它们的实际长度 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回实际字节长度 + * + * + * + */ + static byteLength(str: Class_Buffer, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 检测编码格式是否被支持 + * @param codec 待检测的编码格式 + * @return 是否支持 + * + * + * + */ + static isEncoding(codec: string): boolean; + + /** + * + * @brief 修改缓存对象尺寸 + * @param sz 指定新尺寸 + * + * + * + */ + resize(sz: number): void; + + /** + * + * @brief 在缓存对象尾部写入一组二进制数据 + * @param data 初始化二进制数据 + * + * + * + */ + append(data: Class_Buffer): void; + + /** + * + * @brief 在缓存对象尾部写入字符串,字符串将以 utf-8 格式写入 + * @param str 要写入的字符串 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * + * + * + */ + append(str: string, codec?: string/** = "utf8"*/): void; + + /** + * + * @brief 向缓存对象写入指定字符串,字符串默认为utf-8,越界时只写入部分数据 + * @param str 待写入的字符串 + * @param offset 写入起始位置 + * @param length 写入长度(单位字节,默认值-1),未指定时为待写入字符串的长度 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 写入的数据字节长度 + * + * + * + */ + write(str: string, offset?: number/** = 0*/, length?: number/** = -1*/, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 向缓存对象写入指定字符串,字符串默认为utf-8,越界时只写入部分数据 + * @param str 待写入的字符串 + * @param offset 写入起始位置 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 写入的数据字节长度 + * + * + * + */ + write(str: string, offset?: number/** = 0*/, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 向缓存对象写入指定字符串,字符串默认为utf-8,越界时只写入部分数据 + * @param str 待写入的字符串 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @return 写入的数据字节长度 + * + * + * + */ + write(str: string, codec?: string/** = "utf8"*/): number; + + /** + * + * @brief 为 Buffer 对象填充指定内容数据 + * @param v 需要填充的数据,如果未指定 offset 和 end,将填充满整个 buffer + * @param offset 填充起始位置 + * @param end 填充终止位置 + * @return 返回当前 Buffer 对象 + * + * + * + */ + fill(v: number, offset?: number/** = 0*/, end?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 为 Buffer 对象填充指定内容数据 + * @param v 需要填充的数据,如果未指定 offset 和 end,将填充满整个 buffer + * @param offset 填充起始位置 + * @param end 填充终止位置 + * @return 返回当前 Buffer 对象 + * + * + * + */ + fill(v: Class_Buffer, offset?: number/** = 0*/, end?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 为 Buffer 对象填充指定内容数据 + * @param v 需要填充的数据,如果未指定 offset 和 end,将填充满整个 buffer + * @param offset 填充起始位置 + * @param end 填充终止位置 + * @return 返回当前 Buffer 对象 + * + * + * + */ + fill(v: string, offset?: number/** = 0*/, end?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 返回某个指定数据在 Buffer 中首次出现的位置 + * @param v 待查找数据,如果未指定 offset,默认从起始位开始 + * @param offset 起始查找位置 + * @return 返回查找到的位置,未找到返回 -1 + * + * + * + */ + indexOf(v: number, offset?: number/** = 0*/): number; + + /** + * + * @brief 返回某个指定数据在 Buffer 中首次出现的位置 + * @param v 待查找数据,如果未指定 offset,默认从起始位开始 + * @param offset 起始查找位置 + * @return 返回查找到的位置,未找到返回 -1 + * + * + * + */ + indexOf(v: Class_Buffer, offset?: number/** = 0*/): number; + + /** + * + * @brief 返回某个指定数据在 Buffer 中首次出现的位置 + * @param v 待查找数据,如果未指定 offset,默认从起始位开始 + * @param offset 起始查找位置 + * @return 返回查找到的位置,未找到返回 -1 + * + * + * + */ + indexOf(v: string, offset?: number/** = 0*/): number; + + /** + * + * @brief 比较缓存区的内容 + * @param buf 待比较缓存对象 + * @return 内容比较结果 + * + * + * + */ + compare(buf: Class_Buffer): number; + + /** + * + * @brief 从源缓存对象区域拷贝数据到目标缓存对象区域 + * @param targetBuffer 目标缓存对象 + * @param targetStart 目标缓存对象开始拷贝字节位置,缺省为 0 + * @param sourceStart 源缓存对象开始字节位置, 缺省为 0 + * @param sourceEnd 源缓存对象结束字节位置, 缺省为 -1,表示源数据长度 + * @return 拷贝的数据字节长度 + * + * + * + */ + copy(targetBuffer: Class_Buffer, targetStart?: number/** = 0*/, sourceStart?: number/** = 0*/, sourceEnd?: number/** = -1*/): number; + + /** + * + * @brief 从缓存对象读取一个 8 位无符号整型数值 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUInt8(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 16 位无符号整型数值,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUInt16LE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 16 位无符号整型数值,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUInt16BE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 32 位无符号整型数值,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUInt32LE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 32 位无符号整型数值,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUInt32BE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个无符号整型数值,最大支持 48 位,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUIntLE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个无符号整型数值,最大支持 48 位,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readUIntBE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 8 位整型数值 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt8(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 16 位整型数值,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt16LE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 16 位整型数值,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt16BE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 32 位整型数值,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt32LE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 32 位整型数值,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt32BE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个整型数值,最大支持 48 位,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readIntLE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个整型数值,最大支持 48 位,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readIntBE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个 64 位整型数值,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt64LE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): Class_Int64; + + /** + * + * @brief 从缓存对象读取一个 64 位整型数值,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的整型数值 + * + * + * + */ + readInt64BE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): Class_Int64; + + /** + * + * @brief 从缓存对象读取一个浮点数,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的浮点数 + * + * + * + */ + readFloatLE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个浮点数,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的浮点数 + * + * + * + */ + readFloatBE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个双精度浮点数,以低字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的双精度浮点数 + * + * + * + */ + readDoubleLE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 从缓存对象读取一个双精度浮点数,以高字节序的存储方式 + * @param offset 指定读取的起始位置,缺省为 0 + * @param noAssert 指定读取越界时不抛出错误,缺省为 flase,抛出 + * @return 返回读取的双精度浮点数 + * + * + * + */ + readDoubleBE(offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 8 位无符号整型数值 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUInt8(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 16 位无符号整型数值,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUInt16LE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 16 位无符号整型数值,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUInt16BE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 32 位无符号整型数值,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUInt32LE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 32 位无符号整型数值,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUInt32BE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个无符号整型数值,最大支持 48 位,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUIntLE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个无符号整型数值,最大支持 48 位,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeUIntBE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 8 位整型数值 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt8(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 16 位整型数值,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt16LE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 16 位整型数值,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt16BE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 32 位整型数值,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt32LE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 32 位整型数值,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt32BE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个整型数值,最大支持 48 位,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeIntLE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个整型数值,最大支持 48 位,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeIntBE(value: number, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 64 位整型数值,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt64LE(value: Class_Int64, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个 64 位整型数值,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeInt64BE(value: Class_Int64, offset?: number/** = 0*/, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个浮点数,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeFloatLE(value: number, offset: number, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个浮点数,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeFloatBE(value: number, offset: number, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个双精度浮点数,以低字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeDoubleLE(value: number, offset: number, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 向缓存对象写入一个双精度浮点数,以高字节序的存储方式 + * @param value 指定写入的数值 + * @param offset 指定写入的起始位置 + * @param noAssert 指定写入越界时不抛出错误,缺省为 flase,抛出 + * @return offset 加上写入的字节数 + * + * + * + */ + writeDoubleBE(value: number, offset: number, noAssert?: boolean/** = false*/): number; + + /** + * + * @brief 返回一个新缓存对象,包含指定起始到缓存结尾的数据 + * @param start 指定范围的起始,缺省从头开始 + * @return 返回新的缓存对象 + * + * + * + */ + slice(start?: number/** = 0*/): Class_Buffer; + + /** + * + * @brief 返回一个新缓存对象,包含指定范围的数据,若范围超出缓存,则只返回有效部分数据 + * @param start 指定范围的起始 + * @param end 指定范围的结束 + * @return 返回新的缓存对象 + * + * + * + */ + slice(start: number, end: number): Class_Buffer; + + /** + * + * @brief 把当前对象中的所有元素放入一个字符串 + * @param separator 分割字符,缺省为 "," + * @return 返回生成的字符串 + * + * + * + */ + join(separator?: string/** = ","*/): string; + + /** + * + * @brief 返回一个新缓存对象,包含当前对象数据的倒序 + * @return 返回新的缓存对象 + * + * + * + */ + reverse(): Class_Buffer; + + /** + * + * @brief 比较当前对象与给定的对象是否相等 + * @param expected 制定比较的目标对象 + * @return 返回对象比较的结果 + * + * + * + */ + equals(expected: Class__object): boolean; + + /** + * + * @brief 使用 16 进制编码缓存对象内容 + * @return 返回编码字符串 + * + * + * + */ + hex(): string; + + /** + * + * @brief 使用 base64 编码缓存对象内容 + * @return 返回编码字符串 + * + * + * + */ + base64(): string; + + /** + * + * @brief 返回全部二进制数据的数组 + * @return 返回包含对象数据索引的迭代器 + * + * + * + */ + keys(): Iterable; + + /** + * + * @brief 返回全部二进制数据的数组 + * @return 返回包含对象数据值的迭代器 + * + * + * + */ + values(): Iterable; + + /** + * + * @brief 返回包含对象数据 [index, byte] 对的迭代器 + * @return [index, byte] 对的迭代器 + * ```JavaScript + * const buf = Buffer.from('buffer'); + * + * // Prints: + * // [0, 98] + * // [1, 117] + * // [2, 102] + * // [3, 102] + * // [4, 101] + * // [5, 114] + * for (const pair of buf.entries()) { + * console.log(pair); + * } + * ``` + * + * + * + */ + entries(): Iterable; + + /** + * + * @brief 返回全部二进制数据的数组 + * @return 返回包含对象数据的数组 + * + * + * + */ + toArray(): any[]; + + /** + * + * @brief 返回二进制数据的编码字符串 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @param offset 读取起始位置 + * @param end 读取终止位置 + * @return 返回对象的字符串表示 + * + * + * + */ + toString(codec: string, offset?: number/** = 0*/, end?: number): string; + + /** + * + * @brief 返回二进制数据的编码字符串 + * @param codec 指定编码格式,允许值为:"hex", "base64", "utf8", 或者系统支持的字符集 + * @param offset 读取起始位置 + * @return 返回对象的字符串表示 + * + * + * + */ + toString(codec: string, offset?: number/** = 0*/): string; + + /** + * + * @brief 返回二进制数据的 utf8 编码字符串 + * @return 返回对象的字符串表示 + * + * + * + */ + toString(): string; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/BufferedStream.d.ts b/types/fibjs/declare/BufferedStream.d.ts new file mode 100644 index 0000000000..fab2dac2b2 --- /dev/null +++ b/types/fibjs/declare/BufferedStream.d.ts @@ -0,0 +1,144 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 缓存读取对象 + * @detail BufferedReader 对象用于对二进制流对象数据进行缓存,并提供文本读取能力,仅支持 utf-8 格式转换。创建方法:,```JavaScript,var reader = new io.BufferedStream(stream);,``` + */ +/// +declare class Class_BufferedStream extends Class_Stream { + + /** + * class prop + * + * + * @brief 查询创建缓存对象时的流对象 + * + * @readonly + * @type Stream + */ + + stream: Class_Stream + + /** + * class prop + * + * + * @brief 查询和设置当前对象处理文本时的字符集,缺省为 utf-8 + * + * + * @type String + */ + + charset: string + + /** + * class prop + * + * + * @brief 查询和设置行结尾标识,缺省时,posix:\"\\n\";windows:\"\\r\\n\" + * + * + * @type String + */ + + EOL: string + + + + /** + * + * @brief BufferedStream 构造函数 + * @param stm BufferedStream 的二进制基础流对象 + * + * + * + */ + constructor(stm: Class_Stream); + + /** + * + * @brief 读取指定字符的文本 + * @param size 指定读取的文本字符个数,以 utf8 或者指定的编码字节数为准 + * @return 返回读取的文本字符串,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + readText(size: number): string; + + /** + * + * @brief 读取一行文本,行结尾标识基于 EOL 属性的设置,缺省时,posix:\"\\n\";windows:\"\\r\\n\" + * @param maxlen 指定此次读取的最大字符串,以 utf8 编码字节数为准,缺省不限制字符数 + * @return 返回读取的文本字符串,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + readLine(maxlen?: number/** = -1*/): string; + + /** + * + * @brief 以数组方式读取一组文本行,行结尾标识基于 EOL 属性的设置,缺省时,posix:\"\\n\";windows:\"\\r\\n\" + * @param maxlines 指定此次读取的最大行数,缺省读取全部文本行 + * @return 返回读取的文本行数组,若无数据可读,或者连接中断,空数组 + * + * + * + */ + readLines(maxlines?: number/** = -1*/): any[]; + + /** + * + * @brief 读取一个文本字符串,以指定的字节为结尾 + * @param mk 指定结尾的字符串 + * @param maxlen 指定此次读取的最大字符串,以 utf8 编码字节数为准,缺省不限制字符数 + * @return 返回读取的文本字符串,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + readUntil(mk: string, maxlen?: number/** = -1*/): string; + + /** + * + * @brief 写入一个字符串 + * @param txt 指定写入的字符串 + * + * + * @async + */ + writeText(txt: string): void; + + /** + * + * @brief 写入一个字符串,并写入换行符 + * @param txt 指定写入的字符串 + * + * + * @async + */ + writeLine(txt: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Chain.d.ts b/types/fibjs/declare/Chain.d.ts new file mode 100644 index 0000000000..4a8c89e69c --- /dev/null +++ b/types/fibjs/declare/Chain.d.ts @@ -0,0 +1,63 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 消息处理器链处理对象 + * @detail 消息处理器链处理对象用于链接一系列消息处理器,按照指定的顺序链式处理。创建方法:,```JavaScript,var chain = new mq.Chain([, func1, func2,]);,``` + */ +/// +declare class Class_Chain extends Class_Handler { + + + + /** + * + * @brief 构造一个消息处理器链处理对象 + * @param hdlrs 处理器数组 + * + * + * + */ + constructor(hdlrs: any[]); + + /** + * + * @brief 添加处理器数组 + * @param hdlrs 处理器数组 + * + * + * + */ + append(hdlrs: any[]): void; + + /** + * + * @brief 添加处理器 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + append(hdlr: Class_Handler): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Cipher.d.ts b/types/fibjs/declare/Cipher.d.ts new file mode 100644 index 0000000000..122da7f036 --- /dev/null +++ b/types/fibjs/declare/Cipher.d.ts @@ -0,0 +1,149 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 对称加密算法对象 + * @detail Cipher 对象属于 crypto 模块,创建:,```JavaScript,var c = new crypto.Cipher(crypto.AES, crypto.ECB, ...);,``` + */ + +declare class Class_Cipher extends Class__object { + + /** + * class prop + * + * + * @brief 返回当前算法名称 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 返回当前算法密码长度,以位为单位 + * + * @readonly + * @type Integer + */ + + keySize: number + + /** + * class prop + * + * + * @brief 返回当前算法初始向量长度,以字节为单位 + * + * @readonly + * @type Integer + */ + + ivSize: number + + /** + * class prop + * + * + * @brief 返回当前算法数据块长度,以字节为单位 + * + * @readonly + * @type Integer + */ + + blockSize: number + + + + /** + * + * @brief Cipher 构造函数,仅用于 ARC4 初始化 + * @param provider 指定加密算法 + * @param key 指定加密解密密码 + * + * + * + */ + constructor(provider: number, key: Class_Buffer); + + /** + * + * @brief Cipher 构造函数 + * @param provider 指定加密算法 + * @param mode 指定分组密码工作模式 + * @param key 指定加密解密密码 + * + * + * + */ + constructor(provider: number, mode: number, key: Class_Buffer); + + /** + * + * @brief Cipher 构造函数 + * @param provider 指定加密算法 + * @param mode 指定分组密码工作模式 + * @param key 指定加密解密密码 + * @param iv 指定初始向量 + * + * + * + */ + constructor(provider: number, mode: number, key: Class_Buffer, iv: Class_Buffer); + + /** + * + * @brief 使用填充模式 + * @param mode 指定填充模式,缺省为 PADDING_PKCS7 + * + * + * + */ + paddingMode(mode: number): void; + + /** + * + * @brief 使用当前算法密码加密数据 + * @param data 指定要加密的数据 + * @return 返回加密后的数据 + * + * + * @async + */ + encrypt(data: Class_Buffer): Class_Buffer; + + /** + * + * @brief 使用当前算法密码解密数据 + * @param data 指定要解密的数据 + * @return 返回解密后的数据 + * + * + * @async + */ + decrypt(data: Class_Buffer): Class_Buffer; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Condition.d.ts b/types/fibjs/declare/Condition.d.ts new file mode 100644 index 0000000000..08486086d4 --- /dev/null +++ b/types/fibjs/declare/Condition.d.ts @@ -0,0 +1,75 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 条件变量对象 + * @detail 条件变量是利用纤程间共享的全局变量来进行同步的一种机制,主要包括两个动作:,1)一个线程等待某个条件成立,而将自己挂起;,2)另一个线程使条件成立,并通知等待的纤程向下执行。,,为了防止竞争,每个条件变量都需要一个Lock的配合(Lock可自行显式创建并传递进来,也可交由fibjs为您创建),,通过使用条件变量,可以利用一个条件变量控制一批纤程的开关;,,以下是两个纤程调度的实例:,```JavaScript,var coroutine = require("coroutine");,var cond = new coroutine.Condition();,var ready = false;,var state = "ready";,,function funcwait() {, cond.acquire();, while (!ready), cond.wait();, state = "go", cond.release();,},,coroutine.start(funcwait);,,cond.acquire();,console.log(state),ready = true;,cond.notify();,coroutine.sleep();,console.log(state);,```,will output:,```sh,ready,go,``` + */ +/// +declare class Class_Condition extends Class_Lock { + + + + /** + * + * @brief 条件变量构造函数(条件变量所需的锁由fibjs内部构造) + * + * + */ + constructor(); + + /** + * + * @brief 条件变量构造函数 + * @param lock 使用自行构造的锁 + * + * + * + */ + constructor(lock: Class_Lock); + + /** + * + * @brief 使纤程进入阻塞状态 + * + * + */ + wait(): void; + + /** + * + * @brief 通知一个被阻塞的纤程(最后加入纤程池的)向下继续执行 + * + * + */ + notify(): void; + + /** + * + * @brief 通知所有被阻塞的纤程向下继续执行 + * + * + */ + notifyAll(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/DbConnection.d.ts b/types/fibjs/declare/DbConnection.d.ts new file mode 100644 index 0000000000..62e940687f --- /dev/null +++ b/types/fibjs/declare/DbConnection.d.ts @@ -0,0 +1,119 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 数据库连接对象,用于建立和维护一个数据库连接会话。 + * @detail + */ + +declare class Class_DbConnection extends Class__object { + + /** + * class prop + * + * + * @brief 查询当前连接数据库类型 + * + * @readonly + * @type String + */ + + type: string + + + + /** + * + * @brief 关闭当前数据库连接 + * + * @async + */ + close(): void; + + /** + * + * @brief 在当前数据库连接上启动一个事务 + * + * @async + */ + begin(): void; + + /** + * + * @brief 提交当前数据库连接上的事务 + * + * @async + */ + commit(): void; + + /** + * + * @brief 回滚当前数据库连接上的事务 + * + * @async + */ + rollback(): void; + + /** + * + * @brief 进入事务执行一个函数,并根据函数执行情况提交或者回滚 + * func 执行有三种结果: + * * 函数正常返回,包括运行结束和主动 return,此时事务将自动提交 + * * 函数返回 false,此时事务将回滚 + * * 函数运行错误,事务自动回滚 + * + * @param func 以事务方式执行的函数 + * @return 返回事务是否提交,正常 commit 时返回 true, rollback 时返回 false,如果事务出错则抛出错误 + * + * + * + */ + trans(func: Function): boolean; + + /** + * + * @brief 执行一个 sql 命令,并返回执行结果,可根据参数格式化字符串 + * + * @param sql 格式化字符串,可选参数用 ? 指定。例如:'SELECT FROM TEST WHERE [id]=?' + * @param args 可选参数列表 + * @return 返回包含结果记录的数组,如果请求是 UPDATE 或者 INSERT,返回结果还会包含 affected 和 insertId,mssql 不支持 insertId。 + * + * + * @async + */ + execute(sql: string, ...args: any[]): any[]; + + /** + * + * @brief 格式化一个 sql 命令,并返回格式化结果 + * + * @param sql 格式化字符串,可选参数用 ? 指定。例如:'SELECT FROM TEST WHERE [id]=?' + * @param args 可选参数列表 + * @return 返回格式化之后的 sql 命令 + * + * + * + */ + format(sql: string, ...args: any[]): string; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/DgramSocket.d.ts b/types/fibjs/declare/DgramSocket.d.ts new file mode 100644 index 0000000000..22486d5832 --- /dev/null +++ b/types/fibjs/declare/DgramSocket.d.ts @@ -0,0 +1,180 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief dgram.Socket 对象是一个封装了数据包函数功能的 EventEmitter。 + * @detail DgramSocket 实例是由 dgram.createSocket() 创建的。创建 dgram.Socket 实例不需要使用 new 关键字。,,创建方法:,```JavaScript,var dgram = require('dgram');,var sock = dgram.createSocket('udp4');,```,,## 事件,DgramSocket 继承于 EventEmitter,对象的状态变化,以及数据接受,都是以事件的方式实现。,,### close 事件,** `close` 事件将在使用 `close()` 关闭一个 `socket` 之后触发。该事件一旦触发,这个 `socket` 上将不会触发新的 `message` 事件。**,,### error 事件,** 当有任何错误发生时,`error` 事件将被触发。 **,,### listening 事件,** 当一个 `socket` 开始监听数据包信息时,`listening` 事件将被触发。该事件会在创建 UDP socket 之后被立即触发。 **,,### message 事件,** 当有新的数据包被 `socket` 接收时,`message` 事件会被触发。`msg` 和 `rinfo` 会作为参数传递到该事件的处理函数中。 **,- msg: Buffer,消息,- rinfo: Object,远程地址信息, - address: string,发送方地址, - family: string,地址类型 ('IPv4' or 'IPv6'), - port: number,发送者端口, - size: number,消息大小 + */ +/// +declare class Class_DgramSocket extends Class_EventEmitter { + + + + /** + * + * @brief 该方法会令 dgram.Socket 在指定的 `port` 和 `addr` 上监听数据包信息。绑定完成时会触发一个 `listening` 事件。 + * @param port 指定绑定端口,若 `port` 未指定或为 0,操作系统会尝试绑定一个随机的端口 + * @param addr 指定绑定地址,若 address 未指定,操作系统会尝试在所有地址上监听。 + * + * + * @async + */ + bind(port?: number/** = 0*/, addr?: string/** = ""*/): void; + + /** + * + * @brief 该方法会令 dgram.Socket 在 `opts` 指定的 `port` 和 `address` 上监听数据包信息。绑定完成时会触发一个 `listening` 事件。 + * @param opts 指定绑定参数 + * + * + * @async + */ + bind(opts: object): void; + + /** + * + * @brief 在 socket 上发送一个数据包 + * @param msg 指定发送的数据 + * @param port 指定发送的目的端口 + * @param address 指定发送的目的地址 + * @return 返回发送尺寸 + * + * + * @async + */ + send(msg: Class_Buffer, port: number, address?: string/** = ""*/): number; + + /** + * + * @brief 在 socket 上发送一个数据包 + * @param msg 指定发送的数据 + * @param offset 从指定偏移开始发送 + * @param length 之发送指定长度 + * @param port 指定发送的目的端口 + * @param address 指定发送的目的地址 + * @return 返回发送尺寸 + * + * + * @async + */ + send(msg: Class_Buffer, offset: number, length: number, port: number, address?: string/** = ""*/): number; + + /** + * + * @brief 返回一个包含 socket 地址信息的对象。对于 UDP socket,该对象将包含 address、family 和 port 属性。 + * @return 返回对象绑定地址 + * + * + * + */ + address(): any; + + /** + * + * @brief 关闭当前 socket + * + * + */ + close(): void; + + /** + * + * @brief 关闭当前 socket + * @param callback 关闭完成后的回调函数,它相当于为 `close` 事件添加了一个监听器 + * + * + * + */ + close(callback: Function): void; + + /** + * + * @brief 查询 socket 接收缓冲区大小 + * @return 返回查询结果 + * + * + * + */ + getRecvBufferSize(): number; + + /** + * + * @brief 查询 socket 发送缓冲区大小 + * @return 返回查询结果 + * + * + * + */ + getSendBufferSize(): number; + + /** + * + * @brief 设置 socket 接收缓冲区大小 + * @param size 指定要设置的尺寸 + * + * + * + */ + setRecvBufferSize(size: number): void; + + /** + * + * @brief 设置 socket 发送缓冲区大小 + * @param size 指定要设置的尺寸 + * + * + * + */ + setSendBufferSize(size: number): void; + + /** + * + * @brief 设置或清除 SO_BROADCAST socket 选项 + * @param flag 当设置为 true, UDP包会被发送到一个本地接口的广播地址 + * + * + * + */ + setBroadcast(flag: boolean): void; + + /** + * + * @brief 维持 fibjs 进程不退出,在对象绑定期间阻止 fibjs 进程退出 + * @return 返回当前对象 + * + * + * + */ + ref(): Class_DgramSocket; + + /** + * + * @brief 允许 fibjs 进程退出,在对象绑定期间允许 fibjs 进程退出 + * @return 返回当前对象 + * + * + * + */ + unref(): Class_DgramSocket; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Digest.d.ts b/types/fibjs/declare/Digest.d.ts new file mode 100644 index 0000000000..71c62f0386 --- /dev/null +++ b/types/fibjs/declare/Digest.d.ts @@ -0,0 +1,67 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 信息摘要对象 + * @detail + */ + +declare class Class_Digest extends Class__object { + + /** + * class prop + * + * + * @brief 查询当前信息摘要算法的摘要字节数 + * + * @readonly + * @type Integer + */ + + size: number + + + + /** + * + * @brief 更新二进制摘要信息 + * @param data 二进制数据块 + * @return 返回信息摘要对象本身 + * + * + * + */ + update(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 计算并返回摘要 + * @param codec 指定编码格式,允许值为:"buffer", "hex", "base64", "utf8", 或者系统支持的字符集 + * @return 返回指定编码的摘要表示 + * + * + * + */ + digest(codec?: string/** = "buffer"*/): any; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Event.d.ts b/types/fibjs/declare/Event.d.ts new file mode 100644 index 0000000000..478967032e --- /dev/null +++ b/types/fibjs/declare/Event.d.ts @@ -0,0 +1,85 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 事件对象 + * @detail 通过一个事件达到对一组纤程进行控制的目的(事件对象的状态为bool类型) + */ +/// +declare class Class_Event extends Class_Lock { + + + + /** + * + * @brief 事件对象构造函数 + * @param value 指定是否等待,为 true 时等待,缺省为 false + * + * + * + */ + constructor(value?: boolean/** = false*/); + + /** + * + * @brief 判断事件对象是否为真 + * @return 如果事件为真,返回 true + * + * + * + */ + isSet(): boolean; + + /** + * + * @brief 激活事件(将事件状态改为true),并调用pulse() + * + * + */ + set(): void; + + /** + * + * @brief 激活等待该事件的所有纤程 + * + * + */ + pulse(): void; + + /** + * + * @brief 重置事件(将事件状态改为false) + * + * + */ + clear(): void; + + /** + * + * @brief 等待一个事件 + * + * + */ + wait(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/EventEmitter.d.ts b/types/fibjs/declare/EventEmitter.d.ts new file mode 100644 index 0000000000..0008b2faa3 --- /dev/null +++ b/types/fibjs/declare/EventEmitter.d.ts @@ -0,0 +1,311 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 事件触发对象,可用于建立观察者模式,支持事件触发的对象均继承于此,同一事件的同一函数只会产生一次回调 + * @detail Event 对象可独立创建,以用于组建自定义的事件系统:,```JavaScript,var EventEmitter = require('events');,,var e = new EventEmitter();,``` + */ + +declare class Class_EventEmitter extends Class__object { + + /** + * class prop + * + * + * @brief 默认全局最大监听器数 + * @static + * + * @type Integer + */ + + defaultMaxListeners: number + + + + /** + * + * @brief 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 绑定一个事件处理函数到对象 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回成功绑定的数量,如果函数已绑定则返回 0 + * + * + * + */ + on(ev: string, func: Function): object; + + /** + * + * @brief 绑定一个事件处理函数到对象 + * @param map 指定事件映射关系,对象属性名称将作为事件名称,属性的值将作为事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + on(map: object): object; + + /** + * + * @brief 绑定一个事件处理函数到对象 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + addListener(ev: string, func: Function): object; + + /** + * + * @brief 绑定一个事件处理函数到对象 + * @param map 指定事件映射关系,对象属性名称将作为事件名称,属性的值将作为事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + addListener(map: object): object; + + /** + * + * @brief 绑定一个事件处理函数到对象起始 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回成功绑定的数量,如果函数已绑定则返回 0 + * + * + * + */ + prependListener(ev: string, func: Function): object; + + /** + * + * @brief 绑定一个事件处理函数到对象起始 + * @param map 指定事件映射关系,对象属性名称将作为事件名称,属性的值将作为事件处理函数 + * @return 返回成功绑定的数量,如果函数已绑定则返回 0 + * + * + * + */ + prependListener(map: object): object; + + /** + * + * @brief 绑定一个一次性事件处理函数到对象,一次性处理函数只会触发一次 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + once(ev: string, func: Function): object; + + /** + * + * @brief 绑定一个一次性事件处理函数到对象,一次性处理函数只会触发一次 + * @param map 指定事件映射关系,对象属性名称将作为事件名称,属性的值将作为事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + once(map: object): object; + + /** + * + * @brief 绑定一个事件处理函数到对象起始 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回成功绑定的数量,如果函数已绑定则返回 0 + * + * + * + */ + prependOnceListener(ev: string, func: Function): object; + + /** + * + * @brief 绑定一个事件处理函数到对象起始 + * @param map 指定事件映射关系,对象属性名称将作为事件名称,属性的值将作为事件处理函数 + * @return 返回成功绑定的数量,如果函数已绑定则返回 0 + * + * + * + */ + prependOnceListener(map: object): object; + + /** + * + * @brief 从对象处理队列中取消指定函数 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + off(ev: string, func: Function): object; + + /** + * + * @brief 取消对象处理队列中的全部函数 + * @param ev 指定事件的名称 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + off(ev: string): object; + + /** + * + * @brief 从对象处理队列中取消指定函数 + * @param map 指定事件映射关系,对象属性名称作为事件名称,属性的值作为事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + off(map: object): object; + + /** + * + * @brief 从对象处理队列中取消指定函数 + * @param ev 指定事件的名称 + * @param func 指定事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + removeListener(ev: string, func: Function): object; + + /** + * + * @brief 取消对象处理队列中的全部函数 + * @param ev 指定事件的名称 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + removeListener(ev: string): object; + + /** + * + * @brief 从对象处理队列中取消指定函数 + * @param map 指定事件映射关系,对象属性名称作为事件名称,属性的值作为事件处理函数 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + removeListener(map: object): object; + + /** + * + * @brief 从对象处理队列中取消所有事件的所有监听器, 如果指定事件,则移除指定事件的所有监听器。 + * @param evs 指定事件的名称 + * @return 返回事件对象本身,便于链式调用 + * + * + * + */ + removeAllListeners(evs?: any[]/** = v8::Array::New(isolate)*/): object; + + /** + * + * 监听器的默认限制的数量,仅用于兼容 + * @param n 指定事件的数量 + * + * + * + */ + setMaxListeners(n: number): void; + + /** + * + * 获取监听器的默认限制的数量,仅用于兼容 + * @return 返回默认限制数量 + * + * + * + */ + getMaxListeners(): number; + + /** + * + * @brief 查询对象指定事件的监听器数组 + * @param ev 指定事件的名称 + * @return 返回指定事件的监听器数组 + * + * + * + */ + listeners(ev: string): any[]; + + /** + * + * @brief 查询对象指定事件的监听器数量 + * @param ev 指定事件的名称 + * @return 返回指定事件的监听器数量 + * + * + * + */ + listenerCount(ev: string): number; + + /** + * + * @brief 查询监听器事件名称 + * @return 返回事件名称数组 + * + * + * + */ + eventNames(): any[]; + + /** + * + * @brief 主动触发一个事件 + * @param ev 事件名称 + * @param args 事件参数,将会传递给事件处理函数 + * @return 返回事件触发状态,有响应事件返回 true,否则返回 false + * + * + * + */ + emit(ev: string, ...args: any[]): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/EventInfo.d.ts b/types/fibjs/declare/EventInfo.d.ts new file mode 100644 index 0000000000..f60190d315 --- /dev/null +++ b/types/fibjs/declare/EventInfo.d.ts @@ -0,0 +1,81 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 事件信息对象,用于在事件中传递信息 + * @detail + */ + +declare class Class_EventInfo extends Class__object { + + /** + * class prop + * + * + * 查询事件错误编码 + * + * @readonly + * @type Integer + */ + + code: number + + /** + * class prop + * + * + * 查询事件错误信息 + * + * @readonly + * @type String + */ + + reason: string + + /** + * class prop + * + * + * 查询事件类型 + * + * @readonly + * @type String + */ + + type: string + + /** + * class prop + * + * + * 查询触发事件的对象 + * + * @readonly + * @type Object + */ + + target: object + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Fiber.d.ts b/types/fibjs/declare/Fiber.d.ts new file mode 100644 index 0000000000..1ddf81a548 --- /dev/null +++ b/types/fibjs/declare/Fiber.d.ts @@ -0,0 +1,77 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 纤程操作对象,此对象不可直接创建 + * @detail 使用 coroutine.start 创建纤程后,将返回此对象,用于纤程处理和纤程间通信。,纤程主函数可以通过 this 访问本纤程对象,也可通过 coroutine.current 获取当前纤程。,```JavaScript,function func(v1),{, console.log(v1 + this.v);,},,var fb = coroutine.start(func,100);,,fb.v = 123;,,fb.join();,```,,纤程局部存储通过共享的 Fiber 对象完成,通过 coroutine.current 获取当前纤程,通过修改和查询其变量达到共享数据的目的。,,```JavaScript,function func(),{, console.log(coroutine.current().v);,},,coroutine.current().v = 100;,,func();,```,,纤程在创建时,会自动复制当前纤程的局部变量到新的纤程,之后,各自的局部变量的修改不会相互影响,除非变量本身为对象引用。,,```JavaScript,function func(),{, console.log(coroutine.current().v);,},,coroutine.current().v = 100;,,var fb = coroutine.start(func);,,coroutine.current().v = 200;,,fb.join();,``` + */ + +declare class Class_Fiber extends Class__object { + + /** + * class prop + * + * + * @brief 查询纤程的唯一 id + * + * @readonly + * @type Long + */ + + id: number + + /** + * class prop + * + * + * @brief 查询纤程的调用纤程 + * + * @readonly + * @type Fiber + */ + + caller: Class_Fiber + + /** + * class prop + * + * + * @brief 查询纤程的调用堆栈 + * + * @readonly + * @type String + */ + + stack: string + + + + /** + * + * @brief 等待纤程结束 + * + * + */ + join(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/File.d.ts b/types/fibjs/declare/File.d.ts new file mode 100644 index 0000000000..11b5e7391f --- /dev/null +++ b/types/fibjs/declare/File.d.ts @@ -0,0 +1,67 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 文件操作对象,用于二进制文件读写 + * @detail 文件操作对象用于对二进制文件进行操作,可使用 fs 模块打开和创建文件:,```JavaScript,var f = fs.openFile('test.txt');,``` + */ +/// +declare class Class_File extends Class_SeekableStream { + + /** + * class prop + * + * + * @brief 查询当前文件名 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 查询当前文件描述符 + * + * @readonly + * @type Integer + */ + + fd: number + + + + /** + * + * @brief 查询当前文件的访问权限,Windows 不支持此方法 + * @param mode 指定设定的访问权限 + * + * + * @async + */ + chmod(mode: number): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Handler.d.ts b/types/fibjs/declare/Handler.d.ts new file mode 100644 index 0000000000..df2ef6463f --- /dev/null +++ b/types/fibjs/declare/Handler.d.ts @@ -0,0 +1,74 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 消息处理器接口 + * @detail + */ + +declare class Class_Handler extends Class__object { + + + + /** + * + * @brief 构造一个消息处理器链处理对象 + * @param hdlrs 处理器数组 + * + * + * + */ + constructor(hdlrs: any[]); + + /** + * + * @brief 创建一个消息处理器路由对象 + * @param map 初始化路由参数 + * + * + * + */ + constructor(map: object); + + /** + * + * @brief 创建一个 JavaSvript 消息处理器 + * @param hdlr JavaScript 处理器函数 + * + * + * + */ + constructor(hdlr: Function); + + /** + * + * @brief 处理一个消息或对象 + * @param v 指定处理的消息或对象 + * @return 返回下一步的处理器 + * + * + * @async + */ + invoke(v: Class__object): Class_Handler; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HandlerEx.d.ts b/types/fibjs/declare/HandlerEx.d.ts new file mode 100644 index 0000000000..22bca1ce76 --- /dev/null +++ b/types/fibjs/declare/HandlerEx.d.ts @@ -0,0 +1,90 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 扩展消息处理器接口 + * @detail + */ +/// +declare class Class_HandlerEx extends Class_Handler { + + /** + * class prop + * + * + * @brief WebSocket 协议转换处理器当前事件处理接口对象 + * + * + * @type Handler + */ + + handler: Class_Handler + + /** + * class prop + * + * + * @brief 查询 WebSocket 包协议转换处理器的工作状态 + * + * 返回的结果为一个 Stats 对象,结构如下: + * ```JavaScript + * { + * total : 1000, // 总计处理的请求 + * pendding : 100, // 当前正在处理的请求 + * request : 10, // 新建的请求 + * response : 10, // 发送的响应 + * error : 100 // 发生的错误 + * } + * ``` + * + * + * @readonly + * @type Stats + */ + + stats: Class_Stats + + + + /** + * + * @brief 设置错误处理器 + * + * 使用方式: + * ```JavaScript + * hdlr.onerror({ + * "404": function(v) + * { + * ... + * }, + * "500": new mq.Routing(...) + * }) + * ``` + * @param hdlrs 指定不同的错误的处理器,key 是错误号,value 是处理器,可以是内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + onerror(hdlrs: object): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HeapGraphEdge.d.ts b/types/fibjs/declare/HeapGraphEdge.d.ts new file mode 100644 index 0000000000..87a144c664 --- /dev/null +++ b/types/fibjs/declare/HeapGraphEdge.d.ts @@ -0,0 +1,97 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief HeapGraphEdge表示两个HeapGraphNode节点间的关联,从上游节点到下游节点 + * @detail + */ + +declare class Class_HeapGraphEdge extends Class__object { + + /** + * class prop + * + * + * @brief 下游节点的链接方式,可能的值: + * - profiler.Edge_ContextVariable, 函数中的变量 + * - profiler.Edge_Element, 数组中的元素 + * - profiler.Edge_Property, 有名对象的属性 + * - profiler.Edge_Internal, JS无法进入的链接 + * - profiler.Edge_Hidden, 指向需要事先计算出空间大小的节点 + * - profiler.Edge_Shortcut, 指向无法事先计算出空间大小的节点 + * - profiler.Edge_Weak, 一个弱引用(被GC忽视) + * + * + * @readonly + * @type Integer + */ + + type: number + + /** + * class prop + * + * + * @brief 链接名称 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 链接的描述 + * + * @readonly + * @type String + */ + + description: string + + + + /** + * + * @brief 获取HeapGraphEdge的上游HeapGraphNode节点 + * @return 返回源HeapGraphNode节点 + * + * + * + */ + getFromNode(): Class_HeapGraphNode; + + /** + * + * @brief 获取HeapGraphEdge的下游HeapGraphNode节点 + * @return 返回目的HeapGraphNode节点 + * + * + * + */ + getToNode(): Class_HeapGraphNode; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HeapGraphNode.d.ts b/types/fibjs/declare/HeapGraphNode.d.ts new file mode 100644 index 0000000000..5ff54d1fd6 --- /dev/null +++ b/types/fibjs/declare/HeapGraphNode.d.ts @@ -0,0 +1,120 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief HeapGraphNode表示堆视图中的一个节点 + * @detail + */ + +declare class Class_HeapGraphNode extends Class__object { + + /** + * class prop + * + * + * @brief 节点类型,可能的值: + * - profiler.Node_Hidden, 隐藏节点,当显示给用户时可以被过滤掉 + * - profiler.Node_Array, 数组 + * - profiler.Node_String, 字符串 + * - profiler.Node_Object, JS对象(字符串和数组除外) + * - profiler.Node_Code, 编译后的代码 + * - profiler.Node_Closure, 函数闭包 + * - profiler.Node_RegExp, 正则表达式 + * - profiler.Node_HeapNumber, 堆中排好序的数字 + * - profiler.Node_Native, Native对象(非v8堆上的) + * - profiler.Node_Synthetic, Synthetic对象 + * - profiler.Node_ConsString, 拼接的字符串 + * - profiler.Node_SlicedString, 分割的字符串 + * - profiler.Node_Symbol, 符号(ES6) + * - profiler.Node_SimdValue, 堆中排好序的SIMD值(ES7) + * + * + * @readonly + * @type Integer + */ + + type: number + + /** + * class prop + * + * + * @brief 节点名称 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 节点的描述 + * + * @readonly + * @type String + */ + + description: string + + /** + * class prop + * + * + * @brief 节点ID + * + * @readonly + * @type Integer + */ + + id: number + + /** + * class prop + * + * + * @brief 节点大小,单位为字节 + * + * @readonly + * @type Integer + */ + + shallowSize: number + + /** + * class prop + * + * + * @brief 子节点列表,由HeapGraphEdge类型对象组成 + * + * @readonly + * @type NArray + */ + + childs: any[] + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HeapSnapshot.d.ts b/types/fibjs/declare/HeapSnapshot.d.ts new file mode 100644 index 0000000000..0a10a6b68f --- /dev/null +++ b/types/fibjs/declare/HeapSnapshot.d.ts @@ -0,0 +1,101 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief HeapSnapshots记录JS堆在某个时刻的状态 + * @detail + */ + +declare class Class_HeapSnapshot extends Class__object { + + /** + * class prop + * + * + * @brief 时间信息 + * + * @readonly + * @type Date + */ + + time: Date + + /** + * class prop + * + * + * @brief 堆视图的根节点 + * + * @readonly + * @type HeapGraphNode + */ + + root: Class_HeapGraphNode + + /** + * class prop + * + * + * @brief 堆视图节点组成的列表 + * + * @readonly + * @type NArray + */ + + nodes: any[] + + + + /** + * + * @brief 和指定的堆快照进行比较 + * @param before 待比较的堆快照 + * @return 返回堆快照的比较结果 + * + * + * + */ + diff(before: Class_HeapSnapshot): object; + + /** + * + * @brief 根据ID获取堆视图节点 + * @param id 数字类型的节点ID + * @return 返回获取到的堆视图节点 + * + * + * + */ + getNodeById(id: number): Class_HeapGraphNode; + + /** + * + * @brief 根据指定名称保存HeapSnapshot + * @param fname 快照名称 + * + * + * @async + */ + save(fname: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpClient.d.ts b/types/fibjs/declare/HttpClient.d.ts new file mode 100644 index 0000000000..7c9f6c073f --- /dev/null +++ b/types/fibjs/declare/HttpClient.d.ts @@ -0,0 +1,282 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http客户端对象 + * @detail http客户端对象模拟浏览器环境缓存cookie,并在访问url的时候携带对应的cookie,不同的http客户端对象是相互隔离的,提供http的request、get、post等方法。,用法如下:,,```JavaScript,var http = require('http');,var httpClient = new http.Client();,httpClient.request('GET', 'http://fibjs.org');,``` + */ + +declare class Class_HttpClient extends Class__object { + + /** + * class prop + * + * + * @brief 返回http客户端的 HttpCookie 对象列表 + * + * @readonly + * @type NArray + */ + + cookies: any[] + + /** + * class prop + * + * + * @brief 查询和设置超时时间 单位毫秒 + * + * + * @type Integer + */ + + timeout: number + + /** + * class prop + * + * + * @brief 查询和设置 body 最大尺寸,以 MB 为单位,缺省为 -1,不限制尺寸 + * + * + * @type Integer + */ + + maxBodySize: number + + /** + * class prop + * + * + * @brief cookie功能开关,默认开启 + * + * + * @type Boolean + */ + + enableCookie: boolean + + /** + * class prop + * + * + * @brief 自动redirect功能开关,默认开启 + * + * + * @type Boolean + */ + + autoRedirect: boolean + + /** + * class prop + * + * + * @brief 查询和设置 http 请求中的浏览器标识 + * + * + * @type String + */ + + userAgent: string + + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + * @type Integer + */ + + poolSize: number + + /** + * class prop + * + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + * @type Integer + */ + + poolTimeout: number + + + + /** + * + * @brief HttpClient 构造函数,创建一个新的HttpClient对象 + * + * + */ + constructor(); + + /** + * + * @brief 发送 http 请求到指定的流对象,并返回结果 + * @param conn 指定处理请求的流对象 + * @param req 要发送的 HttpRequest 对象 + * @return 返回服务器响应 + * + * + * @async + */ + request(conn: Class_Stream, req: Class_HttpRequest): Class_HttpResponse; + + /** + * + * @brief 请求指定的 url,并返回结果 + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param method 指定 http 请求方法:GET, POST 等 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 GET 方法请求指定的 url,并返回结果,等同于 request("GET", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 POST 方法请求指定的 url,并返回结果,等同于 request("POST", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 DELETE 方法请求指定的 url,并返回结果,等同于 request("DELETE", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 PUT 方法请求指定的 url,并返回结果,等同于 request("PUT", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 PATCH 方法请求指定的 url,并返回结果,等同于 request("PATCH", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpCollection.d.ts b/types/fibjs/declare/HttpCollection.d.ts new file mode 100644 index 0000000000..1936011e1d --- /dev/null +++ b/types/fibjs/declare/HttpCollection.d.ts @@ -0,0 +1,126 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 容器对象,用于 http header,cookie,query,form,等数据的存储与组织 + * @detail + */ + +declare class Class_HttpCollection extends Class__object { + + + + /** + * + * @brief 清除容器数据 + * + * + */ + clear(): void; + + /** + * + * @brief 检查容器内是否存在指定键值的数据 + * @param name 指定要检查的键值 + * @return 返回键值是否存在 + * + * + * + */ + has(name: string): boolean; + + /** + * + * @brief 查询指定键值的第一个值 + * @param name 指定要查询的键值 + * @return 返回键值所对应的值,若不存在,则返回 undefined + * + * + * + */ + first(name: string): any; + + /** + * + * @brief 查询指定键值的全部值 + * @param name 指定要查询的键值 + * @return 返回键值所对应全部值的数组,若数据不存在,则返回 null + * + * + * + */ + all(name: string): any[]; + + /** + * + * @brief 添加一个键值数据,添加数据并不修改已存在的键值的数据 + * @param map 指定要添加的键值数据字典 + * + * + * + */ + add(map: object): void; + + /** + * + * @brief 添加一个键值数据,添加数据并不修改已存在的键值的数据 + * @param name 指定要添加的键值 + * @param value 指定要添加的数据 + * + * + * + */ + add(name: string, value: any): void; + + /** + * + * @brief 设定一个键值数据,设定数据将修改键值所对应的第一个数值,并清除相同键值的其余数据 + * @param map 指定要设定的键值数据字典 + * + * + * + */ + set(map: object): void; + + /** + * + * @brief 设定一个键值数据,设定数据将修改键值所对应的第一个数值,并清除相同键值的其余数据 + * @param name 指定要设定的键值 + * @param value 指定要设定的数据 + * + * + * + */ + set(name: string, value: any): void; + + /** + * + * @brief 删除指定键值的全部值 + * @param name 指定要删除的键值 + * + * + * + */ + remove(name: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpCookie.d.ts b/types/fibjs/declare/HttpCookie.d.ts new file mode 100644 index 0000000000..b7c3980150 --- /dev/null +++ b/types/fibjs/declare/HttpCookie.d.ts @@ -0,0 +1,160 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http Cookie 对象,用于添加和处理 cookie + * @detail + */ + +declare class Class_HttpCookie extends Class__object { + + /** + * class prop + * + * + * @brief 查询和设置 cookie 名称 + * + * + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 查询和设置 cookie 的值 + * + * + * @type String + */ + + value: string + + /** + * class prop + * + * + * @brief 查询和设置 cookie 的域名范围 + * + * + * @type String + */ + + domain: string + + /** + * class prop + * + * + * @brief 查询和设置 cookie 的路径范围 + * + * + * @type String + */ + + path: string + + /** + * class prop + * + * + * @brief 查询和设置 cookie 的过期时间 + * + * + * @type Date + */ + + expires: Date + + /** + * class prop + * + * + * @brief 查询和设置 cookie 是否仅允许 http 请求,缺省 false + * + * + * @type Boolean + */ + + httpOnly: boolean + + /** + * class prop + * + * + * @brief 查询和设置 cookie 是否仅通过 https 传递,缺省 false + * + * + * @type Boolean + */ + + secure: boolean + + + + /** + * + * @brief HttpCookie 构造函数,创建一个新的 HttpCookie 对象 + * @param opts 指定创建的 cookie 的属性 + * + * + * + */ + constructor(opts?: object/** = v8::Object::New(isolate)*/); + + /** + * + * @brief HttpCookie 构造函数,创建一个新的 HttpCookie 对象 + * @param name 指定创建的 cookie 名称 + * @param value 指定创建的 cookie 值 + * @param opts 指定创建的 cookie 的其它属性 + * + * + * + */ + constructor(name: string, value: string, opts?: object/** = v8::Object::New(isolate)*/); + + /** + * + * @brief 解析给定的字符串,填充 cookie 对象 + * @param header 指定需要解析的 header 字符串 + * + * + * + */ + parse(header: string): void; + + /** + * + * @brief 检测给定的 url 是否匹配当前设置 + * @param url 指定测试的 url + * @return 匹配成功返回 true + * + * + * + */ + match(url: string): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpHandler.d.ts b/types/fibjs/declare/HttpHandler.d.ts new file mode 100644 index 0000000000..4f412cb31f --- /dev/null +++ b/types/fibjs/declare/HttpHandler.d.ts @@ -0,0 +1,101 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 协议转换处理器 + * @detail 用以将数据流转换为 http 协议消息,创建方式:,```JavaScript,var hdlr = new mq.HttpHandler(...);,```,或者:,```JavaScript,var hdlr = new http.Handler(...);,``` + */ +/// +declare class Class_HttpHandler extends Class_HandlerEx { + + /** + * class prop + * + * + * @brief 查询和设置是否允强制使用 gzip 压缩输出,缺省为 false + * + * + * @type Boolean + */ + + forceGZIP: boolean + + /** + * class prop + * + * + * @brief 查询和设置最大请求头个数,缺省为 128 + * + * + * @type Integer + */ + + maxHeadersCount: number + + /** + * class prop + * + * + * @brief 查询和设置 body 最大尺寸,以 MB 为单位,缺省为 64 + * + * + * @type Integer + */ + + maxBodySize: number + + /** + * class prop + * + * + * @brief 查询和设置服务器名称,缺省为:fibjs/0.x.0 + * + * + * @type String + */ + + serverName: string + + + + /** + * + * @brief 创建一个 http 协议处理器对象,将流对象的数据转变为 http 消息对象 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(hdlr: Class_Handler); + + /** + * + * @brief 允许跨域请求 + * @param allowHeaders 指定接受的 http 头字段 + * + * + * + */ + enableCrossOrigin(allowHeaders?: string/** = "Content-Type"*/): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpMessage.d.ts b/types/fibjs/declare/HttpMessage.d.ts new file mode 100644 index 0000000000..1d64ba5c5f --- /dev/null +++ b/types/fibjs/declare/HttpMessage.d.ts @@ -0,0 +1,202 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 基础消息对象 + * @detail + */ +/// +declare class Class_HttpMessage extends Class_Message { + + /** + * class prop + * + * + * @brief 协议版本信息,允许的格式为:HTTP/#.# + * + * + * @type String + */ + + protocol: string + + /** + * class prop + * + * + * @brief 包含消息中 http 消息头的容器,只读属性 + * + * @readonly + * @type HttpCollection + */ + + headers: Class_HttpCollection + + /** + * class prop + * + * + * @brief 查询和设定是否保持连接 + * + * + * @type Boolean + */ + + keepAlive: boolean + + /** + * class prop + * + * + * @brief 查询和设定是否是升级协议 + * + * + * @type Boolean + */ + + upgrade: boolean + + /** + * class prop + * + * + * @brief 查询和设置最大请求头个数,缺省为 128 + * + * + * @type Integer + */ + + maxHeadersCount: number + + /** + * class prop + * + * + * @brief 查询和设置 body 最大尺寸,以 MB 为单位,缺省为 64 + * + * + * @type Integer + */ + + maxBodySize: number + + /** + * class prop + * + * + * @brief 查询当前对象的来源 socket + * + * @readonly + * @type Stream + */ + + socket: Class_Stream + + + + /** + * + * @brief 检查是否存在指定键值的消息头 + * @param name 指定要检查的键值 + * @return 返回键值是否存在 + * + * + * + */ + hasHeader(name: string): boolean; + + /** + * + * @brief 查询指定键值的第一个消息头 + * @param name 指定要查询的键值 + * @return 返回键值所对应的值,若不存在,则返回 undefined + * + * + * + */ + firstHeader(name: string): any; + + /** + * + * @brief 查询指定键值的全部消息头 + * @param name 指定要查询的键值 + * @return 返回键值所对应全部值的数组,若数据不存在,则返回 null + * + * + * + */ + allHeader(name: string): any[]; + + /** + * + * @brief 添加一个消息头,添加数据并不修改已存在的键值的消息头 + * @param map 指定要添加的键值数据字典 + * + * + * + */ + addHeader(map: object): void; + + /** + * + * @brief 添加一个消息头,添加数据并不修改已存在的键值的消息头 + * @param name 指定要添加的键值 + * @param value 指定要添加的数据 + * + * + * + */ + addHeader(name: string, value: any): void; + + /** + * + * @brief 设定一个消息头,设定数据将修改键值所对应的第一个数值,并清除相同键值的其余消息头 + * @param map 指定要设定的键值数据字典 + * + * + * + */ + setHeader(map: object): void; + + /** + * + * @brief 设定一个消息头,设定数据将修改键值所对应的第一个数值,并清除相同键值的其余消息头 + * @param name 指定要设定的键值 + * @param value 指定要设定的数据 + * + * + * + */ + setHeader(name: string, value: any): void; + + /** + * + * @brief 删除指定键值的全部消息头 + * @param name 指定要删除的键值 + * + * + * + */ + removeHeader(name: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpRequest.d.ts b/types/fibjs/declare/HttpRequest.d.ts new file mode 100644 index 0000000000..b7116f8673 --- /dev/null +++ b/types/fibjs/declare/HttpRequest.d.ts @@ -0,0 +1,125 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 请求消息对象 + * @detail + */ +/// +declare class Class_HttpRequest extends Class_HttpMessage { + + /** + * class prop + * + * + * @brief 获取响应消息对象 + * + * @readonly + * @type HttpResponse + */ + + response: Class_HttpResponse + + /** + * class prop + * + * + * @brief 查询和设置请求方法 + * + * + * @type String + */ + + method: string + + /** + * class prop + * + * + * @brief 查询和设置请求地址 + * + * + * @type String + */ + + address: string + + /** + * class prop + * + * + * @brief 查询和设置请求查询字符串 + * + * + * @type String + */ + + queryString: string + + /** + * class prop + * + * + * @brief 获取包含消息 cookies 的容器 + * + * @readonly + * @type HttpCollection + */ + + cookies: Class_HttpCollection + + /** + * class prop + * + * + * @brief 获取包含消息 form 的容器 + * + * @readonly + * @type HttpCollection + */ + + form: Class_HttpCollection + + /** + * class prop + * + * + * @brief 获取包含消息 query 的容器 + * + * @readonly + * @type HttpCollection + */ + + query: Class_HttpCollection + + + + /** + * + * @brief HttpRequest 构造函数,创建一个新的 HttpRequest 对象 + * + * + */ + constructor(); + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpResponse.d.ts b/types/fibjs/declare/HttpResponse.d.ts new file mode 100644 index 0000000000..7f69b8509a --- /dev/null +++ b/types/fibjs/declare/HttpResponse.d.ts @@ -0,0 +1,130 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 响应消息对象 + * @detail + */ +/// +declare class Class_HttpResponse extends Class_HttpMessage { + + /** + * class prop + * + * + * @brief 查询和设置响应消息的返回状态 + * + * + * @type Integer + */ + + statusCode: number + + /** + * class prop + * + * + * @brief 查询和设置响应消息的返回消息 + * + * + * @type String + */ + + statusMessage: string + + /** + * class prop + * + * + * @brief 返回当前消息的 HttpCookie 对象列表 + * + * @readonly + * @type NArray + */ + + cookies: any[] + + + + /** + * + * @brief HttpResponse 构造函数,创建一个新的 HttpResponse 对象 + * + * + */ + constructor(); + + /** + * + * @brief 设置响应消息的返回状态,返回消息,并添加响应头 + * @param statusCode 指定响应消息的返回状态 + * @param statusMessage 指定响应消息的返回消息 + * @param headers 指定响应消息添加的响应头 + * + * + * + */ + writeHead(statusCode: number, statusMessage: string, headers?: object/** = v8::Object::New(isolate)*/): void; + + /** + * + * @brief 设置响应消息的返回状态,返回消息,并添加响应头 + * @param statusCode 指定响应消息的返回状态 + * @param headers 指定响应消息添加的响应头 + * + * + * + */ + writeHead(statusCode: number, headers?: object/** = v8::Object::New(isolate)*/): void; + + /** + * + * @brief 向 cookies 添加一个 HttpCookie 对象 + * @param cookie 指定要添加的 HttpCookie 对象 + * + * + * + */ + addCookie(cookie: Class_HttpCookie): void; + + /** + * + * @brief 发送重定向到客户端 + * @param url 重定向的地址 + * + * + * + */ + redirect(url: string): void; + + /** + * + * @brief 仅发送格式化 http 头到给定的流对象 + * @param stm 指定接收格式化消息的流对象 + * + * + * @async + */ + sendHeader(stm: Class_Stream): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpServer.d.ts b/types/fibjs/declare/HttpServer.d.ts new file mode 100644 index 0000000000..75ba24c290 --- /dev/null +++ b/types/fibjs/declare/HttpServer.d.ts @@ -0,0 +1,162 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief http 服务器对象 + * @detail http 服务器对象是将 TcpServer 和 HttpHandler 组合封装的对象,方便快速搭建服务器,逻辑上相当于:,```JavaScript,var svr = new net.TcpServer(addr, port, new http.Handler(function(req){, ...,}));,```,,创建方法:,```JavaScript,var http = require("http");,var svr = new http.Server(80, function(req){, ...,});,``` + */ +/// +declare class Class_HttpServer extends Class_TcpServer { + + /** + * class prop + * + * + * @brief 查询和设置是否允强制使用 gzip 压缩输出,缺省为 false + * + * + * @type Boolean + */ + + forceGZIP: boolean + + /** + * class prop + * + * + * @brief 查询和设置最大请求头个数,缺省为 128 + * + * + * @type Integer + */ + + maxHeadersCount: number + + /** + * class prop + * + * + * @brief 查询和设置 body 最大尺寸,以 MB 为单位,缺省为 64 + * + * + * @type Integer + */ + + maxBodySize: number + + /** + * class prop + * + * + * @brief 查询和设置服务器名称,缺省为:fibjs/0.x.0 + * + * + * @type String + */ + + serverName: string + + /** + * class prop + * + * + * @brief 查询 http 协议转换处理器的工作状态 + * + * 返回的结果为一个 Stats 对象,结构如下: + * ```JavaScript + * { + * total : 1000, // 总计处理的请求 + * pendding : 100, // 当前正在处理的请求 + * request : 10, // 新建的请求 + * response : 10, // 发送的响应 + * error : 100, // 发生的错误(不计入 404) + * error_400 : 10, // 发生的请求错误 + * error_404 : 12, // 文件未找到的数量 + * error_500 : 2 // 内部处理错误 + * } + * ``` + * + * + * @readonly + * @type Stats + */ + + httpStats: Class_Stats + + + + /** + * + * @brief HttpServer 构造函数,在所有本机地址侦听 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(port: number, hdlr: Class_Handler); + + /** + * + * @brief HttpServer 构造函数 + * @param addr 指定 http 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(addr: string, port: number, hdlr: Class_Handler); + + /** + * + * @brief 设置错误处理器 + * + * 使用方式: + * ```JavaScript + * hdlr.onerror({ + * "404": function(v) + * { + * ... + * }, + * "500": new mq.Routing(...) + * }) + * ``` + * @param hdlrs 指定不同的错误的处理器,key 是错误号,value 是处理器,可以是内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + onerror(hdlrs: object): void; + + /** + * + * @brief 允许跨域请求 + * @param allowHeaders 指定接受的 http 头字段 + * + * + * + */ + enableCrossOrigin(allowHeaders?: string/** = "Content-Type"*/): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpUploadData.d.ts b/types/fibjs/declare/HttpUploadData.d.ts new file mode 100644 index 0000000000..9b3679c51b --- /dev/null +++ b/types/fibjs/declare/HttpUploadData.d.ts @@ -0,0 +1,81 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 包含 multipart 的一个条目数据 + * @detail + */ + +declare class Class_HttpUploadData extends Class__object { + + /** + * class prop + * + * + * @brief 包含本条目数据的文件名 + * + * @readonly + * @type String + */ + + fileName: string + + /** + * class prop + * + * + * @brief 包含本条目数据的类型 + * + * @readonly + * @type String + */ + + contentType: string + + /** + * class prop + * + * + * @brief 包含本条目数据的传输编码类型 + * + * @readonly + * @type String + */ + + contentTransferEncoding: string + + /** + * class prop + * + * + * @brief 包含本条目数据部分的流对象 + * + * @readonly + * @type SeekableStream + */ + + body: Class_SeekableStream + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/HttpsServer.d.ts b/types/fibjs/declare/HttpsServer.d.ts new file mode 100644 index 0000000000..d5f391c1b6 --- /dev/null +++ b/types/fibjs/declare/HttpsServer.d.ts @@ -0,0 +1,137 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief https 服务器对象 + * @detail https 服务器对象是将 SslServer 和 HttpHandler 组合封装的对象,方便快速搭建服务器,逻辑上相当于:,```JavaScript,var svr = new net.SslServer(crt, key, addr, port, new http.Handler(function(req){, ...,}));,```,,创建方法:,```JavaScript,var http = require("http");,var svr = new http.HttpsServer(crt, key, 443, function(req){, ...,});,``` + */ +/// +declare class Class_HttpsServer extends Class_HttpServer { + + /** + * class prop + * + * + * @brief 设定证书验证模式,缺省为 VERIFY_NONE + * + * + * @type Integer + */ + + verification: number + + /** + * class prop + * + * + * @brief 客户端证书验证 ca + * + * @readonly + * @type X509Cert + */ + + ca: Class_X509Cert + + + + /** + * + * @brief HttpsServer 构造函数,在所有本机地址侦听 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 + * + * + * + */ + constructor(certs: any[], port: number, hdlr: Class_Handler); + + /** + * + * @brief HttpsServer 构造函数 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * @param addr 指定 http 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 + * + * + * + */ + constructor(certs: any[], addr: string, port: number, hdlr: Class_Handler); + + /** + * + * @brief HttpsServer 构造函数,在所有本机地址侦听 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey, port: number, hdlr: Class_Handler); + + /** + * + * @brief HttpsServer 构造函数 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * @param addr 指定 http 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 http 服务器侦听端口 + * @param hdlr http 内置消息处理器,处理函数,链式处理数组,路由对象,详见 + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey, addr: string, port: number, hdlr: Class_Handler); + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Image.d.ts b/types/fibjs/declare/Image.d.ts new file mode 100644 index 0000000000..272eb49505 --- /dev/null +++ b/types/fibjs/declare/Image.d.ts @@ -0,0 +1,856 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + + + +/** module Or Internal Object */ +/** + * @brief 图像处理对象,用以对图像进行转换,绘制,存储等操作 + * @detail Image 对象属于 gd 模块,创建:,```JavaScript,var img = gd.create(640, 480);,var img1 = gd.load(data);,``` + */ + +declare class Class_Image extends Class__object { + + /** + * class prop + * + * + * @brief 查询图像宽度 + * + * @readonly + * @type Integer + */ + + width: number + + /** + * class prop + * + * + * @brief 查询图像高度 + * + * @readonly + * @type Integer + */ + + height: number + + /** + * class prop + * + * + * @brief 查询图像来源格式,结果为 gd.PNG, gd.JPEG, gd.GIF, gd.BMP, gd.WEBP + * + * @readonly + * @type Integer + */ + + format: number + + /** + * class prop + * + * + * @brief 查询图像类型,结果为 gd.TRUECOLOR, gd.PALETTE + * + * @readonly + * @type Integer + */ + + type: number + + /** + * class prop + * + * + * @brief 查询图像颜色表内的颜色总数 + * + * @readonly + * @type Integer + */ + + colorsTotal: number + + /** + * class prop + * + * + * @brief 查询和设定指定的颜色为透明色 + * + * + * @type Integer + */ + + transparent: number + + /** + * class prop + * + * + * @brief 查询和设定图像是否渐进式,仅支持 jpeg 格式时 + * + * + * @type Boolean + */ + + progressive: boolean + + /** + * class prop + * + * + * @brief查询和设定绘图时是否计算 alpha 层,缺省为 true + * + * + * @type Boolean + */ + + alphaBlending: boolean + + + + /** + * + * @brief 按照指定的格式返回图像数据 + * @param format 指定返回数据的格式,允许值为 gd.PNG, gd.JPEG, gd.GIF, gd.BMP, gd.WEBP, 缺省为 gd.PNG + * @param quality 当格式为 gd.JPEG 或 gd.WEBP 时用于指定压缩质量,缺省为 85,其他格式忽略此参数 + * @return 返回格式化的数据 + * + * + * @async + */ + getData(format?: number/** = undefined*/, quality?: number/** = 85*/): Class_Buffer; + + /** + * + * @brief 按照指定的格式将图像数据存入流对象 + * @param stm 指定要存入的流对象 + * @param format 指定返回数据的格式,允许值为 gd.PNG, gd.JPEG, gd.GIF, gd.BMP, gd.WEBP, 缺省为 gd.PNG + * @param quality 当格式为 gd.JPEG 或 gd.WEBP 时用于指定压缩质量,缺省为 85,其他格式忽略此参数 + * + * + * @async + */ + save(stm: Class_Stream, format?: number/** = undefined*/, quality?: number/** = 85*/): void; + + /** + * + * @brief 按照指定的格式将图像数据存入指定文件,文件将被强制覆盖 + * @param fname 指定文件名 + * @param format 指定返回数据的格式,允许值为 gd.PNG, gd.JPEG, gd.GIF, gd.BMP, gd.WEBP, 缺省为 gd.PNG + * @param quality 当格式为 gd.JPEG 时用于指定压缩质量,缺省为 85,其他格式忽略此参数 + * + * + * @async + */ + save(fname: string, format?: number/** = undefined*/, quality?: number/** = 85*/): void; + + /** + * + * @brief 为指定的颜色申请一个颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorAllocate(red: number, green: number, blue: number): number; + + /** + * + * @brief 为指定的颜色申请一个颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorAllocate(color: number): number; + + /** + * + * @brief 为指定的颜色及透明申请一个颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @param alpha 透明分量,范围为 0-1.0 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorAllocateAlpha(red: number, green: number, blue: number, alpha: number): number; + + /** + * + * @brief 为指定的颜色及透明申请一个颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorAllocateAlpha(color: number): number; + + /** + * + * @brief 为指定的颜色查找一个最接近的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosest(red: number, green: number, blue: number): number; + + /** + * + * @brief 为指定的颜色查找一个最接近的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosest(color: number): number; + + /** + * + * @brief 为指定的颜色查找一个最接近的颜色号,此方法使用 Hue/White/Black 计算查找最接近颜色,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosestHWB(red: number, green: number, blue: number): number; + + /** + * + * @brief 为指定的颜色查找一个最接近的颜色号,此方法使用 Hue/White/Black 计算查找最接近颜色,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosestHWB(color: number): number; + + /** + * + * @brief 为指定的颜色及透明查找一个最接近的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @param alpha 透明分量,范围为 0-1.0 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosestAlpha(red: number, green: number, blue: number, alpha: number): number; + + /** + * + * @brief 为指定的颜色及透明查找一个最接近的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorClosestAlpha(color: number): number; + + /** + * + * @brief 查找指定的颜色对应的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorExact(red: number, green: number, blue: number): number; + + /** + * + * @brief 查找指定的颜色对应的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorExact(color: number): number; + + /** + * + * @brief 查找指定的颜色及透明对应的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @param alpha 透明分量,范围为 0-1.0 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorExactAlpha(red: number, green: number, blue: number, alpha: number): number; + + /** + * + * @brief 查找指定的颜色及透明对应的颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorExactAlpha(color: number): number; + + /** + * + * @brief 查找指定的颜色对应的颜色号,如果颜色不存在,则为其申请一个新颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorResolve(red: number, green: number, blue: number): number; + + /** + * + * @brief 查找指定的颜色对应的颜色号,如果颜色不存在,则为其申请一个新颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgb 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorResolve(color: number): number; + + /** + * + * @brief 查找指定的颜色及透明对应的颜色号,如果颜色不存在,则为其申请一个新颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @param alpha 透明分量,范围为 0-1.0 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorResolveAlpha(red: number, green: number, blue: number, alpha: number): number; + + /** + * + * @brief 查找指定的颜色及透明对应的颜色号,如果颜色不存在,则为其申请一个新颜色号,对于 gd.PALETTE 图像,颜色号为调色板索引,对于 gd.TRUECOLOR 图像,颜色号为 rgba 编码数值 + * @param color 组合颜色值,可由 gd.color, gb.rgb, gd.rgba 等函数生成 + * @return 返回颜色号,不成功返回 -1 + * + * + * + */ + colorResolveAlpha(color: number): number; + + /** + * + * @brief 释放指定的颜色号,释放的颜色号将会被再次申请后替换 + * @param color 指定要释放的颜色号 + * + * + * + */ + colorDeallocate(color: number): void; + + /** + * + * @brief 设定绘图的剪切窗口,设定后,所有的绘制将被剪切在窗口内部 + * @param x1 剪切窗口的左上 x 坐标 + * @param y1 剪切窗口的左上 y 坐标 + * @param x2 剪切窗口的右下 x 坐标 + * @param y2 剪切窗口的右下 y 坐标 + * + * + * + */ + clip(x1: number, y1: number, x2: number, y2: number): void; + + /** + * + * @brief 查询指定位置点的颜色 + * @param x 指定查询的 x 坐标 + * @param y 指定查询的 y 坐标 + * @return 返回指定点的颜色号 + * + * + * + */ + getPixel(x: number, y: number): number; + + /** + * + * @brief 查询指定位置点的真彩色颜色 + * @param x 指定查询的 x 坐标 + * @param y 指定查询的 y 坐标 + * @return 返回指定点的颜色号 + * + * + * + */ + getTrueColorPixel(x: number, y: number): number; + + /** + * + * @brief 在指定位置画一个点 + * @param x 指定画点的 x 坐标 + * @param y 指定画点的 y 坐标 + * @param color 指定画点的颜色号 + * + * + * + */ + setPixel(x: number, y: number, color: number): void; + + /** + * + * @brief 设定画线的宽度,line, rectangle, arc 等方法画线时缺省宽度为一个像素,可使用此方法改变线的宽度 + * @param thickness 画线的宽度 + * + * + * + */ + setThickness(thickness: number): void; + + /** + * + * @brief 在指定的位置画一条线 + * @param x1 指定画线的起始 x 坐标 + * @param y1 指定画线的起始 y 坐标 + * @param x2 指定画线的结束 x 坐标 + * @param y2 指定画线的结束 y 坐标 + * @param color 指定画线的颜色号 + * + * + * + */ + line(x1: number, y1: number, x2: number, y2: number, color: number): void; + + /** + * + * @brief 在指定的位置画一个矩形 + * @param x1 指定左上角 x 坐标 + * @param y1 指定左上角 y 坐标 + * @param x2 指定右下角 x 坐标 + * @param y2 指定右下角 y 坐标 + * @param color 指定矩形的颜色号 + * + * + * + */ + rectangle(x1: number, y1: number, x2: number, y2: number, color: number): void; + + /** + * + * @brief 在指定的位置画一个填充的矩形 + * @param x1 指定左上角 x 坐标 + * @param y1 指定左上角 y 坐标 + * @param x2 指定右下角 x 坐标 + * @param y2 指定右下角 y 坐标 + * @param color 指定矩形的颜色号 + * + * + * + */ + filledRectangle(x1: number, y1: number, x2: number, y2: number, color: number): void; + + /** + * + * @brief 根据给定的点绘制一个多边形 + * @param points 包含多边形点的数组,如 [[1, 1], [1, 10], [10, 15], [10, 20]] + * @param color 指定矩形的颜色号 + * + * + * + */ + polygon(points: any[], color: number): void; + + /** + * + * @brief 根据给定的点绘制一个开放多边形 + * @param points 包含多边形点的数组,如 [[1, 1], [1, 10], [10, 15], [10, 20]] + * @param color 指定矩形的颜色号 + * + * + * + */ + openPolygon(points: any[], color: number): void; + + /** + * + * @brief 根据给定的点绘制一个填充多边形 + * @param points 包含多边形点的数组,如 [[1, 1], [1, 10], [10, 15], [10, 20]] + * @param color 指定矩形的颜色号 + * + * + * + */ + filledPolygon(points: any[], color: number): void; + + /** + * + * @brief 画一个椭圆 + * @param x 椭圆中心的 x 坐标 + * @param y 椭圆中心的 y 坐标 + * @param width 椭圆的宽度 + * @param height 椭圆的高度 + * @param color 指定矩形的颜色号 + * + * + * + */ + ellipse(x: number, y: number, width: number, height: number, color: number): void; + + /** + * + * @brief 画一个填充的椭圆 + * @param x 椭圆中心的 x 坐标 + * @param y 椭圆中心的 y 坐标 + * @param width 椭圆的宽度 + * @param height 椭圆的高度 + * @param color 指定矩形的颜色号 + * + * + * + */ + filledEllipse(x: number, y: number, width: number, height: number, color: number): void; + + /** + * + * @brief 画一个扇形 + * @param x 扇形中心的 x 坐标 + * @param y 扇形中心的 y 坐标 + * @param width 扇形所在椭圆的宽度 + * @param height 扇形所在椭圆的高度 + * @param start 扇形开始的角度,范围为 0-360 + * @param end 扇形结束的角度,范围为 0-360 + * @param color 指定矩形的颜色号 + * + * + * + */ + arc(x: number, y: number, width: number, height: number, start: number, end: number, color: number): void; + + /** + * + * @brief 画一个填充扇形 + * @param x 扇形中心的 x 坐标 + * @param y 扇形中心的 y 坐标 + * @param width 扇形所在椭圆的宽度 + * @param height 扇形所在椭圆的高度 + * @param start 扇形开始的角度,范围为 0-360 + * @param end 扇形结束的角度,范围为 0-360 + * @param color 指定矩形的颜色号 + * @param style 指定扇形的样式,允许的值有 gd.ARC, gd.CHORD, gd.NOFILL, gd.EDGED 及其组合 + * + * + * + */ + filledArc(x: number, y: number, width: number, height: number, start: number, end: number, color: number, style?: number/** = undefined*/): void; + + /** + * + * @brief 从指定的点开始填充封闭区域 + * @param x 开始填充的 x 坐标 + * @param y 开始填充的 y 坐标 + * @param color 指定填充的颜色号 + * + * + * + */ + fill(x: number, y: number, color: number): void; + + /** + * + * @brief 从指定的点开始在指定颜色的边框内填充封闭区域 + * @param x 开始填充的 x 坐标 + * @param y 开始填充的 y 坐标 + * @param borderColor 指定边框的颜色号 + * @param color 指定填充的颜色号 + * + * + * + */ + fillToBorder(x: number, y: number, borderColor: number, color: number): void; + + /** + * + * @brief 替换图像中指定的颜色为新颜色 + * @param src 指定要替换的颜色 + * @param dst 指定新颜色 + * + * + * @async + */ + colorReplace(src: number, dst: number): void; + + /** + * + * @brief 复制当前图像为一个新图像 + * @return 返回复制的新图像对象 + * + * + * @async + */ + clone(): Class_Image; + + /** + * + * @brief 根据图像拉伸生成一个新尺寸的图像 + * @param width 指定拉伸的宽度 + * @param height 指定拉伸的高度 + * @return 返回新图像对象 + * + * + * @async + */ + resample(width: number, height: number): Class_Image; + + /** + * + * @brief 剪切图像的一部分为一个新的图像 + * @param x 剪切窗口的左上 x 坐标 + * @param y 剪切窗口的左上 y 坐标 + * @param width 剪切窗口的宽度 + * @param height 剪切窗口的高度 + * @return 返回剪切出的图像 + * + * + * @async + */ + crop(x: number, y: number, width: number, height: number): Class_Image; + + /** + * + * @brief 镜像当前图像 + * @param dir 镜像方向,允许值为 gd.BOTH,gd.HORIZONTAL, gd.VERTICAL, 缺省为 gd.HORIZONTAL + * + * + * @async + */ + flip(dir?: number/** = undefined*/): void; + + /** + * + * @brief 旋转当前图像 + * @param dir 旋转方向,允许值为 gd.LEFT, gd.RIGHT + * + * + * @async + */ + rotate(dir: number): void; + + /** + * + * @brief 转换当前图像类型 + * @param color 指定图像类型,允许值为 gd.TRUECOLOR 或 gd.PALETTE + * + * + * @async + */ + convert(color?: number/** = undefined*/): void; + + /** + * + * @brief 从一个图像中复制一个区域到指定的位置 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param width 指定复制的宽度 + * @param height 指定复制的高度 + * + * + * @async + */ + copy(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, width: number, height: number): void; + + /** + * + * @brief 从一个图像中复制一个区域覆盖到指定的位置 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param width 指定复制的宽度 + * @param height 指定复制的高度 + * @param percent 指定覆盖的透明度 + * + * + * @async + */ + copyMerge(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, width: number, height: number, percent: number): void; + + /** + * + * @brief 从一个图像中复制一个区域的灰度覆盖到指定的位置 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param width 指定复制的宽度 + * @param height 指定复制的高度 + * @param percent 指定覆盖的透明度 + * + * + * @async + */ + copyMergeGray(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, width: number, height: number, percent: number): void; + + /** + * + * @brief 将一个图像中的一个区域拉伸后复制到指定的位置 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param dstW 指定复制的拉伸宽度 + * @param dstH 指定复制的拉伸高度 + * @param srcW 指定复制的源宽度 + * @param srcH 指定复制的源高度 + * + * + * @async + */ + copyResized(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, dstW: number, dstH: number, srcW: number, srcH: number): void; + + /** + * + * @brief 将一个图像中的一个区域拉伸后复制到指定的位置,不同与 copyResized,此方法拉伸时会对图像进行抖动 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param dstW 指定复制的拉伸宽度 + * @param dstH 指定复制的拉伸高度 + * @param srcW 指定复制的源宽度 + * @param srcH 指定复制的源高度 + * + * + * @async + */ + copyResampled(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, dstW: number, dstH: number, srcW: number, srcH: number): void; + + /** + * + * @brief 将一个图像中的一个区域旋转后复制到指定的位置 + * @param source 源图像对象 + * @param dstX 指定复制目标的 x 坐标 + * @param dstY 指定复制目标的 y 坐标 + * @param srcX 指定复制源左上角的 x 坐标 + * @param srcY 指定复制源左上角的 y 坐标 + * @param width 指定复制的宽度 + * @param height 指定复制的高度 + * @param angle 指定旋转的角度 + * + * + * @async + */ + copyRotated(source: Class_Image, dstX: number, dstY: number, srcX: number, srcY: number, width: number, height: number, angle: number): void; + + /** + * + * @brief 把过滤器 filterType应用到图像上,根据过滤器类型传入所需参数 + * + * 参数 filterType 可以为以下数值: + * - MEAN_REMOVAL, 用平均移除法来达到轮廓效果 + * - EDGEDETECT, 用边缘检测来突出图像的边缘 + * - EMBOSS, 使图像浮雕化 + * - SELECTIVE_BLUR, 模糊图像 + * - GAUSSIAN_BLUR, 用高斯算法模糊图像 + * - NEGATE, 将图像中所有颜色反转 + * - GRAYSCALE, 将图像转换为灰度图 + * - SMOOTH, 使图像更柔滑,用arg1设定柔滑级别 + * - BRIGHTNESS, 改变图像的亮度,用arg1设定亮度级别,取值范围是-255~255 + * - CONTRAST, 改变图像的对比度,用arg1设定对比度级别,取值范围是0~100 + * - COLORIZE, 改变图像的色调,用arg1、arg2、arg3分别指定red、blue、green分值,每种颜色范围是0~255,arg4为透明度,取值返回是0~127 + * @param filterType 过滤器类型 + * @param arg1 过滤器所需参数: SMOOTH 的平滑级别、BRIGHTNESS 的亮度级别、CONTRAST 的对比度级别、COLORIZE 的 red 分值 + * @param arg2 过滤器所需参数: COLORIZE 的 green 分值 + * @param arg3 过滤器所需参数: COLORIZE 的 blue 分值 + * @param arg4 过滤器所需参数: COLORIZE 的透明度 alpha 分值 + * + * + * @async + */ + filter(filterType: number, arg1?: number/** = 0*/, arg2?: number/** = 0*/, arg3?: number/** = 0*/, arg4?: number/** = 0*/): void; + + /** + * + * @brief 根据给定的矩阵,对当前图像进行仿射 + * + * 参数 affine 是一个数组: + * ```JavaScript + * affine = [ a0, a1, b0, b1, a2, b2 ]; + * x' = a0x + a1y + a2; + * y' = b0x + b1y + b2; + * ``` + * @param affine 仿射矩阵,由 6 个 double 类型的数字组成 + * @param x 可选剪切区域的原点 x 坐标 + * @param y 可选剪切区域的原点 y 坐标 + * @param width 可选剪切区域的的宽度 + * @param height 可选剪切区域的的高度 + * @return 返回仿射后的图像 + * + * + * @async + */ + affine(affine: any[], x?: number/** = -1*/, y?: number/** = -1*/, width?: number/** = -1*/, height?: number/** = -1*/): Class_Image; + + /** + * + * @brief 对当前图像进行高斯模糊处理 + * @param radius 模糊半径 + * + * + * @async + */ + gaussianBlur(radius: number): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Int64.d.ts b/types/fibjs/declare/Int64.d.ts new file mode 100644 index 0000000000..898fe5c675 --- /dev/null +++ b/types/fibjs/declare/Int64.d.ts @@ -0,0 +1,241 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 64位整数对象 + * @detail 创建方法:,```JavaScript,var n = new Int64(123);,``` + */ + +declare class Class_Int64 extends Class__object { + + /** + * class prop + * + * + * @brief 高 32 位数值 + * + * + * @type Long + */ + + hi: number + + /** + * class prop + * + * + * @brief 低 32 位数值 + * + * + * @type Long + */ + + lo: number + + + + /** + * + * @brief Int64 构造函数 + * @param num 初始化的值 + * + * + * + */ + constructor(num?: number/** = 0*/); + + /** + * + * @brief Int64 构造函数 + * @param hi 高32位数 + * @param lo 低32位数 + * + * + * + */ + constructor(hi: number, lo: number); + + /** + * + * @brief Int64 构造函数 + * @param num 初始化的值 + * + * + * + */ + constructor(num: Class_Int64); + + /** + * + * @brief Int64 构造函数 + * @param num 数字字符串 + * @param base 数字字符串的编码方式,可以接受 2-16, 32, 64,默认为 10,为 10 时自动识别 0x 编码 + * + * + * + */ + constructor(num: string, base?: number/** = 10*/); + + /** + * + * @brief 将 Int64 内的数值与给定数值比较大小 + * @param num 指定比较的数值 + * @return 返回 1 表示 Int64 内的数值比指定数值更大,0 表示相等,-1 表示更小 + * + * + * + */ + compare(num: Class_Int64): number; + + /** + * + * @brief 将 Int64 内的数值左移相应的位数,此操作不影响 Int64 原有数值 + * @param bits 指定移动的位数 + * @return 返回包含移位以后数值的对象 + * + * + * + */ + shiftLeft(bits: number): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值右移相应的位数,此操作不影响 Int64 原有数值 + * @param bits 指定移动的位数 + * @return 返回包含移位以后数值的对象 + * + * + * + */ + shiftRight(bits: number): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行按位 and 操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + and(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行按位 or 操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + or(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行按位 xor 操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + xor(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行加操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + add(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行减操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + sub(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行乘操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + multi(num: Class_Int64): Class_Int64; + + /** + * + * @brief 将 Int64 内的数值与给定的数值进行除操作,此操作不影响 Int64 原有数值 + * @param num 指定运算的数值 + * @return 返回包含预算以后数值的对象 + * + * + * + */ + div(num: Class_Int64): Class_Int64; + + /** + * + * @brief 比较当前对象与给定的对象是否相等 + * @param expected 制定比较的目标对象 + * @return 返回对象比较的结果 + * + * + * + */ + equals(expected: Class__object): boolean; + + /** + * + * @brief 转换成数字类型 + * @return 返回转换后的数字 + * + * + * + */ + toNumber(): number; + + /** + * + * @brief 转换成字符串类型 + * @param base 字符串进制数,可以接受 2-16, 32, 64,默认为 10 + * @return 返回转换后的字符串 + * + * + * + */ + toString(base?: number/** = 10*/): string; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/LevelDB.d.ts b/types/fibjs/declare/LevelDB.d.ts new file mode 100644 index 0000000000..c9721bf337 --- /dev/null +++ b/types/fibjs/declare/LevelDB.d.ts @@ -0,0 +1,176 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief LevelDB 数据库对象 + * @detail 用以创建和管理字典对象,创建方法:,```JavaScript,var db = require("db");,var test = new db.openLevelDB("test.db");,``` + */ + +declare class Class_LevelDB extends Class__object { + + + + /** + * + * @brief 检查数据库内是否存在指定键值的数据 + * @param key 指定要检查的键值 + * @return 返回键值是否存在 + * + * + * @async + */ + has(key: Class_Buffer): boolean; + + /** + * + * @brief 查询指定键值的值 + * @param key 指定要查询的键值 + * @return 返回键值所对应的值,若不存在,则返回 null + * + * + * @async + */ + get(key: Class_Buffer): Class_Buffer; + + /** + * + * @brief 查询一组指定键值的值 + * @param keys 指定要查询的键值数组 + * @return 返回包含键值得数组 + * + * + * + */ + mget(keys: any[]): any[]; + + /** + * + * @brief 设定一个键值数据,键值不存在则插入新数据 + * @param key 指定要设定的键值 + * @param value 指定要设定的数据 + * + * + * @async + */ + set(key: Class_Buffer, value: Class_Buffer): void; + + /** + * + * @brief 设定一组键值数据,键值不存在则插入新数据 + * @param map 指定要设定的键值数据字典 + * + * + * + */ + mset(map: object): void; + + /** + * + * @brief 删除一组指定键值的值 + * @param keys 指定要删除的键值数组 + * + * + * + */ + mremove(keys: any[]): void; + + /** + * + * @brief 删除指定键值的全部值 + * @param key 指定要删除的键值 + * + * + * @async + */ + remove(key: Class_Buffer): void; + + /** + * + * @brief 枚举数据库中所有的键值对 + * + * 回调函数有两个参数,(value, key) + * + * ```JavaScript + * var db = require("db"); + * var test = new db.openLevelDB("test.db"); + * + * test.forEach(function(value, key){ + * ... + * }); + * ``` + * @param func 枚举回调函数 + * + * + * + */ + forEach(func: Function): void; + + /** + * + * @brief 枚举数据库中键值在 from 和 to 之间的键值对 + * + * 回调函数有两个参数,(value, key) + * + * ```JavaScript + * var db = require("db"); + * var test = new db.openLevelDB("test.db"); + * + * test.between("aaa", "bbb", function(value, key){ + * ... + * }); + * ``` + * @param from 枚举的最小键值,枚举时包含此键值 + * @param to 枚举的最大键值,枚举时不包含此键值 + * @param func 枚举回调函数 + * + * + * + */ + between(from: Class_Buffer, to: Class_Buffer, func: Function): void; + + /** + * + * @brief 在当前数据库上开启一个事务 + * @return 返回一个开启的事务对象 + * + * + */ + begin(): Class_LevelDB; + + /** + * + * @brief 提交当前事务 + * + * + */ + commit(): void; + + /** + * + * @brief 关闭当前数据库连接或事务 + * + * @async + */ + close(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Lock.d.ts b/types/fibjs/declare/Lock.d.ts new file mode 100644 index 0000000000..cb8a7d38d8 --- /dev/null +++ b/types/fibjs/declare/Lock.d.ts @@ -0,0 +1,79 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 纤程锁对象 + * @detail 不同于操作系统的锁,纤程锁是纯逻辑实现,加锁与解锁负荷很小,```JavaScript,var l = new coroutine.Lock();,l.acquire();,.....,l.release();,``` + */ + +declare class Class_Lock extends Class__object { + + + + /** + * + * @brief 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 获取锁的拥有权 + * + * acquire 方法用于获取锁的拥有权,当锁处于可获取状态时,此方法立即返回 true。 + * + * 当锁不可获取,且 blocking 为 true,则当前纤程进入休眠,当其他纤程释放锁后,此方法返回 true。 + * + * 当锁不可获取,且 blocking 为 false,则方法返回 false。 + * @param blocking 指定是否等待,为 true 时等待,缺省为真 + * @return 返回是否成功获取锁,为 true 表示成功获取 + * + * + * + */ + acquire(blocking?: boolean/** = true*/): boolean; + + /** + * + * @brief 释放锁的拥有权 + * + * 此方法将释放对锁的拥有权,如果当前纤程未拥有锁,此方法将抛出错误。 + * + * + * + */ + release(): void; + + /** + * + * @brief 查询当前等待任务数 + * @return 返回任务数 + * + * + * + */ + count(): number; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/LruCache.d.ts b/types/fibjs/declare/LruCache.d.ts new file mode 100644 index 0000000000..f68ac413cd --- /dev/null +++ b/types/fibjs/declare/LruCache.d.ts @@ -0,0 +1,163 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief LRU(least recently used) 缓存对象 + * @detail LruCache 用以维护一个 LRU 缓存,创建方法:,```JavaScript,var util = require("util");,var c = new util.LruCache(10, 100);,``` + */ +/// +declare class Class_LruCache extends Class_EventEmitter { + + /** + * class prop + * + * + * @brief 查询容器内数值个数 + * + * @readonly + * @type Integer + */ + + size: number + + /** + * class prop + * + * + * @brief 查询和设置容器内元素失效时间,单位是 ms,小于等于 0 不失效 + * + * + * @type Integer + */ + + timeout: number + + /** + * class prop + * + * + * @brief 查询和绑定数据超时事件,相当于 on("expire", func); + * + * + * @type Function + */ + + onexpire: Function + + + + /** + * + * @brief LruCache 对象构造函数 + * @param size 缓存最大尺寸 + * @param timeout 元素失效时间,单位是 ms,小于等于 0 不失效,缺省为 0 + * + * + * + */ + constructor(size: number, timeout?: number/** = 0*/); + + /** + * + * @brief 清除容器数据 + * + * + */ + clear(): void; + + /** + * + * @brief 检查容器内是否存在指定键值的数据 + * @param name 指定要检查的键值 + * @return 返回键值是否存在 + * + * + * + */ + has(name: string): boolean; + + /** + * + * @brief 查询指定键值的值 + * @param name 指定要查询的键值 + * @return 返回键值所对应的值,若不存在,则返回 undefined + * + * + * + */ + get(name: string): any; + + /** + * + * @brief 查询指定键值的值,若不存在或过期,则调用回调函数更新数据 + * @param name 指定要查询的键值 + * @param updater 指定更新函数 + * @return 返回键值所对应的值 + * + * + * + */ + get(name: string, updater: Function): any; + + /** + * + * @brief 设定一个键值数据,键值不存在则插入一条新数据 + * @param name 指定要设定的键值 + * @param value 指定要设定的数据 + * + * + * + */ + set(name: string, value: any): void; + + /** + * + * @brief 设定一个键值数据,键值不存在则插入新数据 + * @param map 指定要设定的键值数据字典 + * + * + * + */ + set(map: object): void; + + /** + * + * @brief 删除指定键值的全部值 + * @param name 指定要删除的键值 + * + * + * + */ + remove(name: string): void; + + /** + * + * @brief 检查容器是否为空 + * @return 容器内无数值则返回 true + * + * + * + */ + isEmpty(): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MSSQL.d.ts b/types/fibjs/declare/MSSQL.d.ts new file mode 100644 index 0000000000..722ebbf448 --- /dev/null +++ b/types/fibjs/declare/MSSQL.d.ts @@ -0,0 +1,43 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief SQL Server 数据库连接对象 + * @detail 使用 db.open 或 db.openMySQL 创建,创建方式:,```JavaScript,var sql = db.openMSSQL("mssql://user:pass@host/db");,``` + */ +/// +declare class Class_MSSQL extends Class_DbConnection { + + + + /** + * + * @brief 选择当前数据库连接的缺省数据库 + * @param dbName 指定数据库名 + * + * + * @async + */ + use(dbName: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MemoryStream.d.ts b/types/fibjs/declare/MemoryStream.d.ts new file mode 100644 index 0000000000..2d707f48a9 --- /dev/null +++ b/types/fibjs/declare/MemoryStream.d.ts @@ -0,0 +1,69 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 内存流对象 + * @detail MemoryStream 对象创建一个基于内存的流对象,创建方法:,```JavaScript,var ms = new io.MemoryStream();,``` + */ +/// +declare class Class_MemoryStream extends Class_SeekableStream { + + + + /** + * + * @brief MemoryStream 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 强制设定内存流对象的最后更新时间 + * @param d 指定要设定的时间 + * + * + * + */ + setTime(d: Date): void; + + /** + * + * @brief 创建当前内存流的一个只读副本 + * @return 返回只读的内存流对象 + * + * + * + */ + clone(): Class_MemoryStream; + + /** + * + * @brief 清空内存文件数据,复位指针 + * + * + */ + clear(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Message.d.ts b/types/fibjs/declare/Message.d.ts new file mode 100644 index 0000000000..efefee9105 --- /dev/null +++ b/types/fibjs/declare/Message.d.ts @@ -0,0 +1,235 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 基础消息对象 + * @detail Message 对象兼容于 mq 各个模块,可用于构建自定义消息处理系统,创建方法:,```JavaScript,var mq = require("mq");,var m = new mq.Message();,``` + */ + +declare class Class_Message extends Class__object { + + /** + * class prop + * + * + * @brief 消息的基本内容 + * + * + * @type String + */ + + value: string + + /** + * class prop + * + * + * @brief 消息的基本参数 + * + * @readonly + * @type NArray + */ + + params: any[] + + /** + * class prop + * + * + * @brief 消息类型 + * + * + * @type Integer + */ + + type: number + + /** + * class prop + * + * + * @brief 查询消息的数据 + * + * @readonly + * @type Value + */ + + data: any + + /** + * class prop + * + * + * @brief 包含消息数据部分的流对象 + * + * + * @type SeekableStream + */ + + body: Class_SeekableStream + + /** + * class prop + * + * + * @brief 消息数据部分的长度 + * + * @readonly + * @type Long + */ + + length: number + + /** + * class prop + * + * + * @brief 查询消息 readFrom 时的流对象 + * + * @readonly + * @type Stream + */ + + stream: Class_Stream + + /** + * class prop + * + * + * @brief 查询和设置消息处理的最后错误 + * + * + * @type String + */ + + lastError: string + + + + /** + * + * @brief 消息对象构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 从流内读取指定大小的数据,此方法为 body 相应方法的别名 + * @param bytes 指定要读取的数据量,缺省为读取随机大小的数据块,读出的数据尺寸取决于设备 + * @return 返回从流内读取的数据,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + read(bytes?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 从流内读取剩余的全部数据,此方法为 body 相应方法的别名 + * @return 返回从流内读取的数据,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + readAll(): Class_Buffer; + + /** + * + * @brief 写入给定的数据,此方法为 body 相应方法的别名 + * @param data 给定要写入的数据 + * + * + * @async + */ + write(data: Class_Buffer): void; + + /** + * + * @brief 以 JSON 编码写入给定的数据 + * @param data 给定要写入的数据 + * @return 此方法不会返回数据 + * + * + * + */ + json(data: any): any; + + /** + * + * @brief 以 JSON 编码解析消息中的数据 + * @return 返回解析的结果 + * + * + * + */ + json(): any; + + /** + * + * @brief 设置当前消息处理结束,Chain 处理器不再继续后面的事务 + * + * + */ + end(): void; + + /** + * + * @brief 查询当前消息是否结束 + * @return 结束则返回 true + * + * + * + */ + isEnded(): boolean; + + /** + * + * @brief 清除消息的内容 + * + * + */ + clear(): void; + + /** + * + * @brief 发送格式化消息到给定的流对象 + * @param stm 指定接收格式化消息的流对象 + * + * + * @async + */ + sendTo(stm: Class_Stream): void; + + /** + * + * @brief 从给定的缓存流对象中读取格式化消息,并解析填充对象 + * @param stm 指定读取格式化消息的流对象 + * + * + * @async + */ + readFrom(stm: Class_Stream): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MongoCollection.d.ts b/types/fibjs/declare/MongoCollection.d.ts new file mode 100644 index 0000000000..e721feabcd --- /dev/null +++ b/types/fibjs/declare/MongoCollection.d.ts @@ -0,0 +1,227 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief mongodb 数据库数据集对象 + * @detail 使用 MongoDB.getCollection 创建:,```JavaScript,var col1 = mdb.getCollection('test');,var col = mdb.test;,``` + */ + +declare class Class_MongoCollection extends Class__object { + + + + /** + * + * @brief 根据给定的查询条件和返回字段设定,建立游标对象 + * @param query 指定查询条件的对象 + * @param projection 指定返回字段的对象 + * @return 返回游标对象 + * + * + * + */ + find(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): Class_MongoCursor; + + /** + * + * @brief 根据给定的查询条件和返回字段设定,查询一条结果 + * @param query 指定查询条件的对象 + * @param projection 指定返回字段的对象 + * @return 返回第一条结果 + * + * + * + */ + findOne(query?: object/** = v8::Object::New(isolate)*/, projection?: object/** = v8::Object::New(isolate)*/): object; + + /** + * + * @brief 查询并修改 + * @param query 指定查询条件,修改数据 + * @return 返回修改前的结果及其他信息 + * + * + * + */ + findAndModify(query: object): object; + + /** + * + * @brief 插入一组数据 + * @param documents 指定要插入的数据数组 + * + * + * + */ + insert(documents: any[]): void; + + /** + * + * @brief 插入一条数据 + * @param document 指定要插入的数据 + * + * + * + */ + insert(document: object): void; + + /** + * + * @brief 保存一条数据,若数据包含 _id 字段,则为更新,否则为插入 + * @param document 指定要保存的数据 + * + * + * + */ + save(document: object): void; + + /** + * + * @brief 根据给定的查询条件更新数据 + * @param query 指定查询条件的对象 + * @param document 指定要更新的数据 + * @param upsert 数据不存在时,插入一条新数据,缺省为 false,不插入 + * @param multi 当符合条件的数据多于一条时,更新所有数据,缺省为 false,只更新第一条 + * + * + * + */ + update(query: object, document: object, upsert?: boolean/** = false*/, multi?: boolean/** = false*/): void; + + /** + * + * @brief 根据给定的查询条件更新数据 + * @param query 指定查询条件的对象 + * @param document 指定要更新的数据 + * @param options 以对象字段传递的 upsert 和 multi 选项 + * + * + * + */ + update(query: object, document: object, options: object): void; + + /** + * + * @brief 根据给定的查询条件删除数据 + * @param query 指定查询条件的对象 + * + * + * + */ + remove(query: object): void; + + /** + * + * @brief 执行数据库命令 + * @param cmd 给定命令对象 + * @return 返回命令返回结果 + * + * + * + */ + runCommand(cmd: object): object; + + /** + * + * @brief 执行数据库命令 + * @param cmd 给定命令名称 + * @param arg 给定命令参数选项 + * @return 返回命令返回结果 + * + * + * + */ + runCommand(cmd: string, arg?: object/** = v8::Object::New(isolate)*/): object; + + /** + * + * @brief 删除当前集合 + * + * + */ + drop(): void; + + /** + * + * @brief 在当前集合上创建索引 + * @param keys 给定索引字段、顺序和方向 + * @param options 给定索引的选项,唯一索引等 + * + * + * + */ + ensureIndex(keys: object, options?: object/** = v8::Object::New(isolate)*/): void; + + /** + * + * @brief 重建当前集合的索引 + * @return 返回命令执行结果 + * + * + * + */ + reIndex(): object; + + /** + * + * @brief 删除当前集合指定名称的索引 + * @param name 给定要删除的索引名称 + * @return 返回命令执行结果 + * + * + * + */ + dropIndex(name: string): object; + + /** + * + * @brief 删除当前集合全部索引 + * @return 返回命令执行结果 + * + * + * + */ + dropIndexes(): object; + + /** + * + * @brief 查询当前集合全部索引 + * @return 返回包含索引的结果集 + * + * + * + */ + getIndexes(): Class_MongoCursor; + + /** + * + * @brief 获取当前集合子命名空间的集合对象 + * @param name 子命名空间名称 + * @return 返回新集合对象 + * + * + * + */ + getCollection(name: string): Class_MongoCollection; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MongoCursor.d.ts b/types/fibjs/declare/MongoCursor.d.ts new file mode 100644 index 0000000000..2dc99b5e96 --- /dev/null +++ b/types/fibjs/declare/MongoCursor.d.ts @@ -0,0 +1,149 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief mongodb 数据库数据游标对象 + * @detail + */ + +declare class Class_MongoCursor extends Class__object { + + + + /** + * + * @brief 指定返回结果时跳过的记录数 + * @param num 记录数 + * @return 返回游标对象本身便于链式调用 + * + * + * @async + */ + skip(num: number): Class_MongoCursor; + + /** + * + * @brief 指定返回结果的最大记录数 + * @param size 记录数 + * @return 返回游标对象本身便于链式调用 + * + * + * @async + */ + limit(size: number): Class_MongoCursor; + + /** + * + * @brief 设定返回结果的排序 + * @param opts 指定排序条件 + * @return 返回游标对象本身便于链式调用 + * + * + * + */ + sort(opts: object): Class_MongoCursor; + + /** + * + * @brief 查询当前游标是否有下一条记录 + * @return 有记录则返回 true + * + * + * + */ + hasNext(): boolean; + + /** + * + * @brief 返回当前游标的下一条记录 + * @return 记录对象,无记录则返回 null + * + * + * + */ + next(): object; + + /** + * + * @brief 查询游标的记录总数 + * @param applySkipLimit 指定是否查询 skip 和 limit 后的记录数,缺省为 false,查询全部记录数 + * @return 返回记录总数 + * + * + * + */ + count(applySkipLimit?: boolean/** = false*/): number; + + /** + * + * @brief 查询游标的记录总数,相当于 count(true) + * @return 返回记录总数 + * + * + * + */ + size(): number; + + /** + * + * @brief 遍历全部记录并回调处理函数 + * @param func 指定处理函数 + * + * + * + */ + forEach(func: Function): void; + + /** + * + * @brief 遍历处理全部记录,并返回处理结果 + * @param func 指定处理函数 + * @return 返回处理结果数组 + * + * + * + */ + map(func: Function): any[]; + + /** + * + * @brief 返回当前游标全部记录的数组 + * @return 返回包含全部数据的 Javascript 数组 + * + * + * + */ + toArray(): any[]; + + /** + * + * @brief 修改 mongodb 服务器缺省索引策略,使用指定的索引进行查询 + * @param opts 指定强制使用的索引 + * @return 返回游标对象本身便于链式调用 + * + * + * + */ + hint(opts: object): Class_MongoCursor; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MongoDB.d.ts b/types/fibjs/declare/MongoDB.d.ts new file mode 100644 index 0000000000..11bcf1456d --- /dev/null +++ b/types/fibjs/declare/MongoDB.d.ts @@ -0,0 +1,86 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief mongodb 数据库连接对象 + * @detail 使用 db.open 或 db.openMongoDB 创建,创建方式:,```JavaScript,var mdb = db.openMongoDB("mongodb://host/db");,``` + */ + +declare class Class_MongoDB extends Class__object { + + + + /** + * + * @brief 获取指定集合访问对象 + * @param name 指定集合的名称 + * @return 返回指定的集合对象 + * + * + * + */ + getCollection(name: string): Class_MongoCollection; + + /** + * + * @brief 指定一个 MongoDB 数据库命令 + * @param cmd 指定命令和参数的字典对象 + * @return 返回命令执行结果 + * + * + * + */ + runCommand(cmd: object): object; + + /** + * + * @brief 指定一个简单的 MongoDB 数据库命令 + * @param cmd 指定命令名 + * @param arg 指定命令参数 + * @return 返回命令执行结果 + * + * + * + */ + runCommand(cmd: string, arg: any): object; + + /** + * + * @brief 生成一个 mongodb _objectid 对象 + * @param hexStr 初始化 16 进制字符串,缺省生成新的 id + * @return 新 _objectid 对象 + * + * + * + */ + oid(hexStr?: string/** = ""*/): Class_MongoID; + + /** + * + * @brief 关闭当前数据库连接 + * + * @async + */ + close(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MongoID.d.ts b/types/fibjs/declare/MongoID.d.ts new file mode 100644 index 0000000000..372b0fa30b --- /dev/null +++ b/types/fibjs/declare/MongoID.d.ts @@ -0,0 +1,33 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief mongodb 数据库数据唯一标识对象,用于存储传递 oid + * @detail + */ + +declare class Class_MongoID extends Class__object { + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/MySQL.d.ts b/types/fibjs/declare/MySQL.d.ts new file mode 100644 index 0000000000..a23f9615e4 --- /dev/null +++ b/types/fibjs/declare/MySQL.d.ts @@ -0,0 +1,67 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief mysql 数据库连接对象 + * @detail 使用 db.open 或 db.openMySQL 创建,创建方式:,```JavaScript,var msql = db.openMySQL("mysql://user:pass@host/db");,``` + */ +/// +declare class Class_MySQL extends Class_DbConnection { + + /** + * class prop + * + * + * @brief 数据库连接接收缓存尺寸 + * + * + * @type Integer + */ + + rxBufferSize: number + + /** + * class prop + * + * + * @brief 数据库连接发送缓存尺寸 + * + * + * @type Integer + */ + + txBufferSize: number + + + + /** + * + * @brief 选择当前数据库连接的缺省数据库 + * @param dbName 指定数据库名 + * + * + * @async + */ + use(dbName: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/PKey.d.ts b/types/fibjs/declare/PKey.d.ts new file mode 100644 index 0000000000..297cfb2a13 --- /dev/null +++ b/types/fibjs/declare/PKey.d.ts @@ -0,0 +1,355 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 不对称加密算法对象 + * @detail PKey 对象属于 crypto 模块,创建:,```JavaScript,var k = new crypto.PKey();,``` + */ + +declare class Class_PKey extends Class__object { + + /** + * class prop + * + * + * @brief 返回当前算法名称 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 返回当前算法密码长度,以位为单位 + * + * @readonly + * @type Integer + */ + + keySize: number + + /** + * class prop + * + * + * @brief 返回当前密钥的公钥 + * @return 当前密钥的公钥 + * + * + * @readonly + * @type PKey + */ + + publicKey: Class_PKey + + + + /** + * + * @brief PKey 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 通过 DER 格式的密钥构造 PKey + * @param DerKey DER 格式的密钥 + * @param password 解密密码 + * + * + * + */ + constructor(DerKey: Class_Buffer, password?: string/** = ""*/); + + /** + * + * @brief 通过 PEM 格式的密钥构造 PKey + * @param pemKey PEM 格式的密钥 + * @param password 解密密码 + * + * + * + */ + constructor(pemKey: string, password?: string/** = ""*/); + + /** + * + * @brief 通过 JSON 格式的密钥构造 PKey + * + * jsonKey 的格式支持以下四种,RSA 私钥: + * ```JavaScript + * { + * "kty": "RSA", + * "n": "0m5lvKpWqy9JS7tV2HIPqHCYHLquSuxIC3F8strIQLJKO3rZmTT96KTnhsOfBO7Y1bI7mnT0PB3_vcHd9ekWMEoZJQw7MuB8KeM_Wn54-elJr5DNLk5bMppSGxX7ZnumiXGG51_X3Yp-_EbGtDG80GxXXix7Mucyo7K25uE0uW8=", + * "e": "AQAB", + * "d": "agN2O9NxMHL1MTMi75WfL9Pxvl-KWXKqZSF6mjzAsF9iKI8euyHIXYFepzU8kual1RsjDhCnzvWqFvZplW8lXqrHf_P-rS_9Y4gBUw6pjnI_DnFIRwWHRvrUHHSCfWOdTCIKdOTkgLZuGFuhEY3RMIW0WSYejjLtftwy0RVxAzk=", + * "p": "6a4G1qmfwWmn1biigN7IVFlkbLf9oVe6g7rOmHxI-hn1GRxKDSVuAUrmR1IhuAnca9M0y7SD-7TUs6wjOxWxaw==", + * "q": "5ofkxFKdPBD0CQHMb9q13AMHUVe0rJ-hSjqqIBrmqApUOneyAcMV76M0QyIQnI2p3POa4Qu_7XChDwRVl7LlDQ==", + * "dp": "2mXGiGwCHl8j-FBWuID-1C6z-BRB3MBEVoeKPOOzxOPruatB3mWEGXsqG7A8SWgV9URxTI2K6P3J6Z7RUpBkvw==", + * "dq": "oagn5vfb5NQqnOpS9xkSsD67cfIj821ZSFlNFYhnuOzNVda7z_qCtnHm4zDPH0lEFXoKYMfBhfqWJpaugttjPQ==", + * "qi": "dqEQgxNmOVFrF4s776hTqeC6oEDila8EvpVb2F2ZvwAOLjCQ66OiAZK1BiYGHqUy0NeqNmtlsLSuBEZQZvqZwg==" + * } + * ``` + * RSA 公钥: + * ```JavaScript + * { + * "kty": "RSA", + * "n": "0m5lvKpWqy9JS7tV2HIPqHCYHLquSuxIC3F8strIQLJKO3rZmTT96KTnhsOfBO7Y1bI7mnT0PB3_vcHd9ekWMEoZJQw7MuB8KeM_Wn54-elJr5DNLk5bMppSGxX7ZnumiXGG51_X3Yp-_EbGtDG80GxXXix7Mucyo7K25uE0uW8=", + * "e": "AQAB" + * } + * ``` + * EC 私钥: + * ```JavaScript + * { + * "kty": "EC", + * "crv": "P-521", + * "x": "ATfNNFuuvlGxrTGoXgyfSAGgRNNDnO3rN3k74urKJdVS14RYhdnSwm91Bm-F1l-T1XKlAY2yRnzG9w1Ukvo8c0wL", + * "y": "ASBHqrruB6kdkEUB3vlW3-UIkk4HtKdUeTwN-7m3j2rgZvYR1ffRAapDvWqKGiBjomqWafxokBkbDI0c95f6f4XU", + * "d": "AfkIbUHXfW41njdpoKuqqKludcoLJS8D_oMEwkj-GVaXFNKccIoF5iKGu2c69kNDjo83R_7wyGlfRczsklkik1ST" + * } + * ``` + * EC 公钥: + * ```JavaScript + * { + * "kty": "EC", + * "crv": "P-521", + * "x": "ATfNNFuuvlGxrTGoXgyfSAGgRNNDnO3rN3k74urKJdVS14RYhdnSwm91Bm-F1l-T1XKlAY2yRnzG9w1Ukvo8c0wL", + * "y": "ASBHqrruB6kdkEUB3vlW3-UIkk4HtKdUeTwN-7m3j2rgZvYR1ffRAapDvWqKGiBjomqWafxokBkbDI0c95f6f4XU" + * } + * ``` + * @param jsonKey JSON 格式的密钥 + * + * + * + */ + constructor(jsonKey: object); + + /** + * + * @brief 生成一个 RSA 私钥 + * @param size 指定 RSA 密钥长度,bit 为单位 + * + * + * @async + */ + genRsaKey(size: number): void; + + /** + * + * @brief 生成一个 EC 私钥 + * @param curve 指定预置椭圆曲线,可选值为:"secp521r1", "brainpoolP512r1", "secp384r1", "brainpoolP384r1", "secp256r1", "secp256k1", "brainpoolP256r1", "secp224r1", "secp224k1", "secp192r1", "secp192k1" + * + * + * @async + */ + genEcKey(curve?: string/** = "secp521r1"*/): void; + + /** + * + * @brief 查询当前密钥是否为私钥 + * @return 为 True 表示为私钥 + * + * + * + */ + isPrivate(): boolean; + + /** + * + * @brief 复制当前密钥 + * @return 当前密钥的复制对象 + * + * + * + */ + clone(): Class_PKey; + + /** + * + * @brief 加载一个 DER 格式的密钥 + * @param DerKey DER 格式的密钥 + * @param password 解密密码 + * + * + * + */ + importKey(DerKey: Class_Buffer, password?: string/** = ""*/): void; + + /** + * + * @brief 加载一个 PEM 格式的密钥 + * @param pemKey PEM 格式的密钥 + * @param password 解密密码 + * + * + * + */ + importKey(pemKey: string, password?: string/** = ""*/): void; + + /** + * + * @brief 加载一个 JSON 格式的密钥 + * + * jsonKey 的格式支持以下四种,RSA 私钥: + * ```JavaScript + * { + * "kty": "RSA", + * "n": "0m5lvKpWqy9JS7tV2HIPqHCYHLquSuxIC3F8strIQLJKO3rZmTT96KTnhsOfBO7Y1bI7mnT0PB3_vcHd9ekWMEoZJQw7MuB8KeM_Wn54-elJr5DNLk5bMppSGxX7ZnumiXGG51_X3Yp-_EbGtDG80GxXXix7Mucyo7K25uE0uW8=", + * "e": "AQAB", + * "d": "agN2O9NxMHL1MTMi75WfL9Pxvl-KWXKqZSF6mjzAsF9iKI8euyHIXYFepzU8kual1RsjDhCnzvWqFvZplW8lXqrHf_P-rS_9Y4gBUw6pjnI_DnFIRwWHRvrUHHSCfWOdTCIKdOTkgLZuGFuhEY3RMIW0WSYejjLtftwy0RVxAzk=", + * "p": "6a4G1qmfwWmn1biigN7IVFlkbLf9oVe6g7rOmHxI-hn1GRxKDSVuAUrmR1IhuAnca9M0y7SD-7TUs6wjOxWxaw==", + * "q": "5ofkxFKdPBD0CQHMb9q13AMHUVe0rJ-hSjqqIBrmqApUOneyAcMV76M0QyIQnI2p3POa4Qu_7XChDwRVl7LlDQ==", + * "dp": "2mXGiGwCHl8j-FBWuID-1C6z-BRB3MBEVoeKPOOzxOPruatB3mWEGXsqG7A8SWgV9URxTI2K6P3J6Z7RUpBkvw==", + * "dq": "oagn5vfb5NQqnOpS9xkSsD67cfIj821ZSFlNFYhnuOzNVda7z_qCtnHm4zDPH0lEFXoKYMfBhfqWJpaugttjPQ==", + * "qi": "dqEQgxNmOVFrF4s776hTqeC6oEDila8EvpVb2F2ZvwAOLjCQ66OiAZK1BiYGHqUy0NeqNmtlsLSuBEZQZvqZwg==" + * } + * ``` + * RSA 公钥: + * ```JavaScript + * { + * "kty": "RSA", + * "n": "0m5lvKpWqy9JS7tV2HIPqHCYHLquSuxIC3F8strIQLJKO3rZmTT96KTnhsOfBO7Y1bI7mnT0PB3_vcHd9ekWMEoZJQw7MuB8KeM_Wn54-elJr5DNLk5bMppSGxX7ZnumiXGG51_X3Yp-_EbGtDG80GxXXix7Mucyo7K25uE0uW8=", + * "e": "AQAB" + * } + * ``` + * EC 私钥: + * ```JavaScript + * { + * "kty": "EC", + * "crv": "P-521", + * "x": "ATfNNFuuvlGxrTGoXgyfSAGgRNNDnO3rN3k74urKJdVS14RYhdnSwm91Bm-F1l-T1XKlAY2yRnzG9w1Ukvo8c0wL", + * "y": "ASBHqrruB6kdkEUB3vlW3-UIkk4HtKdUeTwN-7m3j2rgZvYR1ffRAapDvWqKGiBjomqWafxokBkbDI0c95f6f4XU", + * "d": "AfkIbUHXfW41njdpoKuqqKludcoLJS8D_oMEwkj-GVaXFNKccIoF5iKGu2c69kNDjo83R_7wyGlfRczsklkik1ST" + * } + * ``` + * EC 公钥: + * ```JavaScript + * { + * "kty": "EC", + * "crv": "P-521", + * "x": "ATfNNFuuvlGxrTGoXgyfSAGgRNNDnO3rN3k74urKJdVS14RYhdnSwm91Bm-F1l-T1XKlAY2yRnzG9w1Ukvo8c0wL", + * "y": "ASBHqrruB6kdkEUB3vlW3-UIkk4HtKdUeTwN-7m3j2rgZvYR1ffRAapDvWqKGiBjomqWafxokBkbDI0c95f6f4XU" + * } + * ``` + * @param jsonKey JSON 格式的密钥 + * + * + * + */ + importKey(jsonKey: object): void; + + /** + * + * @brief 加载一个 PEM/DER 格式的密钥文件 + * @param filename 密钥文件名 + * @param password 解密密码 + * + * + * + */ + importFile(filename: string, password?: string/** = ""*/): void; + + /** + * + * @brief 返回当前 key 的 PEM 格式编码 + * @return 当前 key 的 PEM 格式编码 + * + * + * + */ + exportPem(): string; + + /** + * + * @brief 返回当前 key 的 DER 格式编码 + * @return 当前 key 的 DER 格式编码 + * + * + * + */ + exportDer(): Class_Buffer; + + /** + * + * @brief 返回当前 key 的 DER 格式编码 + * @return 当前 key 的 DER 格式编码 + * + * + * + */ + exportJson(): object; + + /** + * + * @brief 使用当前算法密码公钥加密数据 + * @param data 指定要加密的数据 + * @return 返回加密后的数据 + * + * + * @async + */ + encrypt(data: Class_Buffer): Class_Buffer; + + /** + * + * @brief 使用当前算法密码私钥解密数据 + * @param data 指定要解密的数据 + * @return 返回解密后的数据 + * + * + * @async + */ + decrypt(data: Class_Buffer): Class_Buffer; + + /** + * + * @brief 使用当前算法密码私钥签名数据 + * @param data 指定要签名的数据 + * @param alg 指定要签名的算法, 默认0. 支持算法: 0=NONE,1=MD2,2=MD4,3=MD5,4=SHA1,5=SHA224,6=SHA256,7=SHA384,8=SHA512,9=RIPEMD160 + * @return 返回签名后的数据 + * + * + * @async + */ + sign(data: Class_Buffer, alg?: number/** = 0*/): Class_Buffer; + + /** + * + * @brief 使用当前算法密码公钥验证数据 + * @param data 指定要验证的数据 + * @param sign 指定要验证的签名 + * @param alg 指定要签名的算法, 默认0. 支持算法: 0=NONE,1=MD2,2=MD4,3=MD5,4=SHA1,5=SHA224,6=SHA256,7=SHA384,8=SHA512,9=RIPEMD160 + * @return 返回验证后的结果 + * + * + * @async + */ + verify(data: Class_Buffer, sign: Class_Buffer, alg?: number/** = 0*/): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Redis.d.ts b/types/fibjs/declare/Redis.d.ts new file mode 100644 index 0000000000..384e0e4d80 --- /dev/null +++ b/types/fibjs/declare/Redis.d.ts @@ -0,0 +1,576 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Redis 数据库客户端对象 + * @detail 用以创建和管理 Redis 数据库,创建方法:,```JavaScript,var db = require("db");,var test = new db.openRedis("redis-server");,``` + */ + +declare class Class_Redis extends Class__object { + + /** + * class prop + * + * + * @brief 查询和设置错误处理函数,当 sub 出现错误或者网络中断时回调,当回调发生后,本对象的一切 sub 都将中止 + * + * + * + * @type Function + */ + + onsuberror: Function + + + + /** + * + * @brief redis 基础命令方法 + * @param cmd 指定发送的命令 + * @param args 指定发送的参数 + * @return 返回服务器返回的结果 + * + * + */ + command(cmd: string, ...args: any[]): any; + + /** + * + * @brief 将字符串值 value 关联到 key,如果 key 已经持有其他值, SET 就覆写旧值,无视类型 + * @param key 指定要关联的 key + * @param value 指定要关联的数据 + * @param ttl 以毫秒为单位为 key 设置生存时间;如果 ttl 为 0 ,那么不设置生存时间 + * + * + */ + set(key: Class_Buffer, value: Class_Buffer, ttl?: number/** = 0*/): void; + + /** + * + * @brief 将 key 的值设为 value ,当且仅当 key 不存在。若给定的 key 已经存在,则 SETNX 不做任何动作。 + * @param key 指定要关联的 key + * @param value 指定要关联的数据 + * @param ttl 以毫秒为单位为 key 设置生存时间;如果 ttl 为 0 ,那么不设置生存时间 + * + * + */ + setNX(key: Class_Buffer, value: Class_Buffer, ttl?: number/** = 0*/): void; + + /** + * + * @brief 将 key 的值设为 value,只在键已经存在时,才对键进行设置操作。 + * @param key 指定要关联的 key + * @param value 指定要关联的数据 + * @param ttl 以毫秒为单位为 key 设置生存时间;如果 ttl 为 0 ,那么不设置生存时间 + * + * + */ + setXX(key: Class_Buffer, value: Class_Buffer, ttl?: number/** = 0*/): void; + + /** + * + * @brief 同时设置一个或多个 key-value 对。如果某个给定 key 已经存在,那么 MSET 会用新值覆盖原来的旧值 + * @param kvs 指定要设置的 key/value 对象 + * + * + */ + mset(kvs: object): void; + + /** + * + * @brief 同时设置一个或多个 key-value 对。如果某个给定 key 已经存在,那么 MSET 会用新值覆盖原来的旧值 + * @param kvs 指定要设置的 key/value 列表 + * + * + */ + mset(...kvs: any[]): void; + + /** + * + * @brief 同时设置一个或多个 key-value 对,当且仅当所有给定 key 都不存在 + * @param kvs 指定要设置的 key/value 对象 + * + * + */ + msetNX(kvs: object): void; + + /** + * + * @brief 同时设置一个或多个 key-value 对,当且仅当所有给定 key 都不存在 + * @param kvs 指定要设置的 key/value 列表 + * + * + */ + msetNX(...kvs: any[]): void; + + /** + * + * @brief 如果 key 已经存在并且是一个字符串,append 命令将 value 追加到 key 原来的值的末尾。如果 key 不存在,append 就简单地将给定 key 设为 value + * @param key 指定要追加的 key + * @param value 指定要追加的数据 + * @return 追加 value 之后, key 中字符串的长度 + * + * + */ + append(key: Class_Buffer, value: Class_Buffer): number; + + /** + * + * @brief 用 value 参数覆写给定 key 所储存的字符串值,从偏移量 offset 开始 + * @param key 指定要修改的 key + * @param offset 指定修改的字节偏移 + * @param value 指定要覆盖的数据 + * @return 被修改之后,字符串的长度 + * + * + */ + setRange(key: Class_Buffer, offset: number, value: Class_Buffer): number; + + /** + * + * @brief 返回 key 中字符串值的子字符串,字符串的截取范围由 start 和 end 两个偏移量决定(包括 start 和 end 在内) + * @param key 指定要查询的 key + * @param start 指定查询的起始字节偏移 + * @param end 指定查询的结束字节偏移 + * @return 截取得出的子字符串 + * + * + */ + getRange(key: Class_Buffer, start: number, end: number): Class_Buffer; + + /** + * + * @brief 返回 key 所储存的字符串值的长度。当 key 储存的不是字符串值时,返回一个错误 + * @param key 指定要计算的 key + * @return 字符串值的长度。当 key 不存在时,返回 0 + * + * + */ + strlen(key: Class_Buffer): number; + + /** + * + * @brief 计算给定字符串中,被设置为 1 的比特位的数量 + * @param key 指定要计算的 key + * @param start 指定要计算的起始字节,可以使用负数值,-1 表示最后一个字节,而 -2 表示倒数第二个字节,以此类推 + * @param end 指定要计算的结束字节,可以使用负数值,-1 表示最后一个字节,而 -2 表示倒数第二个字节,以此类推 + * @return 被设置为 1 的位的数量 + * + * + */ + bitcount(key: Class_Buffer, start?: number/** = 0*/, end?: number/** = -1*/): number; + + /** + * + * @brief 返回 key 所关联的字符串值,如果 key 不存在那么返回特殊值 Null + * @param key 指定要关联的 key + * @return 当 key 不存在时,返回 Null ,否则,返回 key 的值 + * + * + */ + get(key: Class_Buffer): Class_Buffer; + + /** + * + * @brief 返回所有(一个或多个)给定 key 的值。如果给定的 key 里面,有某个 key 不存在,那么这个 key 返回特殊值 nil 。 + * @param keys 指定要查询的 key 数组 + * @return 一个包含所有给定 key 的值的列表 + * + * + */ + mget(keys: any[]): any[]; + + /** + * + * @brief 返回所有(一个或多个)给定 key 的值。如果给定的 key 里面,有某个 key 不存在,那么这个 key 返回特殊值 nil 。 + * @param keys 指定要查询的 key 列表 + * @return 一个包含所有给定 key 的值的列表 + * + * + */ + mget(...keys: any[]): any[]; + + /** + * + * @brief 将给定 key 的值设为 value ,并返回 key 的旧值(old value) + * @param key 指定要查询修改的 key + * @param value 指定修改的数值 + * @return 返回给定 key 的旧值 + * + * + */ + getset(key: Class_Buffer, value: Class_Buffer): Class_Buffer; + + /** + * + * @brief 将 key 所储存的值减去减量 + * @param key 指定要修改的 key + * @param num 指定要减去的数值 + * @return 减去 num 之后,key 的值 + * + * + */ + decr(key: Class_Buffer, num?: number/** = 1*/): number; + + /** + * + * @brief 将 key 所储存的值加上增量 + * @param key 指定要修改的 key + * @param num 指定要加上的数值 + * @return 加上 num 之后,key 的值 + * + * + */ + incr(key: Class_Buffer, num?: number/** = 1*/): number; + + /** + * + * @brief 对 key 所储存的字符串值,设置或清除指定偏移量上的位(bit) + * @param key 指定要修改的 key + * @param offset 指定修改的位偏移 + * @param value 指定设置或清除的参数,可以是 0 也可以是 1 + * @return 指定偏移量原来储存的位 + * + * + */ + setBit(key: Class_Buffer, offset: number, value: number): number; + + /** + * + * @brief 对 key 所储存的字符串值,获取指定偏移量上的位(bit) + * @param key 指定要查询的 key + * @param offset 指定查询的位偏移 + * @return 字符串值指定偏移量上的位(bit) + * + * + */ + getBit(key: Class_Buffer, offset: number): number; + + /** + * + * @brief 检查给定 key 是否存在 + * @param key 指定要关联的 key + * @return 若 key 存在,返回 True,否则返回 False + * + * + */ + exists(key: Class_Buffer): boolean; + + /** + * + * @brief 返回 key 所储存的值的类型 + * @param key 指定要查询的 key + * @return 返回 key 所储存的值的类型,可能的值为 none(key不存在) string(字符串) list(列表) set(集合) zset(有序集) hash(哈希表) + * + * + */ + type(key: Class_Buffer): string; + + /** + * + * @brief 查找所有符合给定模式 pattern 的 key + * @param pattern 指定查询模式 + * @return 符合给定模式的 key 列表 + * + * + */ + keys(pattern: string): any[]; + + /** + * + * @brief 删除给定的一个或多个 key,不存在的 key 会被忽略 + * @param keys 指定要删除的 key 数组 + * @return 被删除 key 的数量 + * + * + */ + del(keys: any[]): number; + + /** + * + * @brief 删除给定的一个或多个 key,不存在的 key 会被忽略 + * @param keys 指定要删除的 key 列表 + * @return 被删除 key 的数量 + * + * + */ + del(...keys: any[]): number; + + /** + * + * @brief 为给定 key 设置生存时间,当 key 过期时,它会被自动删除 + * @param key 指定要设定的 key + * @param ttl 以毫秒为单位为 key 设置生存时间 + * @return 若 key 存在,返回 True,否则返回 False + * + * + */ + expire(key: Class_Buffer, ttl: number): boolean; + + /** + * + * @brief 返回给定 key 的剩余生存时间 + * @param key 指定要查询的 key + * @return 以毫秒为单位,返回 key 的剩余生存时间,当 key 不存在时,返回 -2,当 key 存在但没有设置剩余生存时间时,返回 -1 + * + * + */ + ttl(key: Class_Buffer): number; + + /** + * + * @brief 移除给定 key 的生存时间,将这个 key 从『易失的』(带生存时间 key )转换成『持久的』(一个不带生存时间、永不过期的 key) + * @param key 指定要设定的 key + * @return 若 key 存在,返回 True,否则返回 False + * + * + */ + persist(key: Class_Buffer): boolean; + + /** + * + * @brief 将 key 改名为 newkey,当 key 和 newkey 相同,或者 key 不存在时,返回一个错误 + * @param key 指定要改名的 key + * @param newkey 指定要改名的目的 key + * + * + */ + rename(key: Class_Buffer, newkey: Class_Buffer): void; + + /** + * + * @brief 当且仅当 newkey 不存在时,将 key 改名为 newkey,当 key 不存在时,返回一个错误 + * @param key 指定要改名的 key + * @param newkey 指定要改名的目的 key + * @return 修改成功时,返回 True,如果 newkey 已经存在,返回 False + * + * + */ + renameNX(key: Class_Buffer, newkey: Class_Buffer): boolean; + + /** + * + * @brief 订阅给定的一个频道的信息,当消息发生时自动调用 func,func 包含两个参数,依次为 channel 和 message,同一频道同一函数只会回调一次 + * @param channel 指定订阅的频道名称 + * @param func 指定回调函数 + * + * + * + */ + sub(channel: Class_Buffer, func: Function): void; + + /** + * + * @brief 订阅给定的一组频道的信息,当消息发生时自动调用相应的回调函数,同一频道同一函数只会回调一次 + * @param map 指定频道映射关系,对象属性名称将作为频道名称,属性的值将作为回调函数 + * + * + * + */ + sub(map: object): void; + + /** + * + * @brief 退订给定的频道的全部回调 + * @param channel 指定退订的频道名称 + * + * + * + */ + unsub(channel: Class_Buffer): void; + + /** + * + * @brief 退订给定的频道的指定回调函数 + * @param channel 指定退订的频道名称 + * @param func 指定退订的回调函数 + * + * + * + */ + unsub(channel: Class_Buffer, func: Function): void; + + /** + * + * @brief 退订一组给定的频道的全部回调 + * @param channels 指定退订的频道数组 + * + * + * + */ + unsub(channels: any[]): void; + + /** + * + * @brief 退订给定的一组频道的指定回调函数 + * @param map 指定频道映射关系,对象属性名称将作为频道名称,属性的值将作为回调函数 + * + * + * + */ + unsub(map: object): void; + + /** + * + * @brief 按照模板订阅一组频道的信息,当消息发生时自动调用 func,func 包含三个参数,依次为 channel,message 和 pattern,同一模板同一函数只会回调一次 + * @param pattern 指定订阅的频道模板 + * @param func 指定回调函数 + * + * + * + */ + psub(pattern: string, func: Function): void; + + /** + * + * @brief 订阅给定的一组频道模板的信息,当消息发生时自动调用相应的 func,同一频道同一函数只会回调一次 + * @param map 指定频道映射关系,对象属性名称将作为频道模板,属性的值将作为回调函数 + * + * + * + */ + psub(map: object): void; + + /** + * + * @brief 退订给定模板的频道的全部回调 + * @param pattern 指定退订的频道模板 + * + * + * + */ + unpsub(pattern: string): void; + + /** + * + * @brief 退订给定模板的频道的指定回调函数 + * @param pattern 指定退订的频道模板 + * @param func 指定退订的回调函数 + * + * + * + */ + unpsub(pattern: string, func: Function): void; + + /** + * + * @brief 退订一组给定模板的频道的全部回调 + * @param patterns 指定发布的频道模板数组 + * + * + * + */ + unpsub(patterns: any[]): void; + + /** + * + * @brief 退订一组模板的频道的指定回调函数 + * @param map 指定频道映射关系,对象属性名称将作为频道模板,属性的值将作为回调函数 + * + * + * + */ + unpsub(map: object): void; + + /** + * + * @brief 将信息 message 发送到指定的频道 channel + * @param channel 指定发布的频道 + * @param message 指定发布的消息 + * @return 接收此消息的客户端数量 + * + * + * + */ + pub(channel: Class_Buffer, message: Class_Buffer): number; + + /** + * + * @brief 获取指定 key 的 Hash 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @param key 指定要获取的 key + * @return 返回包含指定 key 的 Hash 对象 + * + * + */ + getHash(key: Class_Buffer): Class_RedisHash; + + /** + * + * @brief 获取指定 key 的 List 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @param key 指定要获取的 key + * @return 返回包含指定 key 的 List 对象 + * + * + */ + getList(key: Class_Buffer): Class_RedisList; + + /** + * + * @brief 获取指定 key 的 Set 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @param key 指定要获取的 key + * @return 返回包含指定 key 的 Set 对象 + * + * + */ + getSet(key: Class_Buffer): Class_RedisSet; + + /** + * + * @brief 获取指定 key 的 SortedSet 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @param key 指定要获取的 key + * @return 返回包含指定 key 的 SortedSet 对象 + * + * + */ + getSortedSet(key: Class_Buffer): Class_RedisSortedSet; + + /** + * + * @brief 序列化给定 key ,并返回被序列化的值,使用 restore 命令可以将这个值反序列化为 Redis 键 + * @param key 指定要序列化的 key + * @return 返回序列化之后的值,如果 key 不存在,那么返回 null + * + * + */ + dump(key: Class_Buffer): Class_Buffer; + + /** + * + * @brief 反序列化给定的序列化值,并将它和给定的 key 关联 + * @param key 指定要反序列化的 key + * @param data 指定要反序列化的数据 + * @param ttl 以毫秒为单位为 key 设置生存时间;如果 ttl 为 0 ,那么不设置生存时间 + * + * + */ + restore(key: Class_Buffer, data: Class_Buffer, ttl?: number/** = 0*/): void; + + /** + * + * @brief 关闭当前数据库连接或事务 + * + * + */ + close(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/RedisHash.d.ts b/types/fibjs/declare/RedisHash.d.ts new file mode 100644 index 0000000000..0c16eef47d --- /dev/null +++ b/types/fibjs/declare/RedisHash.d.ts @@ -0,0 +1,169 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Redis 数据库客户端 Hash 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @detail 用以操作 Redis 的 Hash 对象,创建方法:,```JavaScript,var db = require("db");,var rdb = new db.openRedis("redis-server");,var hash = rdb.getHash("test");,``` + */ + +declare class Class_RedisHash extends Class__object { + + + + /** + * + * @brief 将哈希表中的域 field 的值设为 value,如果域 field 已经存在于哈希表中,旧值将被覆盖 + * @param field 指定要修改的 field + * @param value 指定要修改的数据 + * + * + */ + set(field: Class_Buffer, value: Class_Buffer): void; + + /** + * + * @brief 将哈希表中的域 field 的值设置为 value ,当且仅当域 field 不存在。若域 field 已经存在,该操作无效 + * @param field 指定要修改的 field + * @param value 指定要修改的数据 + * + * + */ + setNX(field: Class_Buffer, value: Class_Buffer): void; + + /** + * + * @brief 同时将多个 field-value (域-值)对设置到哈希表中,此命令会覆盖哈希表中已存在的域 + * @param kvs 指定要设置的 field/value 对象 + * + * + */ + mset(kvs: object): void; + + /** + * + * @brief 同时将多个 field-value (域-值)对设置到哈希表中,此命令会覆盖哈希表中已存在的域 + * @param kvs 指定要设置的 field/value 列表 + * + * + */ + mset(...kvs: any[]): void; + + /** + * + * @brief 返回哈希表中给定域 field 的值 + * @param field 指定要查询的 field + * @return 给定域的值,当给定域不存在或是给定 key 不存在时,返回 null + * + * + */ + get(field: Class_Buffer): Class_Buffer; + + /** + * + * @brief 返回哈希表中,一个或多个给定域的值 + * @param fields 指定要查询的域数组 + * @return 一个包含所有给定域的值的列表 + * + * + */ + mget(fields: any[]): any[]; + + /** + * + * @brief 返回哈希表中,一个或多个给定域的值 + * @param fields 指定要查询的域列表 + * @return 一个包含所有给定域的值的列表 + * + * + */ + mget(...fields: any[]): any[]; + + /** + * + * @brief 将域所储存的值加上增量 + * @param field 指定要修改的域 + * @param num 指定要加上的数值 + * @return 加上 num 之后,域的值 + * + * + */ + incr(field: Class_Buffer, num?: number/** = 1*/): number; + + /** + * + * @brief 返回哈希表中,所有的域和值 + * @return 返回一个包含哈希表中所有域的列表 + * + * + */ + getAll(): any[]; + + /** + * + * @brief 返回哈希表中的所有域 + * @return 返回值里,紧跟每个域名(field name)之后是域的值(value),所以返回值的长度是哈希表大小的两倍 + * + * + */ + keys(): any[]; + + /** + * + * @brief 返回哈希表中域的数量 + * @return 返回哈希表中域的数量 + * + * + */ + len(): number; + + /** + * + * @brief 查看哈希表中,给定域 field 是否存在 + * @param field 指定要查询的 field + * @return 如果哈希表含有给定域,返回 true,如果哈希表不含有给定域,或 key 不存在,返回 false + * + * + */ + exists(field: Class_Buffer): boolean; + + /** + * + * @brief 删除哈希表中的一个或多个指定域,不存在的域将被忽略 + * @param fields 指定要删除的域数组 + * @return 被删除域的数量 + * + * + */ + del(fields: any[]): number; + + /** + * + * @brief 删除哈希表中的一个或多个指定域,不存在的域将被忽略 + * @param fields 指定要删除的域列表 + * @return 被删除域的数量 + * + * + */ + del(...fields: any[]): number; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/RedisList.d.ts b/types/fibjs/declare/RedisList.d.ts new file mode 100644 index 0000000000..f752f8fd1a --- /dev/null +++ b/types/fibjs/declare/RedisList.d.ts @@ -0,0 +1,174 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Redis 数据库客户端 List 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @detail 用以操作 Redis 的 List 对象,创建方法:,```JavaScript,var db = require("db");,var rdb = new db.openRedis("redis-server");,var list = rdb.getList("test");,``` + */ + +declare class Class_RedisList extends Class__object { + + + + /** + * + * @brief 将一个或多个值 value 插入到列表的表头 + * @param values 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + push(values: any[]): number; + + /** + * + * @brief 将一个或多个值 value 插入到列表的表头 + * @param values 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + push(...values: any[]): number; + + /** + * + * @brief 移除并返回列表 key 的头元素 + * @return 列表的头元素,如果列表为空则返回 null + * + * + */ + pop(): Class_Buffer; + + /** + * + * @brief 将一个或多个值 value 插入到列表的表尾(最右边) + * @param values 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + rpush(values: any[]): number; + + /** + * + * @brief 将一个或多个值 value 插入到列表的表尾(最右边) + * @param values 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + rpush(...values: any[]): number; + + /** + * + * @brief 移除并返回列表 key 的表尾(最右边)元素 + * @return 列表的头元素,如果列表为空则返回 null + * + * + */ + rpop(): Class_Buffer; + + /** + * + * @brief 将列表下标为 index 的元素的值设置为 value + * @param index 指定要修改的下标 + * @param value 指定要修改的数据 + * + * + */ + set(index: number, value: Class_Buffer): void; + + /** + * + * @brief 返回列表中,下标为 index 的元素 + * @param index 指定要查询的下标 + * @return 列表中下标为 index 的元素 + * + * + */ + get(index: number): Class_Buffer; + + /** + * + * @brief 将值 value 插入到列表当中,位于值 pivot 之前 + * @param pivot 指定插入时查找的数据 + * @param value 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + insertBefore(pivot: Class_Buffer, value: Class_Buffer): number; + + /** + * + * @brief 将值 value 插入到列表当中,位于值 pivot 之后 + * @param pivot 指定插入时查找的数据 + * @param value 指定要插入的数据 + * @return 插入后,列表的长度 + * + * + */ + insertAfter(pivot: Class_Buffer, value: Class_Buffer): number; + + /** + * + * @brief 根据参数 count 的值,移除列表中与参数 value 相等的元素 + * @param count 指定删除的元素数量 + * @param value 指定要删除的数值 + * @return 被移除元素的数量 + * + * + */ + remove(count: number, value: Class_Buffer): number; + + /** + * + * @brief 对一个列表进行修剪(trim),就是说,让列表只保留指定区间内的元素,不在指定区间之内的元素都将被删除 + * @param start 指定修剪的起始下标,0 表示第一个元素,-1 表示最后一个元素 + * @param stop 指定修剪的结束下标,0 表示第一个元素,-1 表示最后一个元素 + * + * + */ + trim(start: number, stop: number): void; + + /** + * + * @brief 返回列表的长度 + * @return 返回列表的长度 + * + * + */ + len(): number; + + /** + * + * @brief 返回列表中指定区间内的元素,区间以偏移量 start 和 stop 指定,包含 start 和 stop 的元素 + * @param start 指定查询的起始下标,0 表示第一个元素,-1 表示最后一个元素 + * @param stop 指定查询的结束下标,0 表示第一个元素,-1 表示最后一个元素 + * @return 包含指定区间内的元素的数组 + * + * + */ + range(start: number, stop: number): any[]; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/RedisSet.d.ts b/types/fibjs/declare/RedisSet.d.ts new file mode 100644 index 0000000000..571869a8d5 --- /dev/null +++ b/types/fibjs/declare/RedisSet.d.ts @@ -0,0 +1,129 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Redis 数据库客户端 Set 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @detail 用以操作 Redis 的 Set 对象,创建方法:,```JavaScript,var db = require("db");,var rdb = new db.openRedis("redis-server");,var set = rdb.getSet("test");,``` + */ + +declare class Class_RedisSet extends Class__object { + + + + /** + * + * @brief 将一个或多个 member 元素加入到集合 key 当中,已经存在于集合的 member 元素将被忽略 + * @param members 指定要添加的元素数组 + * @return 被添加到集合中的新元素的数量,不包括被忽略的元素 + * + * + */ + add(members: any[]): number; + + /** + * + * @brief 同时将多个 field-value (域-值)对设置到哈希表中,此命令会覆盖哈希表中已存在的域 + * @param members 指定要添加的元素列表 + * @return 被添加到集合中的新元素的数量,不包括被忽略的元素 + * + * + */ + add(...members: any[]): number; + + /** + * + * @brief 移除集合中的一个或多个 member 元素 + * @param members 指定要移除的元素数组 + * @return 被成功移除的元素的数量,不包括被忽略的元素 + * + * + */ + remove(members: any[]): number; + + /** + * + * @brief 移除集合中的一个或多个 member 元素 + * @param members 指定要移除的元素列表 + * @return 被成功移除的元素的数量,不包括被忽略的元素 + * + * + */ + remove(...members: any[]): number; + + /** + * + * @brief 返回集合中元素的数量 + * @return 返回集合的长度 + * + * + */ + len(): number; + + /** + * + * @brief 判断 member 元素是否集合的成员 + * @param member 指定检查的 member + * @return 如果 member 元素是集合的成员,返回 true + * + * + */ + exists(member: Class_Buffer): boolean; + + /** + * + * @brief 返回集合中的所有成员 + * @return 集合中所有成员的列表 + * + * + */ + members(): any[]; + + /** + * + * @brief 移除并返回集合中的一个随机元素 + * @return 被移除的随机元素。当集合是空集时,返回 null + * + * + */ + pop(): Class_Buffer; + + /** + * + * @brief 从集合中获取随机的一个元素 + * @return 返回一个元素;如果集合为空,返回 null + * + * + */ + randMember(): any; + + /** + * + * @brief 从集合中获取随机的若干元素 + * @param count 指定返回的元素个数。正数,返回一个包含 count 个元素的数组;负数,返回一个数组,数组中的元素可能会重复出现多次,而数组的长度为 count 的绝对值 + * @return 返回一个列表;如果集合为空,返回空列表 + * + * + */ + randMember(count: number): any; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/RedisSortedSet.d.ts b/types/fibjs/declare/RedisSortedSet.d.ts new file mode 100644 index 0000000000..1769fb0a79 --- /dev/null +++ b/types/fibjs/declare/RedisSortedSet.d.ts @@ -0,0 +1,158 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Redis 数据库客户端 SortedSet 对象,此对象为包含指定 key 的客户端,只有调用其方法才会操作数据库 + * @detail 用以操作 Redis 的 SortedSet 对象,创建方法:,```JavaScript,var db = require("db");,var rdb = new db.openRedis("redis-server");,var set = rdb.getSortedSet("test");,``` + */ + +declare class Class_RedisSortedSet extends Class__object { + + + + /** + * + * @brief 将一个或多个 member 元素及其 score 值加入到有序集当中 + * @param sms 指定要添加的 member/score 对象 + * @return 被成功添加的新成员的数量,不包括那些被更新的、已经存在的成员 + * + * + */ + add(sms: object): number; + + /** + * + * @brief 将一个或多个 member 元素及其 score 值加入到有序集当中 + * @param sms 指定要添加的 member/score 列表 + * @return 被成功添加的新成员的数量,不包括那些被更新的、已经存在的成员 + * + * + */ + add(...sms: any[]): number; + + /** + * + * @brief 返回有序集中,成员 member 的 score 值 + * @param member 指定要查询的 member + * @return member 成员的 score 值,以字符串形式表示 + * + * + */ + score(member: Class_Buffer): Class_Buffer; + + /** + * + * @brief 为有序集的成员 member 的 score 值加上增量 num + * @param member 指定要修改的 member + * @param num 指定要加上的数值 + * @return member 成员的新 score 值,以字符串形式表示 + * + * + */ + incr(member: Class_Buffer, num?: number/** = 1*/): Class_Buffer; + + /** + * + * @brief 移除有序集中的一个或多个 member 元素 + * @param members 指定要移除的元素数组 + * @return 被成功移除的元素的数量,不包括被忽略的元素 + * + * + */ + remove(members: any[]): number; + + /** + * + * @brief 移除有序集中的一个或多个 member 元素 + * @param members 指定要移除的元素列表 + * @return 被成功移除的元素的数量,不包括被忽略的元素 + * + * + */ + remove(...members: any[]): number; + + /** + * + * @brief 返回有序集中元素的数量 + * @return 返回有序集的长度 + * + * + */ + len(): number; + + /** + * + * @brief 返回有序集中, score 值在 min 和 max 之间(默认包括 score 值等于 min 或 max )的成员的数量 + * @param min 指定统计的最小 score + * @param max 指定统计的最大 score + * @return score 值在 min 和 max 之间的成员的数量 + * + * + */ + count(min: number, max: number): number; + + /** + * + * @brief 返回有序集中,指定区间内的成员,成员的位置按 score 值递增(从小到大)来排序 + * @param start 指定查询的起始下标,0 表示第一个元素,-1 表示最后一个元素 + * @param stop 指定查询的结束下标,0 表示第一个元素,-1 表示最后一个元素 + * @param withScores 指定是否在结果中包含 score + * @return 指定区间内,带有 score 值(可选)的有序集成员的列表 + * + * + */ + range(start: number, stop: number, withScores?: boolean/** = false*/): any[]; + + /** + * + * @brief 返回有序集中,指定区间内的成员,成员的位置按 score 值递减(从大到小)来排序 + * @param start 指定查询的起始下标,0 表示第一个元素,-1 表示最后一个元素 + * @param stop 指定查询的结束下标,0 表示第一个元素,-1 表示最后一个元素 + * @param withScores 指定是否在结果中包含 score + * @return 指定区间内,带有 score 值(可选)的有序集成员的列表 + * + * + */ + rangeRev(start: number, stop: number, withScores?: boolean/** = false*/): any[]; + + /** + * + * @brief 有序集中成员 member 的排名。其中有序集成员按 score 值递增(从小到大)顺序排列 + * @param member 指定要查询的 member + * @return member 如果 member 是有序集 key 的成员,返回 member 的排名。如果 member 不是有序集 key 的成员,返回 nil + * + * + */ + rank(member: Class_Buffer): number; + + /** + * + * @brief 有序集中成员 member 的排名。其中有序集成员按 score 值递减(从大到小)顺序排列 + * @param member 指定要查询的 member + * @return member 如果 member 是有序集 key 的成员,返回 member 的排名。如果 member 不是有序集 key 的成员,返回 nil + * + * + */ + rankRev(member: Class_Buffer): number; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Routing.d.ts b/types/fibjs/declare/Routing.d.ts new file mode 100644 index 0000000000..aef820feae --- /dev/null +++ b/types/fibjs/declare/Routing.d.ts @@ -0,0 +1,262 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 消息处理器路由对象 + * @detail 路由对象是 http 消息处理的核心对象,服务器根据路由的设定,匹配 url 和 method,并将 http 消息转发到相应的处理器,以完成不同的事务。,,一个简单的路由,可以直接以 JSON 对象的形式提供,比如:,```JavaScript,var http = require('http');,,var svr = new http.Server(8080, {, '/': r => r.response.write('home'),, '/help': r => r.response.write('help'),});,,svr.run();,```,如果需要更复杂的路由定制,可以自行创建 Routing 对象并根据需要处理路由策略:,```JavaScript,var http = require('http');,var mq = require('mq');,,var app = new mq.Routing();,,app.get('/', r => r.response.write('home'));,app.get('/help', r => r.response.write('help'));,,app.post('/help', r => r.response.write('post a help.'));,,app.get('/home/:user', (r, user) => r.response.write('hello ' + user));,,app.get('/user/:id(\\d+)', (r, id) => r.response.write('get ' + id));,,app.get('/actions', {, '/run': r => r.response.write('running'),, '/sleep': r => r.response.write('sleeping'),, '(.*)': r => r.response.write('........'),});,,var svr = new http.Server(8080, app);,svr.run();,```,路由对象根据设定的规则匹配消息,将消息传递给符合规则的第一个处理器。后加入的路由规则优先匹配。创建方法:,```JavaScript,var routing = new mq.Routing({, "^/func1(/.*)$": func1,, "^/func2(/.*)$": func2,});,```,正则表达式匹配的项目修改消息的 value 属性,子项目存入消息的 params 属性。例如:,```JavaScript,var routing = new mq.Routing({, "^/func1(/([0-9]+)/([0-9]+)\.html)$": func1,,});,```,匹配消息 "/func1/123/456.html" 后,value == "/123/456.html",params == ["123", "456"];,,如果匹配的结果没有子项,则 value 为空,params 为空。例如:,```JavaScript,var routing = new mq.Routing({, "^/func1/[0-9]+/[0-9]+\.html$": func1,,});,```,匹配消息 "/func1/123/456.html" 后,value == "",params == [];,,如果匹配的结果第一级有多个子项,则 value 为空,params 为第一级子项。例如:,```JavaScript,var routing = new mq.Routing({, "^/func1/([0-9]+)/([0-9]+)\.html$": func1,,});,```,匹配消息 "/func1/123/456.html" 后,value == "",params == ["123", "456"];,,如果匹配的结果只有一个子项,并且无下级子项,则 value 和 params 均为此子项。例如:,```JavaScript,var routing = new mq.Routing({, "^/func1/([0-9]+)/[0-9]+\.html$": func1,,});,```,匹配消息 "/func1/123/456.html" 后,value == "123",params == ["123"]; + */ +/// +declare class Class_Routing extends Class_Handler { + + + + /** + * + * @brief 创建一个消息处理器路由对象 + * @param map 初始化路由参数 + * + * + * + */ + constructor(map?: object/** = v8::Object::New(isolate)*/); + + /** + * + * @brief 创建一个消息处理器路由对象 + * @param method 指定 http 请求方法,"*" 接受所有方法 + * @param map 初始化路由参数 + * + * + * + */ + constructor(method: string, map: object); + + /** + * + * @brief 从已有路由对象中添加规则,添加后原路由将被清空 + * @param route 已经初始化的路由对象 + * @return 返回路由对象本身 + * + * + * + */ + append(route: Class_Routing): Class_Routing; + + /** + * + * @brief 添加一组路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + append(map: object): Class_Routing; + + /** + * + * @brief 添加一条路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + append(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一条路由规则 + * @param method 指定 http 请求方法,"*" 接受所有方法 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + append(method: string, pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组接受所有 http 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + all(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受所有 http 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + all(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组 GET 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + get(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http GET 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + get(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组接受 http POST 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + post(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http POST 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + post(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组接受 http DELETE 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + del(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http DELETE 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + del(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组 PUT 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + put(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http PUT 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + put(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组 PATCH 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + patch(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http PATCH 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + patch(pattern: string, hdlr: Class_Handler): Class_Routing; + + /** + * + * @brief 添加一组 FIND 方法路由规则 + * @param map 路由参数 + * @return 返回路由对象本身 + * + * + * + */ + find(map: object): Class_Routing; + + /** + * + * @brief 添加一条接受 http FIND 方法路由规则 + * @param pattern 消息匹配格式 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * @return 返回路由对象本身 + * + * + * + */ + find(pattern: string, hdlr: Class_Handler): Class_Routing; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SQLite.d.ts b/types/fibjs/declare/SQLite.d.ts new file mode 100644 index 0000000000..af499cfd03 --- /dev/null +++ b/types/fibjs/declare/SQLite.d.ts @@ -0,0 +1,66 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief sqlite 数据库连接对象 + * @detail 使用 db.open 或 db.openSQLite 创建,创建方式:,```JavaScript,var slite = db.openSQLite("sqlite:/path/to/db");,``` + */ +/// +declare class Class_SQLite extends Class_DbConnection { + + /** + * class prop + * + * + * @brief 当前数据库文件名 + * + * @readonly + * @type String + */ + + fileName: string + + /** + * class prop + * + * + * @brief 查询和设置数据库超时时间,以毫秒为单位 + * + * + * @type Integer + */ + + timeout: number + + + + /** + * + * @brief 备份当前数据库到新文件 + * @param fileName 指定备份的数据库文件名 + * + * @async + */ + backup(fileName: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SandBox.d.ts b/types/fibjs/declare/SandBox.d.ts new file mode 100644 index 0000000000..fc3152b232 --- /dev/null +++ b/types/fibjs/declare/SandBox.d.ts @@ -0,0 +1,255 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 安全沙箱对象,用于管理一个独立的运行空间 + * @detail 所有的代码都运行在自己的沙箱中,全局的 require 会调用当前沙箱加载模块,沙箱会通过 require 传递给加载的沙箱。下面的示例创建一个沙箱,限制只允许访问全局基础模块中的 assert 模块,并添加 a 和 b 两个定制模块:,```JavaScript,var vm = require('vm');,var sbox = new vm.SandBox({, a: 100,, b: 200,, assert: require('assert'),});,,var mod_in_sbox = sbox.require('./path/to/mod');,``` + */ + +declare class Class_SandBox extends Class__object { + + /** + * class prop + * + * + * @brief 查询沙箱的 global 对象 + * + * @readonly + * @type Object + */ + + global: object + + /** + * class prop + * + * + * @brief 查询沙箱中现存的所有模块的字典对象 + * + * + * @readonly + * @type Object + */ + + modules: object + + + + /** + * + * @brief 构造一个新的安全沙箱对象,并初始化基础模块 + * @param mods 指定要添加的模块对象字典 + * + * + * + */ + constructor(mods: object); + + /** + * + * @brief 构造一个新的安全沙箱对象,并初始化基础模块 + * @param mods 指定要添加的模块对象字典 + * @param require 自定义 require 函数,当模块不存在时,先调用自定义函数,无返回再从文件中加载 + * + * + * + */ + constructor(mods: object, require: Function); + + /** + * + * @brief 构造一个独立 Global 新的安全沙箱对象,并初始化基础模块 + * @param mods 指定要添加的模块对象字典 + * @param global 指定初始化的 Global 属性 + * + * + * + */ + constructor(mods: object, global: object); + + /** + * + * @brief 构造一个独立 Global 新的安全沙箱对象,并初始化基础模块 + * @param mods 指定要添加的模块对象字典 + * @param require 自定义 require 函数,当模块不存在时,先调用自定义函数,无返回再从文件中加载 + * @param global 指定初始化的 Global 属性 + * + * + * + */ + constructor(mods: object, require: Function, global: object); + + /** + * + * @brief 向沙箱中添加一个基础模块 + * @param id 指定要添加的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名 + * @param mod 指定要添加的模块对象 + * + * + * + */ + add(id: string, mod: any): void; + + /** + * + * @brief 向沙箱中添加一组基础模块 + * @param mods 指定要添加的模块对象字典,添加的 javascript 模块将会生成一份复制,以避免沙箱修改对象产生互相干扰 + * + * + * + */ + add(mods: object): void; + + /** + * + * @brief 向沙箱中添加一个脚本模块 + * @param srcname 指定要添加的脚本名称,srcname 必须包含扩展名,比如 json 或者 js, jsc + * @param script 指定要添加的二进制代码 + * @return 返回加载的模块对象 + * + * + * + */ + addScript(srcname: string, script: Class_Buffer): any; + + /** + * + * @brief 从沙箱中删除指定的基础模块 + * @param id 指定要删除的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名 + * + * + * + */ + remove(id: string): void; + + /** + * + * @brief 从沙箱中检测基础模块是否存在 + * @param id 指定要检测的模块名称,此路径与当前运行脚本无关,必须为绝对路径或者模块名 + * @return 是否存在 + * + * + * + */ + has(id: string): boolean; + + /** + * + * @brief 复制当前沙箱,新沙箱包含当前沙箱的模块,以及相同的名称和 require 函数 + * @return 复制的新沙箱 + * + * + * + */ + clone(): Class_SandBox; + + /** + * + * @brief 冻结当前沙箱,冻结后的沙箱,对 global 所做的修改将被忽略 + * + * + */ + freeze(): void; + + /** + * + * @brief 重新加载沙箱内的模块,此操作只会重新初始化模块,复位模块内的变量,不更新模块代码 + * + * + */ + refresh(): void; + + /** + * + * @brief 运行一个脚本 + * @param fname 指定要运行的脚本路径,此路径与当前运行脚本无关,必须为绝对路径 + * @param argv 指定要运行的参数,此参数可在脚本内使用 argv 获取 + * + * + * + */ + run(fname: string, argv?: any[]/** = v8::Array::New(isolate)*/): void; + + /** + * + * @brief 查询一个模块并返回模块完整文件名 + * @param id 指定要加载的模块名称 + * @param base 指定查找路径 + * @return 返回加载的模块完整文件名 + * + * + * + */ + resolve(id: string, base: string): string; + + /** + * + * @brief 加载一个模块并返回模块对象 + * @param id 指定要加载的模块名称 + * @param base 指定查找路径 + * @return 返回加载的模块对象 + * + * + * + */ + require(id: string, base: string): any; + + /** + * + * @brief 对指定的 extname 添加 compiler, extname 不可为系统内置扩展名 (包括 {'.js', '.json', '.jsc', '.wasm'}), compiler 需返回有效的 javascript 脚本. + * + * ```JavaScript + * var vm = require('vm'); + * var sbox = new vm.SandBox({ + * }); + * + * // 编译 typescript 脚本为 js 并加载 + * sbox.setModuleCompiler('.ts', tsCompiler); + * var mod_ts = sbox.require('./a.ts'); + * + * // 编译 coffee 脚本为 js 并加载 + * sbox.setModuleCompiler('.coffee', cafeCompiler); + * var mod_coffee = sbox.require('./a.coffee'); + * + * // 编译 jsx 脚本为 js 并加载 + * sbox.setModuleCompiler('.jsx', reactCompiler); + * var mod_react = sbox.require('./a.jsx'); + * + * // 编译 yml 脚本为自定义的内容(如 API 集合) 并加载 + * sbox.setModuleCompiler('.yml', yaml2Rest) + * sbox.setModuleCompiler('.yaml', yaml2Rest) + * + * // 编译 markdown 为自定义的内容(如 html 字符串或 XmlDocument 对象) 并加载 + * sbox.setModuleCompiler('.md', mdCompiler) + * sbox.setModuleCompiler('.markdown', mdCompiler) + * ``` + * + * @param extname 指定的 extname, 必须以 '.' 开头, 且为非系统内置扩展名 + * @param compiler 编译回调函数, 所有带 extname 的文件仅会 require 一次. 该回调函数格式为 `compiler(buf, requireInfo)`, buf 为读取到的文件 Buffer, requireInfo 结构为 `{filename: string}`. + * + * + * + */ + setModuleCompiler(extname: string, compiler: Function): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SeekableStream.d.ts b/types/fibjs/declare/SeekableStream.d.ts new file mode 100644 index 0000000000..06e0ae7aa2 --- /dev/null +++ b/types/fibjs/declare/SeekableStream.d.ts @@ -0,0 +1,112 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 可移动当前指针的流对象接口 + * @detail + */ +/// +declare class Class_SeekableStream extends Class_Stream { + + + + /** + * + * @brief 移动文件当前操作位置 + * @param offset 指定新的位置 + * @param whence 指定位置基准,允许的值为:SEEK_SET, SEEK_CUR, SEEK_END + * + * + * + */ + seek(offset: number, whence: number): void; + + /** + * + * @brief 查询流当前位置 + * @return 返回流当前位置 + * + * + * + */ + tell(): number; + + /** + * + * @brief 移动当前位置到流开头 + * + * + */ + rewind(): void; + + /** + * + * @brief 查询流尺寸 + * @return 返回流尺寸 + * + * + * + */ + size(): number; + + /** + * + * @brief 从流内读取剩余的全部数据 + * @return 返回从流内读取的数据,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + readAll(): Class_Buffer; + + /** + * + * @brief 修改文件尺寸,如果新尺寸小于原尺寸,则文件被截断 + * @param bytes 新的文件尺寸 + * + * + * @async + */ + truncate(bytes: number): void; + + /** + * + * @brief 查询文件是否到结尾 + * @return 返回 True 表示结尾 + * + * + * + */ + eof(): boolean; + + /** + * + * @brief 查询当前文件的基础信息 + * @return 返回 Stat 对象描述文件信息 + * + * + * @async + */ + stat(): Class_Stat; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Semaphore.d.ts b/types/fibjs/declare/Semaphore.d.ts new file mode 100644 index 0000000000..ac99421d88 --- /dev/null +++ b/types/fibjs/declare/Semaphore.d.ts @@ -0,0 +1,69 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 纤程信号量对象 + * @detail 信号量对象管理一个内部计数器,此计数器调用 acquire 或者 wait 后减一,调用 release 或者 post 后加一。,计数器不会减至负数,因为 acquire 和 wait 在发现数值为 0 的时候,会休眠当前纤程,直至其它纤程通过 release 或 post 增加计数器的值。,,信号量常用的场合是限制资源并发使用,以及生产者/消费者模式的应用。,,以数据库请求为例,限制资源并发使用的情形:,```JavaScript,var maxconnections = 5;,var l = new coroutine.Semaphore(maxconnections);,,......,,l.acquire();,var conn = connectdb(),.....,conn.close();,l.release();,```,,生产者/消费者模式通常则将信号量与队列配合使用。生产者向队列中加入数据,并 post 一个信号,消费者则先 wait 信号,获取信号后去队查询取数据。 + */ +/// +declare class Class_Semaphore extends Class_Lock { + + + + /** + * + * @brief 信号量构造函数 + * @param value 计数器初始数值 + * + * + * + */ + constructor(value?: number/** = 1*/); + + /** + * + * @brief 等待一个信号量,等同于 acquire(true) + * + * + */ + wait(): void; + + /** + * + * @brief 释放一个信号量,等同于 release() + * + * + */ + post(): void; + + /** + * + * @brief 尝试获取一个信号,如不能获取,则立即返回并返回 false,等同于 acquire(false) + * @return 获取成功则返回 true + * + * + * + */ + trywait(): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Service.d.ts b/types/fibjs/declare/Service.d.ts new file mode 100644 index 0000000000..7816e2d8bc --- /dev/null +++ b/types/fibjs/declare/Service.d.ts @@ -0,0 +1,176 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 系统服务管理对象 + * @detail + */ +/// +declare class Class_Service extends Class_EventEmitter { + + /** + * class prop + * + * + * @brief 查询和设置服务名称 + * + * + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 查询和绑定服务停止事件,相当于 on("stop", func); + * + * + * @type Function + */ + + onstop: Function + + /** + * class prop + * + * + * @brief 查询和绑定服务暂停事件,相当于 on("pause", func); + * + * + * @type Function + */ + + onpause: Function + + /** + * class prop + * + * + * @brief 查询和绑定服务恢复事件,相当于 on("continue", func); + * + * + * @type Function + */ + + oncontinue: Function + + + + /** + * + * @brief 系统服务管理对象构造函数 + * @param name 服务名称 + * @param worker 服务运行函数 + * @param event 服务事件处理 + * + * + * + */ + constructor(name: string, worker: Function, event?: object/** = v8::Object::New(isolate)*/); + + /** + * + * @brief 开始运行服务实体 + * + * @async + */ + run(): void; + + /** + * + * @brief 安装服务到系统 + * @param name 服务名称 + * @param cmd 服务命令行 + * @param displayName 服务显示名称 + * @param description 服务描述信息 + * + * + * + */ + static install(name: string, cmd: string, displayName?: string/** = ""*/, description?: string/** = ""*/): void; + + /** + * + * @brief 从系统中卸载服务 + * @param name 服务名称 + * + * + * + */ + static remove(name: string): void; + + /** + * + * @brief 启动服务 + * @param name 服务名称 + * + * + * + */ + static start(name: string): void; + + /** + * + * @brief 停止服务 + * @param name 服务名称 + * + * + * + */ + static stop(name: string): void; + + /** + * + * @brief 重启服务 + * @param name 服务名称 + * + * + * + */ + static restart(name: string): void; + + /** + * + * @brief 检测服务是否安装 + * @param name 服务名称 + * @return 服务安装返回 True + * + * + * + */ + static isInstalled(name: string): boolean; + + /** + * + * @brief 检测服务是否运行 + * @param name 服务名称 + * @return 服务运行返回 True + * + * + * + */ + static isRunning(name: string): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Smtp.d.ts b/types/fibjs/declare/Smtp.d.ts new file mode 100644 index 0000000000..584513c533 --- /dev/null +++ b/types/fibjs/declare/Smtp.d.ts @@ -0,0 +1,146 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Smtp对象 + * @detail + */ + +declare class Class_Smtp extends Class__object { + + /** + * class prop + * + * + * @brief 查询和设置超时时间 单位毫秒 + * + * + * @type Integer + */ + + timeout: number + + /** + * class prop + * + * + * @brief 查询 Smtp 对象当前连接的 Socket + * + * @readonly + * @type Stream + */ + + socket: Class_Stream + + + + /** + * + * @brief Smtp 对象构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 建立到指定的服务器 + * @param url 指定连接的协议,可以是:tcp://host:port 或者 ssl://host:port + * + * + * @async + */ + connect(url: string): void; + + /** + * + * @brief 发送指定命令,并返回响应,服务器报错则抛出错误 + * @param cmd 命令名 + * @param arg 参数 + * @return 如果成功,返回服务器响应 + * + * + * @async + */ + command(cmd: string, arg: string): string; + + /** + * + * @brief 发送 HELO 命令,服务器报错则抛出错误 + * @param hostname 主机名,缺省为“localhost” + * + * + * @async + */ + hello(hostname?: string/** = "localhost"*/): void; + + /** + * + * @brief 用指定的用户及密码登录服务器,服务器报错则抛出错误 + * @param username 用户名 + * @param password 密码 + * + * + * @async + */ + login(username: string, password: string): void; + + /** + * + * @brief 指定发件人信箱,服务器报错则抛出错误 + * @param address 发件人信箱 + * + * + * @async + */ + from(address: string): void; + + /** + * + * @brief 指定收件人信箱,服务器报错则抛出错误 + * @param address 收件人信箱 + * + * + * @async + */ + to(address: string): void; + + /** + * + * @brief 发送文本到收件人,服务器报错则抛出错误 + * @param txt 要发送的文本 + * + * + * @async + */ + data(txt: string): void; + + /** + * + * @brief 退出并关闭连接,服务器报错则抛出错误 + * + * @async + */ + quit(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Socket.d.ts b/types/fibjs/declare/Socket.d.ts new file mode 100644 index 0000000000..0e44b2e41d --- /dev/null +++ b/types/fibjs/declare/Socket.d.ts @@ -0,0 +1,232 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + + + +/** module Or Internal Object */ +/** + * @brief 网络套接口对象 + * @detail Socket 属于 net 模块,创建方法,```JavaScript,var s = new net.Socket();,``` + */ +/// +declare class Class_Socket extends Class_Stream { + + /** + * class prop + * + * + * @brief 查询当前 Socket 对象的地址集 + * + * @readonly + * @type Integer + */ + + family: number + + /** + * class prop + * + * + * @brief 查询当前 Socket 对象的协议族 + * + * @readonly + * @type Integer + */ + + type: number + + /** + * class prop + * + * + * @brief 查询当前连接的对方地址 + * + * @readonly + * @type String + */ + + remoteAddress: string + + /** + * class prop + * + * + * @brief 查询当前连接的对方端口 + * + * @readonly + * @type Integer + */ + + remotePort: number + + /** + * class prop + * + * + * @brief 查询当前连接的本地地址 + * + * @readonly + * @type String + */ + + localAddress: string + + /** + * class prop + * + * + * @brief 查询当前连接的本地端口 + * + * @readonly + * @type Integer + */ + + localPort: number + + /** + * class prop + * + * + * @brief 查询和设置超时时间 单位毫秒 + * + * + * @type Integer + */ + + timeout: number + + + + /** + * + * @brief Socket 构造函数,创建一个新的 Socket 对象 + * @param family 指定地址集,缺省为 AF_INET,ipv4 + * @param type 指定协议族,缺省为 SOCK_STREAM,tcp + * + * + * + */ + constructor(family?: number/** = undefined*/, type?: number/** = undefined*/); + + /** + * + * @brief 建立一个 tcp 连接 + * @param host 指定对方地址或主机名 + * @param port 指定对方端口 + * + * + * @async + */ + connect(host: string, port: number): void; + + /** + * + * @brief 将当前 Socket 绑定至本地所有地址的指定端口 + * @param port 指定绑定的端口 + * @param allowIPv4 指定是否接受 ipv4 连接,缺省为 true。本参数在 ipv6 时有效,并依赖于操作系统 + * + * + * + */ + bind(port: number, allowIPv4?: boolean/** = true*/): void; + + /** + * + * @brief 将当前 Socket 绑定至指定地址的指定端口 + * @param addr 指定绑定的地址 + * @param port 指定绑定的端口 + * @param allowIPv4 指定是否接受 ipv4 连接,缺省为 true。本参数在 ipv6 时有效,并依赖于操作系统 + * + * + * + */ + bind(addr: string, port: number, allowIPv4?: boolean/** = true*/): void; + + /** + * + * @brief 开始监听连接请求 + * @param backlog 指定请求队列长度,超出的请求将被拒绝,缺省为 120 + * + * + * + */ + listen(backlog?: number/** = 120*/): void; + + /** + * + * @brief 等待并接受一个连接 + * @return 返回接收到得连接对象 + * + * + * @async + */ + accept(): Class_Socket; + + /** + * + * @brief 从连接读取指定大小的数据,不同于 read 方法,recv 并不保证读完要求的数据,而是在读取到数据后立即返回 + * @param bytes 指定要读取的数据量,缺省读取任意尺寸的数据 + * @return 返回从连接读取的数据 + * + * + * @async + */ + recv(bytes?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 读取一个 UDP 包 + * recvfrom 返回结果中包含以下内容: + * - data: 接收到的二进制数据块 + * - address: 发送方的地址 + * - port: 发送方的端口 + * @param bytes 指定要读取的数据量,缺省读取任意尺寸的数据 + * @return 返回从连接读取的数据包 + * + * + * @async + */ + recvfrom(bytes?: number/** = -1*/): any; + + /** + * + * @brief 将给定的数据写入连接,此方法等效于 write 方法 + * @param data 给定要写入的数据 + * + * + * @async + */ + send(data: Class_Buffer): void; + + /** + * + * @brief 向给定 ip:port 发送一个 UDP 包 + * @param data 给定要写入的数据 + * @param host 指定目标 ip 或主机名 + * @param port 指定目标端口 + * + * + * @async + */ + sendto(data: Class_Buffer, host: string, port: number): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SslHandler.d.ts b/types/fibjs/declare/SslHandler.d.ts new file mode 100644 index 0000000000..9b5e6364c6 --- /dev/null +++ b/types/fibjs/declare/SslHandler.d.ts @@ -0,0 +1,106 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief ssl 协议转换处理器 + * @detail 用以将数据流转换为 ssl 流协议。SslHandler 是对 SslSocket 的封装,用于构建服务器,逻辑上相当于:,```JavaScript,var ss = new ssl.Socket(crt, key);,,function(s){, var s1 = ss.accept(s);, hdlr.invoke(s1);, s1.close();,},``` + */ +/// +declare class Class_SslHandler extends Class_Handler { + + /** + * class prop + * + * + * @brief 设定证书验证模式,缺省为 VERIFY_NONE + * + * + * @type Integer + */ + + verification: number + + /** + * class prop + * + * + * @brief 客户端证书验证证书链 + * + * @readonly + * @type X509Cert + */ + + ca: Class_X509Cert + + /** + * class prop + * + * + * @brief ssl 协议转换处理器当前事件处理接口对象 + * + * + * @type Handler + */ + + handler: Class_Handler + + + + /** + * + * @brief SslHandler 构造函数,创建一个新的 SslHandler 对象 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(certs: any[], hdlr: Class_Handler); + + /** + * + * @brief SslHandler 构造函数,创建一个新的 SslHandler 对象 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey, hdlr: Class_Handler); + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SslServer.d.ts b/types/fibjs/declare/SslServer.d.ts new file mode 100644 index 0000000000..79b732600b --- /dev/null +++ b/types/fibjs/declare/SslServer.d.ts @@ -0,0 +1,137 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief ssl 服务器对象,可方便创建一个标准多纤程 ssl 服务器 + * @detail SslServer 对象是将 TcpServer 和 SslHandler 组合封装的对象,方便快速搭建服务器,逻辑上相当于:,```JavaScript,var svr = new net.SslServer(addr, port, new ssl.Handler(crt, key, function(req){, ...,}));,```,,创建方法:,```JavaScript,var ssl = require("ssl");,var svr = new http.Server(crt, key, function(req){, ...,});,``` + */ +/// +declare class Class_SslServer extends Class_TcpServer { + + /** + * class prop + * + * + * @brief 设定证书验证模式,缺省为 VERIFY_NONE + * + * + * @type Integer + */ + + verification: number + + /** + * class prop + * + * + * @brief 客户端证书验证证书链 + * + * @readonly + * @type X509Cert + */ + + ca: Class_X509Cert + + + + /** + * + * @brief SslServer 构造函数,在所有本机地址侦听 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * @param port 指定 ssl 服务器侦听端口 + * @param listener 指定 ssl 接收到的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(certs: any[], port: number, listener: Class_Handler); + + /** + * + * @brief SslServer 构造函数 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * @param addr 指定 ssl 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 ssl 服务器侦听端口 + * @param listener 指定 ssl 接收到的连接的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(certs: any[], addr: string, port: number, listener: Class_Handler); + + /** + * + * @brief SslServer 构造函数,在所有本机地址侦听 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * @param port 指定 ssl 服务器侦听端口 + * @param listener 指定 ssl 接收到的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey, port: number, listener: Class_Handler); + + /** + * + * @brief SslServer 构造函数 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * @param addr 指定 ssl 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 ssl 服务器侦听端口 + * @param listener 指定 ssl 接收到的连接的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey, addr: string, port: number, listener: Class_Handler); + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SslSocket.d.ts b/types/fibjs/declare/SslSocket.d.ts new file mode 100644 index 0000000000..7406b0d2f3 --- /dev/null +++ b/types/fibjs/declare/SslSocket.d.ts @@ -0,0 +1,139 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief ssl 网络套接口对象 + * @detail SslSocket 属于 ssl 模块,创建方法,```JavaScript,var s = new ssl.Socket();,``` + */ +/// +declare class Class_SslSocket extends Class_Stream { + + /** + * class prop + * + * + * @brief 设定证书验证模式,缺省为 VERIFY_REQUIRED + * + * + * @type Integer + */ + + verification: number + + /** + * class prop + * + * + * @brief 证书链,客户端模式 connect 时自动引用 ssl.ca,服务器模式 accept 生成 SslSocket 自动引用当前 SslSocket 的 ca + * + * @readonly + * @type X509Cert + */ + + ca: Class_X509Cert + + /** + * class prop + * + * + * @brief 连接对方的证书 + * + * @readonly + * @type X509Cert + */ + + peerCert: Class_X509Cert + + /** + * class prop + * + * + * @brief 查询消息 ssl 建立时的下层流对象 + * + * @readonly + * @type Stream + */ + + stream: Class_Stream + + + + /** + * + * @brief SslSocket 构造函数,创建一个新的 SslSocket 对象 + * + * certs 格式为: + * ```JavaScript + * [ + * { + * crt: [X509Cert object], + * key: [PKey object] + * }, + * { + * crt: [X509Cert object], + * key: [PKey object] + * } + * ] + * ``` + * @param certs 服务器证书列表 + * + * + * + */ + constructor(certs?: any[]/** = v8::Array::New(isolate)*/); + + /** + * + * @brief SslSocket 构造函数,创建一个新的 SslSocket 对象 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * + * + * + */ + constructor(crt: Class_X509Cert, key: Class_PKey); + + /** + * + * @brief 在给定的连接上连接 ssl 连接,客户端模式 + * @param s 给定的底层连接 + * @param server_name 指定服务器名称,可缺省 + * @return 连接成功返回 0,证书可选验证时,验证不成功则返回非 0,详细错误见 ssl 模块 + * + * + * @async + */ + connect(s: Class_Stream, server_name?: string/** = ""*/): number; + + /** + * + * @brief 在给定的连接上接收一个 ssl 连接,并生成一个新的 SslSocket + * @param s 给定的底层连接 + * @return 返回新建立的 SslSocket 对象 + * + * + * @async + */ + accept(s: Class_Stream): Class_SslSocket; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Stat.d.ts b/types/fibjs/declare/Stat.d.ts new file mode 100644 index 0000000000..545a9c8e1d --- /dev/null +++ b/types/fibjs/declare/Stat.d.ts @@ -0,0 +1,219 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 文件的基础信息对象 + * @detail Stat 对象通过 fs.stat, File.stat, fs.readdir 查询,不可独立创建 + */ + +declare class Class_Stat extends Class__object { + + /** + * class prop + * + * + * @brief 文件名称 + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 文件尺寸 + * + * @readonly + * @type Long + */ + + size: number + + /** + * class prop + * + * + * @brief 文件权限,Windows 不支持此属性 + * + * @readonly + * @type Integer + */ + + mode: number + + /** + * class prop + * + * + * @brief 文件最后修改时间 + * + * @readonly + * @type Date + */ + + mtime: Date + + /** + * class prop + * + * + * @brief 文件最后访问时间 + * + * @readonly + * @type Date + */ + + atime: Date + + /** + * class prop + * + * + * @brief 文件创建时间 + * + * @readonly + * @type Date + */ + + ctime: Date + + /** + * class prop + * + * + * @brief 文件拥有者的id + * + * @readonly + * @type Integer + */ + + uid: number + + /** + * class prop + * + * + * @brief 文件所属的组id + * + * @readonly + * @type Integer + */ + + gid: number + + + + /** + * + * @brief 查询文件是否有写入权限 + * @return 为 true 则有写入权限 + * + * + * + */ + isWritable(): boolean; + + /** + * + * @brief 查询文件是否有读权限 + * @return 为 true 则有读权限 + * + * + * + */ + isReadable(): boolean; + + /** + * + * @brief 查询文件是否有执行权限 + * @return 为 true 则有执行权限 + * + * + * + */ + isExecutable(): boolean; + + /** + * + * @brief 查询文件是否隐藏 + * @return 为 true 则隐藏 + * + * + * + */ + isHidden(): boolean; + + /** + * + * @brief 查询文件是否是目录 + * @return 为 true 则是目录 + * + * + * + */ + isDirectory(): boolean; + + /** + * + * @brief 查询文件是否是文件 + * @return 为 true 则是文件 + * + * + * + */ + isFile(): boolean; + + /** + * + * @brief 查询文件是否是符号链接 + * @return 为 true 则是符号链接 + * + * + * + */ + isSymbolicLink(): boolean; + + /** + * + * @brief 查询文件是否是内存文件 + * @return 为 true 则是内存文件 + * + * + * + */ + isMemory(): boolean; + + /** + * + * @brief 查询文件是否是 Socket + * @return 为 true 则是 Socket + * + * + * + */ + isSocket(): boolean; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Stats.d.ts b/types/fibjs/declare/Stats.d.ts new file mode 100644 index 0000000000..291795b34a --- /dev/null +++ b/types/fibjs/declare/Stats.d.ts @@ -0,0 +1,103 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 数据统计对象,用以构建应用运行时数据收集 + * @detail 创建方法:,```JavaScript,var util = require("util");,var stats = new util.Stats(["begin", "end", "error"]);,```,一些内部对象会提供预先定义的的统计对象 + */ + +declare class Class_Stats extends Class__object { + + + + /** + * + * @brief 数据统计对象构造方法 + * @param keys 指定计数器的名称 + * + * + * + */ + constructor(keys: any[]); + + /** + * + * @brief 数据统计对象构造方法 + * @param staticKeys 指定静态计数器的名称,静态计数器不会被 reset + * @param keys 指定计数器的名称 + * + * + * + */ + constructor(staticKeys: any[], keys: any[]); + + /** + * + * @brief 指定的计数器增一 + * @param key 指定计数器名称 + * + * + * + */ + inc(key: string): void; + + /** + * + * @brief 指定的计数器减一 + * @param key 指定计数器名称 + * + * + * + */ + dec(key: string): void; + + /** + * + * @brief 指定的计数器加指定值 + * @param key 指定计数器名称 + * @param value 指定数值 + * + * + * + */ + add(key: string, value: number): void; + + /** + * + * @brief 初始化计数器,除 staticKeys 指定的计数器全部清零 + * + * + */ + reset(): void; + + /** + * + * @brief 查询上次 reset 到现在的运行时间 + * @return 返回上次 reset 到现在的运行时间 + * + * + * + */ + uptime(): number; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Stream.d.ts b/types/fibjs/declare/Stream.d.ts new file mode 100644 index 0000000000..301d422e91 --- /dev/null +++ b/types/fibjs/declare/Stream.d.ts @@ -0,0 +1,82 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 流操作对象,用于二进制数据流读写 + * @detail Stream 为基础对象,用于为流处理定义标准借口,不能独立创建 + */ + +declare class Class_Stream extends Class__object { + + + + /** + * + * @brief 从流内读取指定大小的数据 + * @param bytes 指定要读取的数据量,缺省为读取随机大小的数据块,读出的数据尺寸取决于设备 + * @return 返回从流内读取的数据,若无数据可读,或者连接中断,则返回 null + * + * + * @async + */ + read(bytes?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 将给定的数据写入流 + * @param data 给定要写入的数据 + * + * + * @async + */ + write(data: Class_Buffer): void; + + /** + * + * @brief 将文件缓冲区内容写入物理设备 + * + * @async + */ + flush(): void; + + /** + * + * @brief 关闭当前流对象 + * + * @async + */ + close(): void; + + /** + * + * @brief 复制流数据到目标流中 + * @param stm 目标流对象 + * @param bytes 复制的字节数 + * @return 返回复制的字节数 + * + * + * @async + */ + copyTo(stm: Class_Stream, bytes?: number/** = -1*/): number; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/StringDecoder.d.ts b/types/fibjs/declare/StringDecoder.d.ts new file mode 100644 index 0000000000..a03c9ccadc --- /dev/null +++ b/types/fibjs/declare/StringDecoder.d.ts @@ -0,0 +1,146 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 流解码对象 + * @detail + */ + +declare class Class_StringDecoder extends Class__object { + + /** + * class prop + * + * + * @brief 内部使用。 + * + * + * @type Integer + */ + + lastNeed: number + + /** + * class prop + * + * + * @brief 内部使用。 + * + * + * @type Integer + */ + + lastTotal: number + + /** + * class prop + * + * + * @brief 内部使用。 + * + * + * @type Buffer + */ + + lastChar: Class_Buffer + + /** + * class prop + * + * + * @brief 解码编码.内部使用。 + * + * + * @type String + */ + + encoding: string + + + + /** + * + * @brief 解码器构造函数 + * @param encoding 解码编码. 默认 'utf8'. + * + * + * + */ + constructor(encoding?: string/** = "utf8"*/); + + /** + * + * @brief 将内部存留的 buffer 作为字符返回。不完整的 UTF-8 和 UTF-16 字节会尝试补全。 + * @return 解码后的字符串. + * + * + * + */ + end(): string; + + /** + * + * @brief 将内部存留的 buffer 作为字符返回。不完整的 UTF-8 和 UTF-16 字节会尝试补全。 + * @param buf 需要解码的 Buffer. 在执行 end 之前,会先调用 write 将 buffer 写入。 + * @return 解码后的字符串. + * + * + * + */ + end(buf: Class_Buffer): string; + + /** + * + * @brief 返回一个解码后的字符串, 确保任何非完整的末尾字符被省略此次不返回,并被存储在内部供下一次的 write 或者 end 方法使用。 + * @param buf 需要解码的 Buffer。 + * @return 解码后的字符串. + * + * + * + */ + write(buf: Class_Buffer): string; + + /** + * + * @brief 内部使用。. + * @param buf 需要解码的 Buffer。 + * @param offset 解码偏移量 + * @return 解码后的字符串. + * + * + * + */ + text(buf: Class_Buffer, offset: number): string; + + /** + * + * @brief 内部使用。. + * @param buf A Buffer containing the bytes to decode. + * @return 解码后的字符串. + * + * + * + */ + fillLast(buf: Class_Buffer): string; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/SubProcess.d.ts b/types/fibjs/declare/SubProcess.d.ts new file mode 100644 index 0000000000..59fe0da0c3 --- /dev/null +++ b/types/fibjs/declare/SubProcess.d.ts @@ -0,0 +1,103 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 子进程对象 + * @detail ```JavaScript,var process = require("process");,var sub = process.open("ls");,``` + */ +/// +declare class Class_SubProcess extends Class_BufferedStream { + + /** + * class prop + * + * + * @brief 读取当前对象指向的进程的 id + * + * + * @readonly + * @type Integer + */ + + pid: number + + /** + * class prop + * + * + * @brief 读取当前对象指向的进程的标准输入对象 + * + * + * @readonly + * @type BufferedStream + */ + + stdin: Class_BufferedStream + + /** + * class prop + * + * + * @brief 读取当前对象指向的进程的标准输出对象 + * + * + * @readonly + * @type BufferedStream + */ + + stdout: Class_BufferedStream + + + + /** + * + * @brief 杀掉当前对象指向的进程,并传递信号 + * @param signal 传递的信号 + * + * + * + */ + kill(signal: number): void; + + /** + * + * @brief 等待当前对象指向的进程结束,并返回进程结束代码 + * @return 进程的结束代码 + * + * + * @async + */ + wait(): number; + + /** + * + * @brief 查询当前对象所指向的进程是否存在指定名称的窗口,仅限 windows + * @param name 窗口名称 + * @return 窗口存在则返回窗口的 rect,否则返回 undefined + * + * + * + */ + findWindow(name: string): any; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/TcpServer.d.ts b/types/fibjs/declare/TcpServer.d.ts new file mode 100644 index 0000000000..19d9ddcfb9 --- /dev/null +++ b/types/fibjs/declare/TcpServer.d.ts @@ -0,0 +1,127 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief tcp 服务器对象,可方便创建一个标准多纤程 tcp 服务器 + * @detail 使用 TcpServer 对象可以迅速创建一个多纤程并发处理的 tcp 服务器。,```JavaScript,function func(conn),{, var data;,, while(data = conn.read()), conn.write(data);,, conn.close();,},,new net.TcpServer(8080, func).run();,``` + */ + +declare class Class_TcpServer extends Class__object { + + /** + * class prop + * + * + * @brief 服务器当前侦听的 Socket 对象 + * + * @readonly + * @type Socket + */ + + socket: Class_Socket + + /** + * class prop + * + * + * @brief 服务器当前事件处理接口对象 + * + * + * @type Handler + */ + + handler: Class_Handler + + /** + * class prop + * + * + * @brief 查询当前服务器运行状态 + * + * 返回的结果为一个 Stats 对象,初始化计数器如下: + * ```JavaScript + * { + * total : 1000, // 总计处理的连接 + * connections : 100, // 当前正在处理的连接 + * accept : 10, // 上次查询后新建的连接 + * close : 10 // 上次查询后关闭的连接 + * } + * ``` + * + * + * @readonly + * @type Stats + */ + + stats: Class_Stats + + + + /** + * + * @brief TcpServer 构造函数,在所有本机地址侦听 + * @param port 指定 tcp 服务器侦听端口 + * @param listener 指定 tcp 接收到的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(port: number, listener: Class_Handler); + + /** + * + * @brief TcpServer 构造函数 + * @param addr 指定 tcp 服务器侦听地址,为 "" 则在本机所有地址侦听 + * @param port 指定 tcp 服务器侦听端口 + * @param listener 指定 tcp 接收到的连接的内置消息处理器,处理函数,链式处理数组,路由对象,详见 mq.Handler + * + * + * + */ + constructor(addr: string, port: number, listener: Class_Handler); + + /** + * + * @brief 运行服务器并开始接收和分发连接,此函数不会返回 + * + * @async + */ + run(): void; + + /** + * + * @brief 异步运行服务器并开始接收和分发连接,调用后立即返回,服务器在后台运行 + * + * + */ + asyncRun(): void; + + /** + * + * @brief 关闭 socket中止正在运行的服务器 + * + * @async + */ + stop(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Timer.d.ts b/types/fibjs/declare/Timer.d.ts new file mode 100644 index 0000000000..c18b313cc9 --- /dev/null +++ b/types/fibjs/declare/Timer.d.ts @@ -0,0 +1,73 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 定时器处理器对象 + * @detail + */ + +declare class Class_Timer extends Class__object { + + /** + * class prop + * + * + * @brief 查询当前定时器是否已经终止 + * + * @readonly + * @type Boolean + */ + + stopped: boolean + + + + /** + * + * @brief 维持 fibjs 进程不退出,在定时器等待期间阻止 fibjs 进程退出 + * @return 返回定时器对象 + * + * + * + */ + ref(): Class_Timer; + + /** + * + * @brief 允许 fibjs 进程退出,在定时器等待期间允许 fibjs 进程退出 + * @return 返回定时器对象 + * + * + * + */ + unref(): Class_Timer; + + /** + * + * @brief 取消当前定时器 + * + * + */ + clear(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/UrlObject.d.ts b/types/fibjs/declare/UrlObject.d.ts new file mode 100644 index 0000000000..5baa5b2d7d --- /dev/null +++ b/types/fibjs/declare/UrlObject.d.ts @@ -0,0 +1,279 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief Url 处理对象 + * @detail 基础模块。提供 url 的格式化,解析与拼装,```JavaScript,var url = new net.Url('http://www.xici.net/');,var url = new net.Url({protocol: 'http:', hostname:'www.xici.net', pathname:'/'});,``` + */ + +declare class Class_UrlObject extends Class__object { + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的完整 url 地址描述,此描述由其他所有属性组装而成 + * + * + * + * @type String + */ + + href: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的协议名称 + * + * + * + * @type String + */ + + protocol: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象是否包含双斜杠 + * + * + * + * @type Boolean + */ + + slashes: boolean + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的完整验证字符串,由 username 和 password 属性组装而成 + * + * + * + * @type String + */ + + auth: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的验证用户 + * + * + * + * @type String + */ + + username: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的验证密码 + * + * + * + * @type String + */ + + password: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的完整主机描述,由 hastname 和 port 组装而成 + * + * + * + * @type String + */ + + host: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的主机名 + * + * + * + * @type String + */ + + hostname: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的端口号 + * + * + * + * @type String + */ + + port: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的请求完整路径(含请求),由 pathname 和 query 组装而成 + * + * + * + * @type String + */ + + path: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的路径 + * + * + * + * @type String + */ + + pathname: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的请求字符串(含“?”),等效于“?”+query + * + * + * + * @type String + */ + + search: string + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的请求字符串( 不含“?”) + * + * + * + * @type Value + */ + + query: any + + /** + * class prop + * + * + * @brief 查询和设置当前 UrlObject 对象中的请求锚点(含“\#”) + * + * + * + * @type String + */ + + hash: string + + + + /** + * + * @brief UrlObject 对象构造函数,使用参数构造 + * @param args 指定构造参数的字典对象,支持的字段有:protocol, slashes, username, password, hostname, port, pathname, query, hash + * + * + * + */ + constructor(args: object); + + /** + * + * @brief UrlObject 对象构造函数,使用 url 字符串构造 + * @param url 指定构造 url 字符串 + * @param parseQueryString 指定是否解析 query + * @param slashesDenoteHost 默认为false, 如果设置为true,则从字符串'//'之后到下一个'/'之前的字符串会被解析为host,例如'//foo/bar', 结果应该是{host: 'foo', pathname: '/bar'}而不是{pathname: '//foo/bar'} + * + * + * + */ + constructor(url?: string/** = ""*/, parseQueryString?: boolean/** = false*/, slashesDenoteHost?: boolean/** = false*/); + + /** + * + * @brief 解析一个 url 字符串 + * @param url 指定需要解析的 url 字符串 + * @param parseQueryString 指定是否解析 query + * @param slashesDenoteHost 默认为false, 如果设置为true,则从字符串'//'之后到下一个'/'之前的字符串会被解析为host,例如'//foo/bar', 结果应该是{host: 'foo', pathname: '/bar'}而不是{pathname: '//foo/bar'} + * + * + * + */ + parse(url: string, parseQueryString?: boolean/** = false*/, slashesDenoteHost?: boolean/** = false*/): void; + + /** + * + * @brief 使用指定的参数构造 UrlObject + * @param args 指定构造参数的字典对象,支持的字段有:protocol, slashes, username, password, hostname, port, pathname, query, hash + * + * + * + */ + format(args: object): void; + + /** + * + * @brief 重定位 url 路径,自动识别新路径为相对路径还是绝对路径 + * @param url 指定新的路径 + * @return 返回包含重定位数据的对象 + * + * + * + */ + resolve(url: string): Class_UrlObject; + + /** + * + * @brief 标准化路径 + * + * + * + */ + normalize(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/WebSocket.d.ts b/types/fibjs/declare/WebSocket.d.ts new file mode 100644 index 0000000000..3054397004 --- /dev/null +++ b/types/fibjs/declare/WebSocket.d.ts @@ -0,0 +1,192 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief WebSocket 包协议转换处理器 + * @detail 用以将 Http 协议转换为 WebSocket 包协议消息。创建方式:,```JavaScript,var ws = require('ws');,var http = require('http');,,var serv = new http.Server(8811, ws.upgrade((conn) => {,conn.onmessage = msg => {, conn.send(new Date());,};,}));,,serv.run(r => 0);,,var sock = new ws.Socket('ws://127.0.0.1:8811');,sock.on('open', () => {, setInterval(() => {, sock.send('get date');, }, 1000);,});,,sock.onmessage = evt => {, console.log(evt.data);,},``` + */ +/// +declare class Class_WebSocket extends Class_EventEmitter { + + /** + * class prop + * + * + * @brief 查询当前对象连接的服务器 + * + * @readonly + * @type String + */ + + url: string + + /** + * class prop + * + * + * @brief 查询当前对象连接时的协议 + * + * @readonly + * @type String + */ + + protocol: string + + /** + * class prop + * + * + * @brief 查询当前对象连接的源 + * + * @readonly + * @type String + */ + + origin: string + + /** + * class prop + * + * + * @brief 查询当前对象的连接状态,参见 ws + * + * @readonly + * @type Integer + */ + + readyState: number + + /** + * class prop + * + * + * @brief 查询和绑定连接成功事件,相当于 on("open", func); + * + * + * @type Function + */ + + onopen: Function + + /** + * class prop + * + * + * @brief 查询和绑定接受到对方消息的事件,相当于 on("message", func); + * + * + * @type Function + */ + + onmessage: Function + + /** + * class prop + * + * + * @brief 查询和绑定连接关闭的事件,相当于 on("close", func); + * + * + * @type Function + */ + + onclose: Function + + /** + * class prop + * + * + * @brief 查询和绑定错误发生的事件,相当于 on("error", func); + * + * + * @type Function + */ + + onerror: Function + + + + /** + * + * @brief WebSocket 构造函数 + * @param url 指定连接的服务器 + * @param protocol 指定握手协议,缺省为 "" + * @param origin 指定握手时模拟的源 + * + * + * + */ + constructor(url: string, protocol?: string/** = ""*/, origin?: string/** = ""*/); + + /** + * + * @brief 关闭当前连接,此操作会向对方发送 CLOSE 数据包,并等待对方响应 + * @param code 指定关闭的代码,允许值为 3000-4999 或者 1000,缺省为 1000 + * @param reason 指定关闭的原因,缺省为 "" + * + * + * + */ + close(code?: number/** = 1000*/, reason?: string/** = ""*/): void; + + /** + * + * @brief 向对方发送一段文本 + * @param data 指定发送的文本 + * + * + * + */ + send(data: string): void; + + /** + * + * @brief 向对方发送一段二进制数据 + * @param data 指定发送的二进制数据 + * + * + * + */ + send(data: Class_Buffer): void; + + /** + * + * @brief 维持 fibjs 进程不退出,在对象绑定期间阻止 fibjs 进程退出 + * @return 返回当前对象 + * + * + * + */ + ref(): Class_WebSocket; + + /** + * + * @brief 允许 fibjs 进程退出,在对象绑定期间允许 fibjs 进程退出 + * @return 返回当前对象 + * + * + * + */ + unref(): Class_WebSocket; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/WebSocketMessage.d.ts b/types/fibjs/declare/WebSocketMessage.d.ts new file mode 100644 index 0000000000..14008263b7 --- /dev/null +++ b/types/fibjs/declare/WebSocketMessage.d.ts @@ -0,0 +1,84 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + + + +/** module Or Internal Object */ +/** + * @brief websocket 消息对象 + * @detail 创建方法:,```JavaScript,var ws = require("ws");,,var msg = new ws.Message();,``` + */ +/// +declare class Class_WebSocketMessage extends Class_Message { + + /** + * class prop + * + * + * @brief 查询和读取 websocket 掩码标记,缺省为 true + * + * + * @type Boolean + */ + + masked: boolean + + /** + * class prop + * + * + * @brief 查询和读取 websocket 压缩状态,缺省为 false + * + * + * @type Boolean + */ + + compress: boolean + + /** + * class prop + * + * + * @brief 查询和设置最大包尺寸,以字节为单位,缺省为 67108864(64M) + * + * + * @type Integer + */ + + maxSize: number + + + + /** + * + * @brief 包处理消息对象构造函数 + * @param type websocket 消息类型,缺省为 websocket.BINARY + * @param masked websocket 消息掩码,缺省为 true + * @param compress 标记消息是否压缩,缺省为 false + * @param maxSize 最大包尺寸,以 MB 为单位,缺省为 67108864(64M) + * + * + * + */ + constructor(type?: number/** = undefined*/, masked?: boolean/** = true*/, compress?: boolean/** = false*/, maxSize?: number/** = 67108864*/); + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/WebView.d.ts b/types/fibjs/declare/WebView.d.ts new file mode 100644 index 0000000000..a5035b662e --- /dev/null +++ b/types/fibjs/declare/WebView.d.ts @@ -0,0 +1,172 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 浏览器窗口对象 + * @detail WebView 是一个嵌入浏览器的窗口组件,目前仅支持 windows ie。,,由于 WebView 内的 JavaScript 程序与 fibjs 并不在同一个引擎内,所以如果需要与宿主程序进行通讯,需要通过消息进行。,,WebView 用于通讯的对象是 external,external 支持一个方法 postMessage 和两个事件 onmessage、onclose。,,一个简单的通讯示例代码如下:,```JavaScript,// index.js,var gui = require('gui');,var webview = gui.open('fs:index.html');,,webview.onmessage = msg => console.log(msg);,,webview.onload = evt => webview.postMessage("hello from fibjs");,,webview.wait();,```,,index.html 的内容如下:,```html,,```, 在用户窗口关闭之前,会触发 external.onclose 事件,external.onclose 可以决定是否关闭。如果 external.onclose 返回 false,则此次操作取消,否则将关闭窗口。,,以下的例子,会在用户点关闭后等待 5 秒后再关闭窗口。,```html,,```,上面的代码中,因为 window.close 本身也会触发 onclose 事件,所以需要增加一个开关变量,用于识别是否需要处理此次事件。 + */ +/// +declare class Class_WebView extends Class_EventEmitter { + + /** + * class prop + * + * + * @brief 查询和设置窗口是否显示 + * + * + * @type Boolean + */ + + visible: boolean + + /** + * class prop + * + * + * @brief 查询和绑定加载成功事件,相当于 on("load", func); + * + * + * @type Function + */ + + onload: Function + + /** + * class prop + * + * + * @brief 查询和绑定窗口移动事件,相当于 on("move", func); + * + * 以下示例会在窗口移动时输出窗口的左上角坐标: + * ```JavaScript + * var gui = require('gui'); + * var webview = gui.open('fs:index.html'); + * + * webview.onmove = evt => console.log(evt.left, evt.top); + * ``` + * + * + * + * @type Function + */ + + onmove: Function + + /** + * class prop + * + * + * @brief 查询和绑定窗口尺寸改变事件,相当于 on("size", func); + * + * 以下示例会在窗口改变大小时输出窗口的尺寸: + * ```JavaScript + * var gui = require('gui'); + * var webview = gui.open('fs:index.html'); + * + * webview.onresize = evt => console.log(evt.width, evt.height); + * ``` + * + * + * + * @type Function + */ + + onresize: Function + + /** + * class prop + * + * + * @brief 查询和绑定窗口关闭事件,WebView 关闭后会触发此时间,相当于 on("closed", func); + * + * + * @type Function + */ + + onclosed: Function + + /** + * class prop + * + * + * @brief 查询和绑定接受 webview 内 postMessage 消息事件,相当于 on("message", func); + * + * + * @type Function + */ + + onmessage: Function + + + + /** + * + * @brief 设置 webview 的页面 html + * @param html 设置的 html + * + * + * @async + */ + setHtml(html: string): void; + + /** + * + * @brief 打印当前窗口文档 + * @param mode 打印参数,0: 快速打印; 1: 标准打印; 2: 打印预览。缺省为 1 + * + * + * @async + */ + print(mode?: number/** = 1*/): void; + + /** + * + * @brief 关闭当前窗口 + * + * @async + */ + close(): void; + + /** + * + * @brief 等待当前窗口关闭 + * 宿主程序在创建窗口后,需要进入等待,否则随着宿主程序的退出,窗口将自动关闭。同时 wait 的调用也并不是必须的,你可以在打开窗口后处理其它业务,只需要保证程序不会自行退出即可。 + * + * + * @async + */ + wait(): void; + + /** + * + * @brief 向 webview 内发送消息 + * postMessage 需要在窗口加载完成后发送消息,在此之前发送的消息会丢失。因此建议在 onload 事件触发后再调用此方法。 + * @param msg 要发送的消息 + * + * + * @async + */ + postMessage(msg: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/Worker.d.ts b/types/fibjs/declare/Worker.d.ts new file mode 100644 index 0000000000..c427f6f41c --- /dev/null +++ b/types/fibjs/declare/Worker.d.ts @@ -0,0 +1,66 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief 独立线程工作对象 + * @detail + */ +/// +declare class Class_Worker extends Class_EventEmitter { + + /** + * class prop + * + * + * @brief 查询和绑定接受 postMessage 消息事件,相当于 on("message", func); + * + * + * @type Function + */ + + onmessage: Function + + + + /** + * + * @brief Worker 对象构造函数 + * @param path 指定 Worker 入口脚本,只接受绝对路径 + * @param opts 构造选项,暂未支持 + * + * + * + */ + constructor(path: string, opts?: object/** = v8::Object::New(isolate)*/); + + /** + * + * @brief 向 Master 或 Worker 发送消息, + * @param data 指定发送的消息内容 + * + * + * + */ + postMessage(data: any): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/X509Cert.d.ts b/types/fibjs/declare/X509Cert.d.ts new file mode 100644 index 0000000000..5090f422cf --- /dev/null +++ b/types/fibjs/declare/X509Cert.d.ts @@ -0,0 +1,263 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief x509 证书对象 + * @detail X509Cert 对象属于 crypto 模块,创建:,```JavaScript,var k = new crypto.X509Cert();,``` + */ + +declare class Class_X509Cert extends Class__object { + + /** + * class prop + * + * + * @brief 获取证书的版本 + * + * @readonly + * @type Integer + */ + + version: number + + /** + * class prop + * + * + * @brief 获取证书的序列号 + * + * @readonly + * @type String + */ + + serial: string + + /** + * class prop + * + * + * @brief 获取证书颁发者的可分辨名称 + * + * @readonly + * @type String + */ + + issuer: string + + /** + * class prop + * + * + * @brief 获取证书的主题可分辨名称 + * + * @readonly + * @type String + */ + + subject: string + + /** + * class prop + * + * + * @brief 获取证书的生效时间 + * + * @readonly + * @type Date + */ + + notBefore: Date + + /** + * class prop + * + * + * @brief 获取证书的到期时间 + * + * @readonly + * @type Date + */ + + notAfter: Date + + /** + * class prop + * + * + * @brief 获取证书是否是 ca 证书 + * + * @readonly + * @type Boolean + */ + + ca: boolean + + /** + * class prop + * + * + * @brief 获取证书的 pathlen + * + * @readonly + * @type Integer + */ + + pathlen: number + + /** + * class prop + * + * + * @brief 获取证书的使用范围 + * + * 结果为全部或部分以下内容:digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign + * + * + * @readonly + * @type String + */ + + usage: string + + /** + * class prop + * + * + * @brief 获取证书的 Netscape 证书类型 + * + * 结果为全部或部分以下内容:client, server, email, objsign, reserved, sslCA, emailCA, objCA + * + * + * @readonly + * @type String + */ + + type: string + + /** + * class prop + * + * + * @brief 获取证书的公钥 + * + * @readonly + * @type PKey + */ + + publicKey: Class_PKey + + /** + * class prop + * + * + * @brief 获取证书链中得下一个证书 + * + * @readonly + * @type X509Cert + */ + + next: Class_X509Cert + + + + /** + * + * @brief X509Cert 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 加载一个 DER 格式的证书,可多次调用 + * @param derCert DER 格式的证书 + * + * + * + */ + load(derCert: Class_Buffer): void; + + /** + * + * @brief 加载一个 CRT/PEM/TXT 格式的证书,可多次调用 + * + * load 加载 mozilla 的 certdata,txt, 可于 http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt 下载使用 + * @param txtCert PEM 格式的证书 + * + * + * + */ + load(txtCert: string): void; + + /** + * + * @brief 加载一个 CRT/PEM/DER/TXT 格式的证书,可多次调用 + * + * loadFile 加载 mozilla 的 certdata,txt, 可于 http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt 下载使用 + * @param filename 证书文件名 + * + * + * + */ + loadFile(filename: string): void; + + /** + * + * @brief 加载自带的缺省根证书 + * 此证书内容源自:http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt + * + * + */ + loadRootCerts(): void; + + /** + * + * @brief 使用当前证书链验证给定的证书 + * @param cert 给定需要验证的证书 + * @return 如果验证成功则返回 True + * + * + * @async + */ + verify(cert: Class_X509Cert): boolean; + + /** + * + * @brief 导出已经加载的证书 + * @return 以数组方式导出证书链 + * + * + * + */ + dump(): any[]; + + /** + * + * @brief 清空已经加载的证书 + * + * + */ + clear(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/X509Crl.d.ts b/types/fibjs/declare/X509Crl.d.ts new file mode 100644 index 0000000000..22c0b1f99a --- /dev/null +++ b/types/fibjs/declare/X509Crl.d.ts @@ -0,0 +1,90 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief x509 撤销证书对象 + * @detail X509Crl 对象属于 crypto 模块,创建:,```JavaScript,var k = new crypto.X509Crl();,``` + */ + +declare class Class_X509Crl extends Class__object { + + + + /** + * + * @brief X509Crl 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief 加载一个 DER 格式的撤销证书,可多次调用 + * @param derCrl DER 格式的撤销证书 + * + * + * + */ + load(derCrl: Class_Buffer): void; + + /** + * + * @brief 加载一个 PEM 格式的撤销证书,可多次调用 + * @param pemCrl PEM 格式的撤销证书 + * + * + * + */ + load(pemCrl: string): void; + + /** + * + * @brief 加载一个 PEM/DER 格式的撤销证书,可多次调用 + * @param filename 撤销证书文件名 + * + * + * + */ + loadFile(filename: string): void; + + /** + * + * @brief 导出已经加载的撤销证书 + * @return 以数组方式导出撤销证书链 + * + * + * + */ + dump(): any[]; + + /** + * + * @brief 清空已经加载的撤销证书 + * + * + * + */ + clear(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/X509Req.d.ts b/types/fibjs/declare/X509Req.d.ts new file mode 100644 index 0000000000..502c078402 --- /dev/null +++ b/types/fibjs/declare/X509Req.d.ts @@ -0,0 +1,155 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + + + +/** module Or Internal Object */ +/** + * @brief x509 证书请求对象 + * @detail X509Req 对象属于 crypto 模块,创建:,```JavaScript,var k = new crypto.X509Req();,``` + */ + +declare class Class_X509Req extends Class__object { + + /** + * class prop + * + * + * @brief 获取证书的主题可分辨名称 + * + * @readonly + * @type String + */ + + subject: string + + /** + * class prop + * + * + * @brief 获取证书的公钥 + * + * @readonly + * @type PKey + */ + + publicKey: Class_PKey + + + + /** + * + * @brief X509Req 构造函数 + * + * + */ + constructor(); + + /** + * + * @brief X509Req 构造函数,根据给定的信息创建一个证书请求 + * + * @param subject 证书的主题可分辨名称 + * @param key 证书的公钥 + * @param hash 证书摘要算法,缺省为 hash.SHA1 + * + * + * + */ + constructor(subject: string, key: Class_PKey, hash?: number/** = undefined*/); + + /** + * + * @brief 加载一个 DER 格式的证书请求 + * @param derReq DER 格式的证书请求 + * + * + * + */ + load(derReq: Class_Buffer): void; + + /** + * + * @brief 加载一个 PEM 格式的证书请求 + * @param pemReq PEM 格式的证书请求 + * + * + * + */ + load(pemReq: string): void; + + /** + * + * @brief 加载一个 PEM/DER 格式的证书请求,可多次调用 + * @param filename 证书请求文件名 + * + * + * + */ + loadFile(filename: string): void; + + /** + * + * @brief 返回当前证书请求的 PEM 格式编码 + * @return 当前证书请求的 PEM 格式编码 + * + * + * + */ + exportPem(): string; + + /** + * + * @brief 返回当前证书请求的 DER 格式编码 + * @return 当前证书请求的 DER 格式编码 + * + * + * + */ + exportDer(): Class_Buffer; + + /** + * + * @brief 签名当前证书请求为正式证书 + * + * opts 接收的字段如下: + * ```JavaScript + * { + * ca: false, // 证书为 ca,缺省为 false + * pathlen: -1, // 证书深度,缺省为 -1 + * notBefore: "", // 证书生效时间,缺省为当前时间 + * notAfter: "", // 证书失效时间,缺省为 notBefore 后一年 + * usage: "", // 证书使用范围,接收:digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign + * type: "" // 证书 Netscape 证书类型,接收:client, server, email, objsign, reserved, sslCA, emailCA, objCA + * } + * ``` + * @param issuer 签名机构的可分辨名称 + * @param key 签名机构的私钥 + * @param opts 其他可选参数 + * @return 返回签名后的正式证书 + * + * + * @async + */ + sign(issuer: string, key: Class_PKey, opts?: object/** = v8::Object::New(isolate)*/): Class_X509Cert; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlAttr.d.ts b/types/fibjs/declare/XmlAttr.d.ts new file mode 100644 index 0000000000..82659f536a --- /dev/null +++ b/types/fibjs/declare/XmlAttr.d.ts @@ -0,0 +1,124 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlAttr 对象表示 XmlElement 对象的属性 + * @detail + */ + +declare class Class_XmlAttr extends Class__object { + + /** + * class prop + * + * + * @brief 查询元素的本地名称。如果选定的节点无命名空间,则该属性等同于 nodeName + * + * + * @readonly + * @type String + */ + + localName: string + + /** + * class prop + * + * + * @brief 属性的值 + * + * + * + * @type String + */ + + value: string + + /** + * class prop + * + * + * @brief 属性的名称 + * + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 查询元素的命名空间的 URI。如果选定的节点无命名空间,则该属性返回 NULL + * + * + * @readonly + * @type String + */ + + namespaceURI: string + + /** + * class prop + * + * + * @brief 查询和设置元素的命名空间前缀。如果选定的节点无命名空间,则该属性返回 NULL + * + * + * + * @type String + */ + + prefix: string + + /** + * class prop + * + * + * @brief 属性的名称,为兼容的目的 + * + * + * @readonly + * @type String + */ + + nodeName: string + + /** + * class prop + * + * + * @brief 属性的值,为兼容的目的 + * + * + * + * @type String + */ + + nodeValue: string + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlCDATASection.d.ts b/types/fibjs/declare/XmlCDATASection.d.ts new file mode 100644 index 0000000000..4640fc3758 --- /dev/null +++ b/types/fibjs/declare/XmlCDATASection.d.ts @@ -0,0 +1,33 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlCDATASection 对象表示文档中的 CDATA 区段 + * @detail XmlCDATASection 接口是 XmlText 接口的子接口,没有定义任何自己的属性和方法。通过从 XmlNode 接口继承 nodeValue 属性,或通过从 XmlCharacterData 接口继承 data 属性,可以访问 CDATA Section 的文本内容。,,虽然通常可以把 XmlCDATASection 节点作为 XmlText 节点处理,但要注意 XmlNode 的 normalize 方法不并入相邻的 CDATA 部分。,,使用 XmlDocument 的 createXmlCDATASection 方法来创建一个 XmlCDATASection 。,,CDATA 区段包含了不会被解析器解析的文本。CDATA 区段中的标签不会被视为标记,同时实体也不会被展开。主要的目的是为了包含诸如 XML 片段之类的材料,而无需转义所有的分隔符。,,在一个 CDATA 中唯一被识别的分隔符是 "]]>",它可标示 CDATA 区段的结束。CDATA 区段不能进行嵌套。 + */ +/// +declare class Class_XmlCDATASection extends Class_XmlText { + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlCharacterData.d.ts b/types/fibjs/declare/XmlCharacterData.d.ts new file mode 100644 index 0000000000..e1e3b486dd --- /dev/null +++ b/types/fibjs/declare/XmlCharacterData.d.ts @@ -0,0 +1,115 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlCharacterData 接口提供了 XmlText 和 XmlComment 节点的常用功能 + * @detail XmlCharacterData 是 XmlText 和 XmlComment 节点的超接口。文档从不包含 XmlCharacterData 节点,它们只包含 XmlText 节点和 XmlComment 节点。但由于这两种节点具有相似的功能,因此此处定义了这些函数,以便 XmlText 和 XmlComment 可以继承它。 + */ +/// +declare class Class_XmlCharacterData extends Class_XmlNode { + + /** + * class prop + * + * + * @brief 该节点包含的文本 + * + * + * + * @type String + */ + + data: string + + /** + * class prop + * + * + * @brief 该节点包含的字符数 + * + * + * @readonly + * @type Integer + */ + + length: number + + + + /** + * + * @brief 从节点中提取子串 + * @param offset 要返回的第一个字符的位置 + * @param count 要返回的子串中的字符数 + * @return 返回提取的字符串 + * + * + * + */ + substringData(offset: number, count: number): string; + + /** + * + * @brief 把字符串附加到节点上 + * @param arg 要附加到节点的字符串 + * + * + * + */ + appendData(arg: string): void; + + /** + * + * @brief 把字符串插入节点 + * @param offset 要把字符串插入节点的字符位置 + * @param arg 要插入的字符串 + * + * + * + */ + insertData(offset: number, arg: string): void; + + /** + * + * @brief 从节点删除文本 + * @param offset 要删除的第一个字符的位置 + * @param count 要删除的字符的数量 + * + * + * + */ + deleteData(offset: number, count: number): void; + + /** + * + * @brief 用指定的字符串替换节点的字符 + * @param offset 节点要替换的字符位置 + * @param count 要替换的字符的数量 + * @param arg 要插入的字符串 + * + * + * + */ + replaceData(offset: number, count: number, arg: string): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlComment.d.ts b/types/fibjs/declare/XmlComment.d.ts new file mode 100644 index 0000000000..62f02a1200 --- /dev/null +++ b/types/fibjs/declare/XmlComment.d.ts @@ -0,0 +1,33 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlComment 对象表示文档中注释节点的内容 + * @detail XmlComment 节点表示 XML 文档中的注释。,使用由 XmlCharacterData 接口继承的 data 属性,或使用由 XmlNode 接口继承的 nodeValue 属性,可以访问注释的内容。(即 之间的文本)。使用由 XmlCharacterData 接口继承的各种方法可以操作注释的内容。,,使用 XmlDocument.createComment() 来创建一个注释对象。 + */ +/// +declare class Class_XmlComment extends Class_XmlCharacterData { + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlDocument.d.ts b/types/fibjs/declare/XmlDocument.d.ts new file mode 100644 index 0000000000..a4279dd1ce --- /dev/null +++ b/types/fibjs/declare/XmlDocument.d.ts @@ -0,0 +1,290 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlDocument 对象代表整个 XML 文档 + * @detail XmlDocument 对象是一棵文档树的根,可为我们提供对文档数据的最初(或最顶层)的访问入口。,用于元素节点、文本节点、注释、处理指令等均无法存在于 XmlDocument 之外, XmlDocument 对象同样提供了创建这些对象的方法。 XmlNode 对象提供了一个 ownerDocument 属性,此属性可把它们与在其中创建它们的 XmlDocument 关联起来。 + */ +/// +declare class Class_XmlDocument extends Class_XmlNode { + + /** + * class prop + * + * + * @brief 返回用于文档的编码(在解析时) + * + * + * @readonly + * @type String + */ + + inputEncoding: string + + /** + * class prop + * + * + * @brief 设置或返回文档是否为 standalone + * + * + * + * @type Boolean + */ + + xmlStandalone: boolean + + /** + * class prop + * + * + * @brief 设置或返回文档的 XML 版本 + * + * + * + * @type String + */ + + xmlVersion: string + + /** + * class prop + * + * + * @brief 返回与文档相关的文档类型声明(Document Type Declaration) + * + * 对于没有 DTD 的 XML 文档,则返回 null。此属性可提供对 XmlDocumentType 对象( XmlDocument 的一个子节点)的直接访问。 + * + * + * @readonly + * @type XmlDocumentType + */ + + doctype: Class_XmlDocumentType + + /** + * class prop + * + * + * @brief 返回文档的根节点 + * + * + * @readonly + * @type XmlElement + */ + + documentElement: Class_XmlElement + + /** + * class prop + * + * + * @brief 返回 HTML 文档的 head 节点,仅在 html 模式有效 + * + * + * @readonly + * @type XmlElement + */ + + head: Class_XmlElement + + /** + * class prop + * + * + * @brief 返回 HTML 文档的 title 节点的内容,仅在 html 模式有效 + * + * + * @readonly + * @type String + */ + + title: string + + /** + * class prop + * + * + * @brief 返回 HTML 文档的 body 节点,仅在 html 模式有效 + * + * + * @readonly + * @type XmlElement + */ + + body: Class_XmlElement + + + + /** + * + * @brief 构造一个 XmlDocument 对象 + * @param type 指定文档对象的类型,缺省为 "text/xml",若需要处理 html 则需要指定 "text/html" + * + * + * + */ + constructor(type?: string/** = "text/xml"*/); + + /** + * + * @brief 通过解析一个 XML/HTML 字符串来组成该文档,不支持多语种 + * @param source 要解析的 XML/HTML 文本,取决于文档创建时的类型 + * + * + * + */ + load(source: string): void; + + /** + * + * @brief 通过解析一个二进制 XML/HTML 字符串来组成该文档,并根据语种自动转换 + * @param source 要解析的 XML/HTML 文本,取决于文档创建时的类型 + * + * + * + */ + load(source: Class_Buffer): void; + + /** + * + * @brief 返回带有指定名称的所有元素的一个节点列表 + * + * 该方法将返回一个 XmlNodeList 对象(可以作为只读数组处理),该对象存放文档中具有指定标签名的所有 XmlElement 节点,它们存放的顺序就是在源文档中出现的顺序。 XmlNodeList 对象是“活”的,即如果在文档中添加或删除了指定标签名的元素,它的内容会自动进行必要的更新。 + * @param tagName 需检索的标签名。值 "*" 匹配所有的标签 + * @return 文档树中具有指定标记的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByTagName(tagName: string): Class_XmlNodeList; + + /** + * + * @brief 返回带有指定命名空间和名称的所有元素的一个节点列表 + * + * 该方法与 getElementsByTagName() 方法相似,只是它根据命名空间和名称来检索元素。 + * @param namespaceURI 指定检索的命名空间 URI。值 "*" 可匹配所有的标签 + * @param localName 需检索的标签名。值 "*" 匹配所有的标签 + * @return 文档树中具有指定标记的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByTagNameNS(namespaceURI: string, localName: string): Class_XmlNodeList; + + /** + * + * @brief 返回拥有指定 id 属性的元素 + * + * 该方法将遍历文档的子孙节点,返回一个 XmlElement 节点对象,表示第一个具有指定 id 属性的文档元素。。 + * @param id 需检索的 id + * @return 节点树中具有指定 id 属性的 XmlElement 节点 + * + * + * + */ + getElementById(id: string): Class_XmlElement; + + /** + * + * @brief 返回带有指定 class 名称的所有元素的一个节点列表 + * + * 该方法将返回一个 XmlNodeList 对象(可以作为只读数组处理),该对象存放文档中具有指定 class 名的所有 XmlElement 节点,它们存放的顺序就是在源文档中出现的顺序。 XmlNodeList 对象是“活”的,即如果在文档中添加或删除了指定标签名的元素,它的内容会自动进行必要的更新。 + * @param className 需检索的 class 名称 + * @return 文档树中具有指定 class 名的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByClassName(className: string): Class_XmlNodeList; + + /** + * + * @brief 创建元素节点 + * @param tagName 指定元素节点规定名称 + * @return 返回新创建的 XmlElement 节点,具有指定的标签名 + * + * + * + */ + createElement(tagName: string): Class_XmlElement; + + /** + * + * @brief 创建带有指定命名空间的元素节点 + * @param namespaceURI 指定元素节点命名空间 URI + * @param qualifiedName 指定元素节点规定名称 + * @return 返回新创建的 XmlElement 节点,具有指定的标签名 + * + * + * + */ + createElementNS(namespaceURI: string, qualifiedName: string): Class_XmlElement; + + /** + * + * @brief 创建文本节点 + * @param data 指定此节点的文本 + * @return 返回新创建的 XmlText 节点,表示指定的 data 字符串 + * + * + * + */ + createTextNode(data: string): Class_XmlText; + + /** + * + * @brief 创建注释节点 + * @param data 指定此节点的注释文本 + * @return 返回新创建的 XmlComment 节点,注释文本为指定的 data + * + * + * + */ + createComment(data: string): Class_XmlComment; + + /** + * + * @brief 创建 XmlCDATASection 节点 + * @param data 指定此节点规定 CDATA 数据 + * @return 返回新创建的 XmlCDATASection 节点,内容为指定的 data + * + * + * + */ + createCDATASection(data: string): Class_XmlCDATASection; + + /** + * + * @brief 创建 XmlProcessingInstruction 节点 + * @param target 指定处理指令的目标 + * @param data 指定处理指令的内容文本 + * @return 新创建的 ProcessingInstruction 节点 + * + * + * + */ + createProcessingInstruction(target: string, data: string): Class_XmlProcessingInstruction; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlDocumentType.d.ts b/types/fibjs/declare/XmlDocumentType.d.ts new file mode 100644 index 0000000000..f61b5fbfed --- /dev/null +++ b/types/fibjs/declare/XmlDocumentType.d.ts @@ -0,0 +1,72 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlDocumentType 对象用于访问 XML 所定义的实体 + * @detail + */ +/// +declare class Class_XmlDocumentType extends Class_XmlNode { + + /** + * class prop + * + * + * @brief 返回 DTD 的名称 + * + * + * @readonly + * @type String + */ + + name: string + + /** + * class prop + * + * + * @brief 可返回外部 DTD 的公共识别符 + * + * + * @readonly + * @type String + */ + + publicId: string + + /** + * class prop + * + * + * @brief 可返回外部 DTD 的系统识别符 + * + * + * @readonly + * @type String + */ + + systemId: string + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlElement.d.ts b/types/fibjs/declare/XmlElement.d.ts new file mode 100644 index 0000000000..a879cee139 --- /dev/null +++ b/types/fibjs/declare/XmlElement.d.ts @@ -0,0 +1,301 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlElement 对象表示 XML 文档中的元素 + * @detail + */ +/// +declare class Class_XmlElement extends Class_XmlNode { + + /** + * class prop + * + * + * @brief 查询元素的命名空间的 URI。如果选定的节点无命名空间,则该属性返回 NULL + * + * + * @readonly + * @type String + */ + + namespaceURI: string + + /** + * class prop + * + * + * @brief 查询和设置元素的命名空间前缀。如果选定的节点无命名空间,则该属性返回 NULL + * + * + * + * @type String + */ + + prefix: string + + /** + * class prop + * + * + * @brief 查询元素的本地名称。如果选定的节点无命名空间,则该属性等同于 nodeName + * + * + * @readonly + * @type String + */ + + localName: string + + /** + * class prop + * + * + * @brief 返回元素的标签名 + * + * + * @readonly + * @type String + */ + + tagName: string + + /** + * class prop + * + * + * ! 查询和设置元素的 id 属性 + * + * + * + * @type String + */ + + id: string + + /** + * class prop + * + * + * ! 查询和设置选定元素的文本。查询时,返回元素节点内所有文本节点的值;设置时,删除所有子节点,并用单个文本节点来替换它们。 + * + * + * + * @type String + */ + + textContent: string + + /** + * class prop + * + * + * ! 查询和设置选定元素的 HTML 文本,仅在 html 模式有效。查询时,返回元素节点内所有子节点的 HTML 编码;设置时,删除所有子节点,并用指定的 HTML 解码后替换它们。 + * + * + * + * @type String + */ + + innerHTML: string + + /** + * class prop + * + * + * ! 查询和设置元素的 class 属性,仅在 html 模式有效 + * + * + * + * @type String + */ + + className: string + + /** + * class prop + * + * + * @brief 返回包含被选节点属性的 NamedNodeMap。如果被选节点不是元素,则该属性返回 NULL。 + * + * + * @readonly + * @type XmlNamedNodeMap + */ + + attributes: Class_XmlNamedNodeMap + + + + /** + * + * @brief 通过名称查询属性的值 + * @param name 指定查询的属性名 + * @return 返回属性的值 + * + * + * + */ + getAttribute(name: string): string; + + /** + * + * @brief 通过命名空间 URI 和名称来获取属性值 + * @param namespaceURI 指定查询的命名空间 URI + * @param localName 指定查询的属性名 + * @return 返回属性的值 + * + * + * + */ + getAttributeNS(namespaceURI: string, localName: string): string; + + /** + * + * @brief 创建或改变某个新属性 + * + * 该方法把指定的属性设置为指定的值。如果不存在具有指定名称的属性,该方法将创建一个新属性 + * @param name 指定要设置的属性名 + * @param value 指定要设置的属性值 + * + * + * + */ + setAttribute(name: string, value: string): void; + + /** + * + * @brief 创建或改变具有命名空间的属性 + * + * 该方法与 setAttribute 方法类似,只是要创建或设置的属性由命名空间 URI 和限定名(由名字空间前缀、冒号和名字空间中的本地名构成)共同指定。除了可以改变一个属性的值以外,使用该方法还可以改变属性的名字空间前缀 + * @param namespaceURI 指定要设置的命名空间 URI + * @param qualifiedName 指定要设置的属性名 + * @param value 指定要设置的属性值 + * + * + * + */ + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + + /** + * + * @brief 通过名称删除指定的属性 + * @param name 指定删除的属性名 + * + * + * + */ + removeAttribute(name: string): void; + + /** + * + * @brief 通过命名空间和名称删除指定的属性 + * @param namespaceURI 指定要删除的命名空间 URI + * @param localName 指定删除的属性名 + * + * + * + */ + removeAttributeNS(namespaceURI: string, localName: string): void; + + /** + * + * @brief 查询当前节点是否拥有指定名称的属性 + * @param name 指定查询的属性名称 + * @return 如果当前元素节点拥有指定属性,则返回 true,否则返回 false + * + * + * + */ + hasAttribute(name: string): boolean; + + /** + * + * @brief 查询当前节点是否拥有指定命名空间和名称的属性 + * @param namespaceURI 指定要查询的命名空间 URI + * @param localName 指定查询的属性名称 + * @return 如果当前元素节点拥有指定属性,则返回 true,否则返回 false + * + * + * + */ + hasAttributeNS(namespaceURI: string, localName: string): boolean; + + /** + * + * @brief 返回拥有指定名称的所有元素的 XmlNodeList + * + * 该方法将遍历指定元素的子孙节点,返回一个 XmlElement 节点的 XmlNodeList 对象,表示所有具有指定标签名的文档元素。元素在返回的数组中的顺序就是它们出现在文档源代码中的顺序。 + * + * XmlDocument 接口也定义了 getElementsByTagName 方法,它与该方法相似,但遍历整个文档,而不是遍历某个元素的子孙节点。 + * @param tagName 需检索的标签名。值 "*" 匹配所有的标签 + * @return 节点树中具有指定标记的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByTagName(tagName: string): Class_XmlNodeList; + + /** + * + * @brief 返回拥有指定命名空间和名称的所有元素的 XmlNodeList + * + * 该方法与 getElementsByTagName 方法相似,只是想获取的元素的标记名被指定为命名空间 URI 和在命名空间中定义的本地名的组合。 + * @param namespaceURI 指定要查询的命名空间 URI + * @param localName 需检索的标签名。值 "*" 匹配所有的标签 + * @return 节点树中具有指定标记的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByTagNameNS(namespaceURI: string, localName: string): Class_XmlNodeList; + + /** + * + * @brief 返回拥有指定 id 属性的元素 + * + * 该方法将遍历指定元素的子孙节点,返回一个 XmlElement 节点对象,表示第一个具有指定 id 属性的文档元素。。 + * + * XmlDocument 接口也定义了 getElementsByTagName 方法,它与该方法相似,但遍历整个文档,而不是遍历某个元素的子孙节点。 + * @param id 需检索的 id + * @return 节点树中具有指定 id 属性的 XmlElement 节点 + * + * + * + */ + getElementById(id: string): Class_XmlElement; + + /** + * + * @brief 返回带有指定 class 名称的所有元素的一个节点列表 + * + * 该方法将返回一个 XmlNodeList 对象(可以作为只读数组处理),该对象存放文档中具有指定 class 名的所有 XmlElement 节点,它们存放的顺序就是在源文档中出现的顺序。 XmlNodeList 对象是“活”的,即如果在文档中添加或删除了指定标签名的元素,它的内容会自动进行必要的更新。 + * @param className 需检索的 class 名称 + * @return 文档树中具有指定 class 名的 XmlElement 节点的 XmlNodeList 集合。返回的元素节点的顺序就是它们在源文档中出现的顺序。 + * + * + * + */ + getElementsByClassName(className: string): Class_XmlNodeList; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlNamedNodeMap.d.ts b/types/fibjs/declare/XmlNamedNodeMap.d.ts new file mode 100644 index 0000000000..52920576cf --- /dev/null +++ b/types/fibjs/declare/XmlNamedNodeMap.d.ts @@ -0,0 +1,68 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlNamedNodeMap 对象表示一个无顺序的属性列表 + * @detail + */ + +declare class Class_XmlNamedNodeMap extends Class__object { + + /** + * class prop + * + * + * @brief 返回属性列表中的属性数目 + * + * + * @readonly + * @type Integer + */ + + length: number + + + + /** + * + * @brief 返回属性列表中处于指定的索引号的属性 + * @param index 指定要查询的索引 + * @return 指定索引号的属性 + * + * + * + */ + item(index: number): Class_XmlAttr; + + /** + * + * @brief 查询指定名称的属性 + * @param name 指定要查询的名称 + * @return 返回查询出的属性 + * + * + * + */ + getNamedItem(name: string): Class_XmlAttr; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlNode.d.ts b/types/fibjs/declare/XmlNode.d.ts new file mode 100644 index 0000000000..def8e0f59c --- /dev/null +++ b/types/fibjs/declare/XmlNode.d.ts @@ -0,0 +1,315 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlNode 对象是整个 DOM 的基础数据类型 + * @detail + */ + +declare class Class_XmlNode extends Class__object { + + /** + * class prop + * + * + * @brief 返回节点的节点类型 + * + * 不同对象的 nodeType 会返回不同的值: + * - XmlElement: ELEMENT_NODE(1) + * - XmlAttr: ATTRIBUTE_NODE(2) + * - XmlText: TEXT_NODE(3) + * - XmlCDATASection: CDATA_SECTION_NODE(4) + * - XmlProcessingInstruction: PROCESSING_INSTRUCTION_NODE(7) + * - XmlComment: COMMENT_NODE(8) + * - XmlDocument: DOCUMENT_NODE(9) + * - XmlDocumentType: DOCUMENT_TYPE_NODE(10) + * + * + * @readonly + * @type Integer + */ + + nodeType: number + + /** + * class prop + * + * + * @brief 返回节点的名称,根据其类型 + * + * 不同对象的 nodeName 会返回不同的值: + * - XmlElement: element name + * - XmlAttr: 属性名称 + * - XmlText: \#text + * - XmlCDATASection: \#cdata-section + * - XmlProcessingInstruction: 返回指定目标 target + * - XmlComment: \#comment + * - XmlDocument: \#document + * - XmlDocumentType: doctype 名称 + * + * + * @readonly + * @type String + */ + + nodeName: string + + /** + * class prop + * + * + * @brief 返回节点的名称,根据其类型 + * + * 不同对象的 nodeName 会返回不同的值: + * - XmlElement: null + * - XmlAttr: 属性的值 + * - XmlText: 节点的内容 + * - XmlCDATASection: 节点的内容 + * - XmlProcessingInstruction: 返回指定内容 data + * - XmlComment: 注释文本 + * - XmlDocument: null + * - XmlDocumentType: null + * + * + * + * @type String + */ + + nodeValue: string + + /** + * class prop + * + * + * @brief 返回节点的根元素(XmlDocument 对象) + * + * + * @readonly + * @type XmlDocument + */ + + ownerDocument: Class_XmlDocument + + /** + * class prop + * + * + * @brief 可返回某节点的父节点 + * + * + * @readonly + * @type XmlNode + */ + + parentNode: Class_XmlNode + + /** + * class prop + * + * + * @brief 返回指定节点的子节点的节点列表 + * + * + * @readonly + * @type XmlNodeList + */ + + childNodes: Class_XmlNodeList + + /** + * class prop + * + * + * @brief 返回节点的首个子节点 + * + * + * @readonly + * @type XmlNode + */ + + firstChild: Class_XmlNode + + /** + * class prop + * + * + * @brief 返回节点的最后一个子节点 + * + * + * @readonly + * @type XmlNode + */ + + lastChild: Class_XmlNode + + /** + * class prop + * + * + * @brief 返回某节点之前紧跟的节点(处于同一树层级),如果没有此节点,那么该属性返回 null + * + * + * @readonly + * @type XmlNode + */ + + previousSibling: Class_XmlNode + + /** + * class prop + * + * + * @brief 返回某个元素之后紧跟的节点(处于同一树层级中),如果无此节点,则属性返回 null + * + * + * @readonly + * @type XmlNode + */ + + nextSibling: Class_XmlNode + + + + /** + * + * @brief 查询是否存在子节点 + * @return 存在任何子节点时返回 true,否则返回 false + * + * + * + */ + hasChildNodes(): boolean; + + /** + * + * @brief 合并相邻的 Text 节点并删除空的 Text 节点 + * + * 这个方法将遍历当前节点的所有子孙节点,通过删除空的 Text 节点,已经合并所有相邻的 Text 节点来规范化文档。该方法在进行节点的插入或删除操作后,对于简化文档树的结构很有用。 + * + * + * + */ + normalize(): void; + + /** + * + * @brief 创建指定的节点的精确拷贝 + * + * 该方法将复制并返回调用它的节点的副本。如果传递给它的参数是 true,它还将递归复制当前节点的所有子孙节点。 否则,它只复制当前节点。返回的节点不属于文档树,它的 parentNode 属性为 null。当复制的是 Element 节点时,它的所有属性都将被复制。 + * @param deep 是否深度拷贝,为 true 时,被克隆的节点会克隆原节点的所有子节点 + * @return 返回所复制的节点 + * + * + * + */ + cloneNode(deep?: boolean/** = true*/): Class_XmlNode; + + /** + * + * @brief 返回在当前节点上匹配指定的命名空间 URI 的前缀 + * @param namespaceURI 指定匹配的命名空间 URI + * @return 返回匹配的前缀,未匹配到返回 null + * + * + * + */ + lookupPrefix(namespaceURI: string): string; + + /** + * + * @brief 返回在当前节点上匹配指定的前缀的命名空间 URI + * @param prefix 指定匹配的前缀 + * @return 返回匹配的命名空间 URI,未匹配到返回 null + * + * + * + */ + lookupNamespaceURI(prefix: string): string; + + /** + * + * @brief 在已有的子节点前插入一个新的子节点 + * + * 如果文档树中已经存在了 newChild,它将从文档树中删除,然后重新插入它的新位置。来自一个文档的节点(或由一个文档创建的节点)不能插入另一个文档。也就是说,newChild 的 ownerDocument 属性必须与当前节点的 ownerDocument 属性相同。 + * @param newChild 插入新的节点 + * @param refChild 在此节点前插入新节点 + * @return 返回新的子节点 + * + * + * + */ + insertBefore(newChild: Class_XmlNode, refChild: Class_XmlNode): Class_XmlNode; + + /** + * + * @brief 在已有的子节点后插入一个新的子节点 + * + * 如果文档树中已经存在了 newChild,它将从文档树中删除,然后重新插入它的新位置。来自一个文档的节点(或由一个文档创建的节点)不能插入另一个文档。也就是说,newChild 的 ownerDocument 属性必须与当前节点的 ownerDocument 属性相同。 + * @param newChild 插入新的节点 + * @param refChild 在此节点后插入新节点 + * @return 返回新的子节点 + * + * + * + */ + insertAfter(newChild: Class_XmlNode, refChild: Class_XmlNode): Class_XmlNode; + + /** + * + * @brief 向节点的子节点列表的末尾添加新的子节点 + * + * 如果文档树中已经存在了 newChild,它将从文档树中删除,然后重新插入它的新位置。来自一个文档的节点(或由一个文档创建的节点)不能插入另一个文档。也就是说,newChild 的 ownerDocument 属性必须与当前节点的 ownerDocument 属性相同。 + * @param newChild 指定添加的节点 + * @return 返回这个新的子节点 + * + * + * + */ + appendChild(newChild: Class_XmlNode): Class_XmlNode; + + /** + * + * @brief 将某个子节点替换为另一个 + * + * 如果文档树中已经存在了 newChild,它将从文档树中删除,然后重新插入它的新位置。来自一个文档的节点(或由一个文档创建的节点)不能插入另一个文档。也就是说,newChild 的 ownerDocument 属性必须与当前节点的 ownerDocument 属性相同。 + * @param newChild 指定新的节点 + * @param oldChild 指定被替换的节点 + * @return 如替换成功,此方法可返回被替换的节点,如替换失败,则返回 null + * + * + * + */ + replaceChild(newChild: Class_XmlNode, oldChild: Class_XmlNode): Class_XmlNode; + + /** + * + * @brief 从子节点列表中删除某个节点 + * @param oldChild 指定被删除的节点 + * @return 如删除成功,此方法可返回被删除的节点,如失败,则返回 null + * + * + * + */ + removeChild(oldChild: Class_XmlNode): Class_XmlNode; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlNodeList.d.ts b/types/fibjs/declare/XmlNodeList.d.ts new file mode 100644 index 0000000000..40934cfdc5 --- /dev/null +++ b/types/fibjs/declare/XmlNodeList.d.ts @@ -0,0 +1,57 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlNodeList 对象代表一个有顺序的节点列表 + * @detail + */ + +declare class Class_XmlNodeList extends Class__object { + + /** + * class prop + * + * + * @brief 返回节点列表中的节点数目 + * + * + * @readonly + * @type Integer + */ + + length: number + + + + /** + * + * @brief 返回节点列表中处于指定的索引号的节点 + * @param index 指定要查询的索引 + * @return 指定索引号的节点 + * + * + * + */ + item(index: number): Class_XmlNode; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlProcessingInstruction.d.ts b/types/fibjs/declare/XmlProcessingInstruction.d.ts new file mode 100644 index 0000000000..a00cbab76a --- /dev/null +++ b/types/fibjs/declare/XmlProcessingInstruction.d.ts @@ -0,0 +1,59 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlProcessingInstruction 对象表示 xml 处理指令 + * @detail + */ +/// +declare class Class_XmlProcessingInstruction extends Class_XmlNode { + + /** + * class prop + * + * + * @brief 返回此处理指令的目标 + * + * + * @readonly + * @type String + */ + + target: string + + /** + * class prop + * + * + * @brief 设置或返回此处理指令的内容 + * + * + * + * @type String + */ + + data: string + + + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/XmlText.d.ts b/types/fibjs/declare/XmlText.d.ts new file mode 100644 index 0000000000..4236641c07 --- /dev/null +++ b/types/fibjs/declare/XmlText.d.ts @@ -0,0 +1,48 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief XmlText 对象表示元素或属性的文本内容 + * @detail XmlText 节点表示 XML 文档中的一系列纯文本。因为纯文本出现在 XML 的元素和属性中,所以 XmlText 节点通常作为 XmlElement 节点和 XmlAttr 节点的子节点出现。,,XmlText 节点继承了 XmlCharacterData 接口,通过从 XmlCharacterData 接口继承的 data 属性或从 XmlNode 接口继承的 nadevalue 属性,可以访问 XmlText 节点的文本内容。,,用从 XmlCharacterData 继承的方法或 XmlText 接口自身定义的 splitText() 方法可以操作 XmlText 节点。使用 XmlDocument 的 createTextNode 来创建一个新的 XmlText 节点。,,XmlText 节点没有子节点。,,关于从文档的子树中删除空 XmlText 节点与合并相邻的 XmlText 节点的方法,请参阅 XmlNode.normalize 方法。 + */ +/// +declare class Class_XmlText extends Class_XmlCharacterData { + + + + /** + * + * @brief 按照指定的 offset 把文本节点分割为两个节点 + * + * 该方法将在指定的 offset 处把 XmlText 节点分割成两个节点。原始的 XmlText 节点将被修改,使它包含 offset 指定的位置之前的文本内容(但不包括文本内容)。新的 XmlText 节点将被创建,用于存放从 offset 位置(包括该位置上的字符)到原字符结尾的所有字符。新的 XmlText 节点是该方法的返回值。此外,如果原始的 XmlText 节点具有 parentNode,新的 XmlText 节点将插入这个父节点,紧邻在原始节点之后。 + * + * XmlCDATASection 接口继承了 XmlText 接口, XmlCDATASection 节点也可以使用该方法 ,只是新创建的节点是 XmlCDATASection 节点,而不是 XmlText 节点。 + * @param offset 规定在何处分割文本节点。开始值以 0 开始 + * @return 从当前节点分割出的 Text 节点 + * + * + * + */ + splitText(offset: number): Class_XmlText; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/ZipFile.d.ts b/types/fibjs/declare/ZipFile.d.ts new file mode 100644 index 0000000000..842d518382 --- /dev/null +++ b/types/fibjs/declare/ZipFile.d.ts @@ -0,0 +1,168 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + +/** module Or Internal Object */ +/** + * @brief zip 文件访问对象 + * @detail + */ + +declare class Class_ZipFile extends Class__object { + + + + /** + * + * @brief 获取文件名列表 + * @return 返回包含文件名的列表对象 + * + * + * @async + */ + namelist(): any[]; + + /** + * + * @brief 获取文件信息列表 + * 文件信息包含字段有:filename, date, compress_type, compress_size, file_size, password, data + * @return 返回包含文件信息的列表对象 + * + * + * @async + */ + infolist(): any[]; + + /** + * + * @brief 获取文件信息 + * 文件信息包含字段有:filename, date, compress_type, compress_size, file_size, password, data + * @param member 指定要获取信息的文件名 + * @return 返回文件信息对象 + * + * + * @async + */ + getinfo(member: string): any; + + /** + * + * @brief 返回从压缩文件读取的数据 + * @param member 指定要读取的文件名 + * @param password 解压密码, 默认没有密码 + * @return 返回文件的所有数据 + * + * + * @async + */ + read(member: string, password?: string/** = ""*/): Class_Buffer; + + /** + * + * @brief 解压所有文件 + * @param password 解压密码, 默认没有密码 + * @return 包含所有文件数据及信息的列表 + * + * + * @async + */ + readAll(password?: string/** = ""*/): any[]; + + /** + * + * @brief 解压指定文件 + * @param member 指定要解压的文件名 + * @param path 指定要解压到的路径 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + extract(member: string, path: string, password?: string/** = ""*/): void; + + /** + * + * @brief 解压指定文件到流 + * @param member 指定要解压的文件名 + * @param strm 指定要解压到的流 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + extract(member: string, strm: Class_SeekableStream, password?: string/** = ""*/): void; + + /** + * + * @brief 解压所有文件到指定路径 + * @param path 指定要解压到的路径 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + extractAll(path: string, password?: string/** = ""*/): void; + + /** + * + * @brief 写入指定文件到压缩文件 + * @param filename 指定要写入的文件 + * @param inZipName 压缩在zip文件内的文件名 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + write(filename: string, inZipName: string, password?: string/** = ""*/): void; + + /** + * + * @brief 写入指定文件到压缩文件 + * @param data 指定要写入的文件数据 + * @param inZipName 压缩在zip文件内的文件名 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + write(data: Class_Buffer, inZipName: string, password?: string/** = ""*/): void; + + /** + * + * @brief 写入指定文件到压缩文件 + * @param strm 指定要写入文件数据流 + * @param inZipName 压缩在zip文件内的文件名 + * @param password 解压密码, 默认没有密码 + * + * + * @async + */ + write(strm: Class_SeekableStream, inZipName: string, password?: string/** = ""*/): void; + + /** + * + * @brief 关闭打开的zip文件 + * + * @async + */ + close(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/ZmqSocket.d.ts b/types/fibjs/declare/ZmqSocket.d.ts new file mode 100644 index 0000000000..0d2e0707fc --- /dev/null +++ b/types/fibjs/declare/ZmqSocket.d.ts @@ -0,0 +1,105 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ +/// + + + + + + +/** module Or Internal Object */ +/** + * @brief ZeroMQ 套接口对象 + * @detail + */ + +declare class Class_ZmqSocket extends Class__object { + + /** + * class prop + * + * + * @brief 查询当前 socket 类型 + * + * @readonly + * @type Integer + */ + + type: number + + + + /** + * + * @brief ZmqSocket 对象构造函数 + * @param type 指定 socket 类型,缺省为 zmq.PAIR + * + * + * + */ + constructor(type?: number/** = undefined*/); + + /** + * + * @brief 绑定指定地址和端口 + * @param addr 指定绑定的地址,如:"tcp://*:3000" + * + * + * + */ + bind(addr: string): void; + + /** + * + * @brief 连接到指定地址的服务器 + * @param addr 指定连接的地址,如:"tcp://*:3000" + * + * + * + */ + connect(addr: string): void; + + /** + * + * @brief 接收一个数据包 + * @return 返回接收到的数据包 + * + * + * @async + */ + recv(): Class_Buffer; + + /** + * + * @brief 发送一个数据包 + * @param data 指定发送的数据包 + * + * + * + */ + send(data: Class_Buffer): void; + + /** + * + * @brief 关闭当前 socket + * + * + */ + close(): void; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/_test_env.d.ts b/types/fibjs/declare/_test_env.d.ts new file mode 100644 index 0000000000..83ae06b28d --- /dev/null +++ b/types/fibjs/declare/_test_env.d.ts @@ -0,0 +1,41 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + +/// +import test from 'test' + +/// +import _assert from 'assert' + +declare global { + const describe: typeof test.describe + const xdescribe: typeof test.xdescribe + const odescribe: typeof test.odescribe + const it: typeof test.it + const xit: typeof test.xit + const oit: typeof test.oit + const before: typeof test.before + const after: typeof test.after + const beforeEach: typeof test.beforeEach + const afterEach: typeof test.afterEach + const run: typeof test.run + const setup: typeof test.setup + + const assert: typeof _assert +} +/** declare const describe: test.describe; */ + + diff --git a/types/fibjs/declare/assert.d.ts b/types/fibjs/declare/assert.d.ts new file mode 100644 index 0000000000..2b42185436 --- /dev/null +++ b/types/fibjs/declare/assert.d.ts @@ -0,0 +1,794 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 断言测试模块,如果测试值为假,则报错,报错行为可设定继续运行或者错误抛出 + * @detail 引用方法:,```JavaScript,var assert = require('assert');,```,或者通过 test 模块引用:,```JavaScript,var test = require('test');,var assert = test.assert;,```,或者通过 test.setup 配置:,```JavaScript,require("test").setup();,``` + */ +declare module "assert" { + + + module assert { + + + + + + /** + * + * @brief 测试数值为真,为假则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function Function(actual?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为真,为假则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function ok(actual?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为假,为真则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notOk(actual?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值等于预期值,不相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function equal(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不等于预期值,相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notEqual(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值严格等于预期值,不相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function strictEqual(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不严格等于预期值,相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notStrictEqual(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值深度等于预期值,不相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function deepEqual(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不深度等于预期值,相等则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notDeepEqual(actual?: any/** = v8::Undefined(isolate)*/, expected?: any/** = v8::Undefined(isolate)*/, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值近似等于预期值,否则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param delta 近似的小数精度 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function closeTo(actual: any, expected: any, delta: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不近似等于预期值,否则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param delta 近似的小数精度 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notCloseTo(actual: any, expected: any, delta: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值小于预期值,大于或等于则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function lessThan(actual: any, expected: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不小于预期值,小于则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notLessThan(actual: any, expected: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值大于预期值,小于或等于则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function greaterThan(actual: any, expected: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不大于预期值,大于则断言失败 + * @param actual 要测试的数值 + * @param expected 预期的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notGreaterThan(actual: any, expected: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试变量存在,为假则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function exist(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试变量不存在,为真则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notExist(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为布尔值真,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isTrue(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为布尔值真,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotTrue(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为布尔值假,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isFalse(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为布尔值假,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotFalse(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为 Null,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNull(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为 Null,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotNull(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为 undefined,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isUndefined(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为 undefined,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isDefined(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为函数,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isFunction(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为函数,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotFunction(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为对象,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isObject(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为对象,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotObject(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为数组,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isArray(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为数组,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotArray(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为字符串,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isString(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为字符串,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotString(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为数字,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNumber(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为数字,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotNumber(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为布尔,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isBoolean(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为布尔,否则断言失败 + * @param actual 要测试的数值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function isNotBoolean(actual: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值为给定类型,否则断言失败 + * @param actual 要测试的数值 + * @param type 指定的类型 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function typeOf(actual: any, type: string, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试数值不为给定类型,否则断言失败 + * @param actual 要测试的数值 + * @param type 指定的类型 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notTypeOf(actual: any, type: string, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试对象中包含指定属性,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function property(object: any, prop: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试对象中不包含指定属性,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notProperty(object: any, prop: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 深度测试对象中包含指定属性,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性,以“.”分割 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function deepProperty(object: any, prop: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 深度测试对象中不包含指定属性,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性,以“.”分割 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function notDeepProperty(object: any, prop: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试对象中指定属性的值为给定值,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性 + * @param value 给定的值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function propertyVal(object: any, prop: any, value: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试对象中指定属性的值不为给定值,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性 + * @param value 给定的值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function propertyNotVal(object: any, prop: any, value: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 深度测试对象中指定属性的值为给定值,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性,以“.”分割 + * @param value 给定的值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function deepPropertyVal(object: any, prop: any, value: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 深度测试对象中指定属性的值不为给定值,否则断言失败 + * @param object 要测试的对象 + * @param prop 要测试的属性,以“.”分割 + * @param value 给定的值 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function deepPropertyNotVal(object: any, prop: any, value: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试给定的代码会抛出错误,未抛出则断言失败 + * @param block 指定测试的代码,以函数形式给出 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function throws(block: Function, msg?: string/** = ""*/): void; + + /** + * + * @brief 测试给定的代码不会抛出错误,抛出则断言失败 + * @param block 指定测试的代码,以函数形式给出 + * @param msg 断言失败时的提示信息 + * + * + * + */ + export function doesNotThrow(block: Function, msg?: string/** = ""*/): void; + + /** + * + * @brief 如果参数为真,则抛出 + * @param object 参数 + * + * + * + */ + export function ifError(object?: any/** = v8::Undefined(isolate)*/): void; + + } /** end of `module assert` */ + export = assert +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/base32.d.ts b/types/fibjs/declare/base32.d.ts new file mode 100644 index 0000000000..516662ba9f --- /dev/null +++ b/types/fibjs/declare/base32.d.ts @@ -0,0 +1,239 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief base32 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var base32 = encoding.base32;,```,或者,```JavaScript,var base32 = require('base32');,``` + */ +declare module "base32" { + + + module base32 { + + + + + + /** + * + * @brief 以 base32 方式编码数据 + * @param data 要编码的数据 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: Class_Buffer): string; + + /** + * + * @brief 以 base32 方式解码字符串为二进制数据 + * @param data 要解码的字符串 + * @return 返回解码的二进制数据 + * + * + * + */ + export function decode(data: string): Class_Buffer; + + } /** end of `module base32` */ + export = base32 +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/base64.d.ts b/types/fibjs/declare/base64.d.ts new file mode 100644 index 0000000000..c2316cb06d --- /dev/null +++ b/types/fibjs/declare/base64.d.ts @@ -0,0 +1,240 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief base64 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var base64 = encoding.base64;,```,或者,```JavaScript,var base64 = require('base64');,``` + */ +declare module "base64" { + + + module base64 { + + + + + + /** + * + * @brief 以 base64 方式编码数据 + * @param data 要编码的数据 + * @param url 指定是否使用 url 安全字符编码 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: Class_Buffer, url?: boolean/** = false*/): string; + + /** + * + * @brief 以 base64 方式解码字符串为二进制数据 + * @param data 要解码的字符串 + * @return 返回解码的二进制数据 + * + * + * + */ + export function decode(data: string): Class_Buffer; + + } /** end of `module base64` */ + export = base64 +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/base64vlq.d.ts b/types/fibjs/declare/base64vlq.d.ts new file mode 100644 index 0000000000..7deb1bf810 --- /dev/null +++ b/types/fibjs/declare/base64vlq.d.ts @@ -0,0 +1,250 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief base64vlq 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var base64vlq = encoding.base64vlq;,```,或者,```JavaScript,var base64vlq = require('base64vlq');,``` + */ +declare module "base64vlq" { + + + module base64vlq { + + + + + + /** + * + * @brief 以 base64vlq 方式编码数据 + * @param data 要编码的数据 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: number): string; + + /** + * + * @brief 以 base64vlq 方式编码数据 + * @param data 要编码的数据 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: any[]): string; + + /** + * + * @brief 以 base64vlq 方式解码字符串为二进制数据 + * @param data 要解码的字符串 + * @return 返回解码的二进制数据 + * + * + * + */ + export function decode(data: string): any[]; + + } /** end of `module base64vlq` */ + export = base64vlq +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/bson.d.ts b/types/fibjs/declare/bson.d.ts new file mode 100644 index 0000000000..f9eeab19cb --- /dev/null +++ b/types/fibjs/declare/bson.d.ts @@ -0,0 +1,239 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief bson 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var bson = encoding.bson;,```,或者,```JavaScript,var bson = require('bson');,``` + */ +declare module "bson" { + + + module bson { + + + + + + /** + * + * @brief 以 bson 格式编码变量 + * @param data 要编码的变量 + * @return 返回编码的二进制数据 + * + * + * + */ + export function encode(data: object): Class_Buffer; + + /** + * + * @brief 以 bson 方式解码字符串为一个变量 + * @param data 要解码的二进制数据 + * @return 返回解码的变量 + * + * + * + */ + export function decode(data: Class_Buffer): object; + + } /** end of `module bson` */ + export = bson +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/console.d.ts b/types/fibjs/declare/console.d.ts new file mode 100644 index 0000000000..43f8603c2e --- /dev/null +++ b/types/fibjs/declare/console.d.ts @@ -0,0 +1,917 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 控制台访问对象 + * @detail 全局对象。可用于提示信息,警告和错误记录。通过启动配置文件,可将日志定位到不同的设备,以便于跟踪。日志支持格式化输出,例如:,```JavaScript,console.log("%d + %d = %d", 100, 200, 100 + 200);,```,可以使用的格式化参数如下:,- %s - 字符串,- %d - 数字,包括整数和数字,- %j - 以 JSON 格式输出对象,- %% - 输出字符 '%' 本身 + */ +declare module "console" { + + + module console { + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const FATAL = 0; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const ALERT = 1; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const CRIT = 2; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const ERROR = 3; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const WARN = 4; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const NOTICE = 5; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const INFO = 6; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const DEBUG = 7; + + /** + * + * @brief loglevel 仅用于输出,信息输出后不换行,file 和 syslog 不保存此级别信息 + * + * + */ + export const PRINT = 9; + + /** + * + * @brief loglevel 级别常量 + * + * + */ + export const NOTSET = 10; + + + /** + * + * @brief 输出级别,用以过滤输出信息,缺省为 NOTSET,全部输出。信息过滤之后才会输出给 add 设定的各个设备。 + * + * + * + */ + export const loglevel: number; + + /** + * + * @brief 查询终端每行字符数 + * + * + */ + export const width: number; + + /** + * + * @brief 查询终端行数 + * + * + */ + export const height: number; + + + + + /** + * + * @brief 添加 console 输出系统,支持的设备为 console, syslog, event,最多可以添加 10 个输出 + * + * 通过配置 console,可以将程序输出和系统错误发往不同设备,用于运行环境信息收集。 + * + * type 为配置,为设备名称字符串: + * + * ```JavaScript + * console.add("console"); + * ``` + * + * syslog 仅在 posix 平台有效: + * ```JavaScript + * console.add("syslog"); + * ``` + * + * event 仅在 windows 平台有效: + * ```JavaScript + * console.add("event"); + * ``` + * + * @param type 输出设备 + * + * + * + */ + export function add(type: string): void; + + /** + * + * @brief 添加 console 输出系统,支持的设备为 console, syslog, event 和 file,最多可以添加 10 个输出 + * + * 通过配置 console,可以将程序输出和系统错误发往不同设备,用于运行环境信息收集。 + * + * cfg 可以为一个设备配置对象: + * ```JavaScript + * console.add({ + * type: "console", + * levels: [console.INFO, console.ERROR] // 选项,省略则输出全部级别日志 + * }); + * ``` + * + * syslog 仅在 posix 平台有效: + * ```JavaScript + * console.add({ + * type: "syslog", + * levels: [console.INFO, console.ERROR] + * }); + * ``` + * + * event 仅在 windows 平台有效: + * ```JavaScript + * console.add({ + * type: "event", + * levels: [console.INFO, console.ERROR] + * }); + * ``` + * + * file 日志: + * ```JavaScript + * console.add({ + * type: "file", + * levels: [console.INFO, console.ERROR], + * // 必选项,指定日志输出文件,可使用 s% 指定插入日期位置,不指定则添加在结尾 + * path: "path/to/file_%s.log", + * // 选项,可选值为 "day", "hour", "minute", "###k", "###m", "###g",缺省为 "1m" + * split: "30m", + * // 选项,可选范围为 2-128,缺省为 128 + * count: 10 + * }); + * ``` + * + * @param cfg 输出配置 + * + * + * + */ + export function add(cfg: object): void; + + /** + * + * @brief 批量添加 console 输出系统,支持的设备为 console, syslog, event 和 file,最多可以添加 10 个输出 + * + * 通过配置 console,可以将程序输出和系统错误发往不同设备,用于运行环境信息收集。 + * + * ```JavaScript + * console.add(["console", { + * type: "syslog", + * levels: [console.INFO, console.ERROR] + * }]); + * ``` + * + * @param cfg 输出配置数组 + * + * + * + */ + export function add(cfg: any[]): void; + + /** + * + * @brief 初始化到缺省设置,只在 console 输出信息 + * + * + */ + export function reset(): void; + + /** + * + * @brief 记录普通日志信息,与 info 等同 + * + * 记录一般等级的日志信息。通常用于输出非错误性提示信息。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function log(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录普通日志信息,与 info 等同 + * + * 记录一般等级的日志信息。通常用于输出非错误性提示信息。 + * @param args 可选参数列表 + * + * + * + */ + export function log(...args: any[]): void; + + /** + * + * @brief 记录调试日志信息 + * + * 记录调试日志信息。通常用于输出调试信息。不重要。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function debug(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录调试日志信息 + * + * 记录调试日志信息。通常用于输出调试信息。不重要。 + * @param args 可选参数列表 + * + * + * + */ + export function debug(...args: any[]): void; + + /** + * + * @brief 记录普通日志信息,与 log 等同 + * + * 记录一般等级的日志信息。通常用于输出非错误性提示信息。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function info(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录普通日志信息,与 log 等同 + * + * 记录一般等级的日志信息。通常用于输出非错误性提示信息。 + * @param args 可选参数列表 + * + * + * + */ + export function info(...args: any[]): void; + + /** + * + * @brief 记录警告日志信息 + * + * 记录警告日志信息。通常用于输出提示性调试信息。一般重要。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function notice(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录警告日志信息 + * + * 记录警告日志信息。通常用于输出提示性调试信息。一般重要。 + * @param args 可选参数列表 + * + * + * + */ + export function notice(...args: any[]): void; + + /** + * + * @brief 记录警告日志信息 + * + * 记录警告日志信息。通常用于输出警告性调试信息。重要。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function warn(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录警告日志信息 + * + * 记录警告日志信息。通常用于输出警告性调试信息。重要。 + * @param args 可选参数列表 + * + * + * + */ + export function warn(...args: any[]): void; + + /** + * + * @brief 记录错误日志信息 + * + * 记录用于错误日志信息。通常用于输出错误信息。非常重要。系统的出错信息也会以此等级记录。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function error(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录错误日志信息 + * + * 记录用于错误日志信息。通常用于输出错误信息。非常重要。系统的出错信息也会以此等级记录。 + * @param args 可选参数列表 + * + * + * + */ + export function error(...args: any[]): void; + + /** + * + * @brief 记录关键错误日志信息 + * + * 记录用于关键错误日志信息。通常用于输出关键错误信息。非常重要。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function crit(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录关键错误日志信息 + * + * 记录用于关键错误日志信息。通常用于输出关键错误信息。非常重要。 + * @param args 可选参数列表 + * + * + * + */ + export function crit(...args: any[]): void; + + /** + * + * @brief 记录警报错误日志信息 + * + * 记录用于警报错误日志信息。通常用于输出警报错误信息。非常重要。为最高级别信息。 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function alert(fmt: string, ...args: any[]): void; + + /** + * + * @brief 记录警报错误日志信息 + * + * 记录用于警报错误日志信息。通常用于输出警报错误信息。非常重要。为最高级别信息。 + * @param args 可选参数列表 + * + * + * + */ + export function alert(...args: any[]): void; + + /** + * + * @brief 用 JSON 格式输出对象 + * @param obj 给定要显示的对象 + * + * + * + */ + export function dir(obj: any): void; + + /** + * + * @brief 启动一个计时器 + * + * @param label 标题,缺省为空字符串。 + * + * + * + */ + export function time(label?: string/** = "time"*/): void; + + /** + * + * @brief 输出指定计时器当前计时值 + * + * @param label 标题,缺省为空字符串。 + * + * + * + */ + export function timeElapse(label?: string/** = "time"*/): void; + + /** + * + * @brief 结束指定计时器,并输出最后计时值 + * + * @param label 标题,缺省为空字符串。 + * + * + * + */ + export function timeEnd(label?: string/** = "time"*/): void; + + /** + * + * @brief 输出当前调用堆栈 + * + * 通过日志输出当前调用堆栈。 + * @param label 标题,缺省为空字符串。 + * + * + * + */ + export function trace(label?: string/** = "trace"*/): void; + + /** + * + * @brief 断言测试,如果测试值为假,则报错 + * @param value 测试的数值 + * @param msg 报错信息 + * + * + * + */ + export function assert(value: any, msg?: string/** = ""*/): void; + + /** + * + * @brief 向控制台输出格式化文本,输出内容不会记入日志系统,输出文本后不会自动换行,可连续输出 + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * + * + * + */ + export function print(fmt: string, ...args: any[]): void; + + /** + * + * @brief 向控制台输出格式化文本,输出内容不会记入日志系统,输出文本后不会自动换行,可连续输出 + * @param args 可选参数列表 + * + * + * + */ + export function print(...args: any[]): void; + + /** + * + * @brief 移动控制台光标到指定位置 + * @param row 指定新光标的行坐标 + * @param column 指定新光标的列坐标 + * + * + * + */ + export function moveTo(row: number, column: number): void; + + /** + * + * @brief 隐藏控制台光标 + * + * + */ + export function hideCursor(): void; + + /** + * + * @brief 显示控制台光标 + * + * + */ + export function showCursor(): void; + + /** + * + * @brief 清除控制台 + * + * + */ + export function clear(): void; + + /** + * + * @brief 按下一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键,可以为:control, alt, shift, command + * + * + * + */ + export function keyDown(key: string, modifier?: string/** = ""*/): void; + + /** + * + * @brief 按下一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键数组,可以为:control, alt, shift, command + * + * + * + */ + export function keyDown(key: string, modifier: any[]): void; + + /** + * + * @brief 松开一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键,可以为:control, alt, shift, command + * + * + * + */ + export function keyUp(key: string, modifier?: string/** = ""*/): void; + + /** + * + * @brief 松开一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键数组,可以为:control, alt, shift, command + * + * + * + */ + export function keyUp(key: string, modifier: any[]): void; + + /** + * + * @brief 点击并松开一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键,可以为:control, alt, shift, command + * + * + * + */ + export function keyTap(key: string, modifier?: string/** = ""*/): void; + + /** + * + * @brief 点击并松开一个按键 + * + * 参数 key 可以使用字符串传入功能键: + * - 功能键:f1 - f12 + * - 方向键:up, down,left, right, home, end, pageup, pagedown + * - 编辑键:backspace, delete, insert, enter, tab, escape, space + * - 控制键:control, alt, shift, command + * @param key 指定按键,单字符直接传入,功能键传入名称 + * @param modifier 指定控制键数组,可以为:control, alt, shift, command + * + * + * + */ + export function keyTap(key: string, modifier: any[]): void; + + /** + * + * @brief 输入一个字符串 + * @param text 指定输入的字符串 + * + * + * + */ + export function typeString(text: string): void; + + /** + * + * @brief 移动鼠标到指定的位置 + * @param x 指定 x 坐标 + * @param y 指定 y 坐标 + * + * + * + */ + export function moveMouse(x: number, y: number): void; + + /** + * + * @brief 按下一个鼠标键 + * @param button 指定鼠标键名称,允许值为: left, right, moddle + * + * + * + */ + export function mouseUp(button: string): void; + + /** + * + * @brief 放开一个鼠标键 + * @param button 指定鼠标键名称,允许值为: left, right, moddle + * + * + * + */ + export function mouseDown(button: string): void; + + /** + * + * @brief 点击一个鼠标键 + * @param button 指定鼠标键名称,允许值为: left, right, moddle + * @param dbclick 指定是否双击,缺省为 false + * + * + * + */ + export function clickMouse(button: string, dbclick?: boolean/** = false*/): void; + + /** + * + * @brief 从控制台读取用户输入 + * @param msg 提示信息 + * @return 返回用户输入的信息 + * + * + * @async + */ + export function readLine(msg?: string/** = ""*/): string; + + } /** end of `module console` */ + export = console +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/constants.d.ts b/types/fibjs/declare/constants.d.ts new file mode 100644 index 0000000000..76997275c9 --- /dev/null +++ b/types/fibjs/declare/constants.d.ts @@ -0,0 +1,217 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 常用常量定义模块 + * @detail 引用方法:,```JavaScript,var constants = require('constants');,``` + */ +declare module "constants" { + + + module constants { + + + + + + } /** end of `module constants` */ + export = constants +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/coroutine.d.ts b/types/fibjs/declare/coroutine.d.ts new file mode 100644 index 0000000000..8a4c5ec049 --- /dev/null +++ b/types/fibjs/declare/coroutine.d.ts @@ -0,0 +1,376 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 并发控制模块 + * @detail 引用方法:,```JavaScript,var coroutine = require('coroutine');,``` + */ +declare module "coroutine" { + + + module coroutine { + + + /** + * + * @brief 返回当前正在运行的全部 fiber 数组 + * + * + */ + export const fibers: any[]; + + /** + * + * @brief 查询和设置空闲 Fiber 数量,服务器抖动较大时可适度增加空闲 Fiber 数量。缺省为 256 + * + * + */ + export const spareFibers: number; + + /** + * + * @brief 查询当前 vm 编号 + * + * + */ + export const vmid: number; + + /** + * + * @brief 修改和查询本 vm 的输出级别,用以过滤输出信息,缺省为 console.NOTSET,全部输出 + * + * + * + */ + export const loglevel: number; + + + /** + * + * @brief 锁对象,参见 Lock + * + * + */ + export class Lock extends Class_Lock {} + + + /** + * + * @brief 信号量对象,参见 Semaphore + * + * + */ + export class Semaphore extends Class_Semaphore {} + + + /** + * + * @brief 条件变量对象,参见 Condition + * + * + */ + export class Condition extends Class_Condition {} + + + /** + * + * @brief 事件对象,参见 Event + * + * + */ + export class Event extends Class_Event {} + + + /** + * + * @brief 独立线程工作对象,参见 Worker + * + * + */ + export class Worker extends Class_Worker {} + + + + + /** + * + * @brief 启动一个纤程并返回纤程对象 + * @param func 制定纤程执行的函数 + * @param args 可变参数序列,此序列会在纤程内传递给函数 + * @return 返回纤程对象 + * + * + * + */ + export function start(func: Function, ...args: any[]): Class_Fiber; + + /** + * + * @brief 并行执行一组函数,并等待返回 + * @param funcs 并行执行的函数数组 + * @param fibers 限制并发 fiber 数量,缺省为 -1,启用与 funcs 数量相同 fiber + * @return 返回函数执行结果的数组 + * + * + * + */ + export function parallel(funcs: any[], fibers?: number/** = -1*/): any[]; + + /** + * + * @brief 并行执行一个函数处理一组数据,并等待返回 + * @param datas 并行执行的数据数组 + * @param func 并行执行的函数 + * @param fibers 限制并发 fiber 数量,缺省为 -1,启用与 datas 数量相同 fiber + * @return 返回函数执行结果的数组 + * + * + * + */ + export function parallel(datas: any[], func: Function, fibers?: number/** = -1*/): any[]; + + /** + * + * @brief 并行执行一个函数多次,并等待返回 + * @param func 并行执行的函数数 + * @param num 重复任务数量 + * @param fibers 限制并发 fiber 数量,缺省为 -1,启用与 funcs 数量相同 fiber + * @return 返回函数执行结果的数组 + * + * + * + */ + export function parallel(func: Function, num: number, fibers?: number/** = -1*/): any[]; + + /** + * + * @brief 并行执行一组函数,并等待返回 + * @param funcs 一组并行执行的函数 + * @return 返回函数执行结果的数组 + * + * + * + */ + export function parallel(...funcs: any[]): any[]; + + /** + * + * @brief 返回当前纤程 + * @return 当前纤程对象 + * + * + * + */ + export function current(): Class_Fiber; + + /** + * + * @brief 暂停当前纤程指定的时间 + * @param ms 指定要暂停的时间,以毫秒为单位,缺省为 0,即有空闲立即回恢复运行 + * + * + * @async + */ + export function sleep(ms?: number/** = 0*/): void; + + } /** end of `module coroutine` */ + export = coroutine +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/crypto.d.ts b/types/fibjs/declare/crypto.d.ts new file mode 100644 index 0000000000..9dcea20fa0 --- /dev/null +++ b/types/fibjs/declare/crypto.d.ts @@ -0,0 +1,606 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 加密算法模块 + * @detail 使用方法:,```JavaScript,var crypto = require('crypto');,``` + */ +declare module "crypto" { + + + module crypto { + + /** + * + * @brief 指定对称加密算法 AES,支持 128, 192, 256 位 key,分组密码工作模式支持 ECB, CBC, CFB128, CTR, GCM + * + * + */ + export const AES = 1; + + /** + * + * @brief 指定对称加密算法 CAMELLIA,支持 128, 192, 256 位 key,分组密码工作模式支持 ECB, CBC, CFB128, CTR, GCM + * + * + */ + export const CAMELLIA = 2; + + /** + * + * @brief 指定对称加密算法 DES,支持 64 位 key,分组密码工作模式支持 ECB, CBC + * + * + */ + export const DES = 3; + + /** + * + * @brief 指定对称加密算法 DES-EDE,支持 128 位 key,分组密码工作模式支持 ECB, CBC + * + * + */ + export const DES_EDE = 4; + + /** + * + * @brief 指定对称加密算法 DES-EDE3,支持 192 位 key,分组密码工作模式支持 ECB, CBC + * + * + */ + export const DES_EDE3 = 5; + + /** + * + * @brief 指定对称加密算法 BLOWFISH,支持 192 位 key,分组密码工作模式支持 ECB, CBC, CFB64, CTR + * + * + */ + export const BLOWFISH = 6; + + /** + * + * @brief 指定对称加密算法 ARC4,支持 40, 56, 64, 128 位 key + * + * + */ + export const ARC4 = 7; + + /** + * + * @brief 指定分组密码工作模式支持 ECB + * + * + */ + export const ECB = 1; + + /** + * + * @brief 指定分组密码工作模式支持 CBC + * + * + */ + export const CBC = 2; + + /** + * + * @brief 指定分组密码工作模式支持 CFB64 + * + * + */ + export const CFB64 = 3; + + /** + * + * @brief 指定分组密码工作模式支持 CFB128 + * + * + */ + export const CFB128 = 4; + + /** + * + * @brief 指定分组密码工作模式支持 OFB + * + * + */ + export const OFB = 5; + + /** + * + * @brief 指定分组密码工作模式支持 CTR + * + * + */ + export const CTR = 6; + + /** + * + * @brief 指定分组密码工作模式支持 GCM + * + * + */ + export const GCM = 7; + + /** + * + * @brief 指定流密码模式 + * + * + */ + export const STREAM = 8; + + /** + * + * @brief 指定分组密码工作模式支持 CCM + * + * + */ + export const CCM = 9; + + /** + * + * @brief 指定填充模式为 PKCS7 + * + * + */ + export const PKCS7 = 0; + + /** + * + * @brief 指定填充模式为 ONE_AND_ZEROS + * + * + */ + export const ONE_AND_ZEROS = 1; + + /** + * + * @brief 指定填充模式为 ZEROS_AND_LEN + * + * + */ + export const ZEROS_AND_LEN = 2; + + /** + * + * @brief 指定填充模式为 ZEROS + * + * + */ + export const ZEROS = 3; + + /** + * + * @brief 指定填充模式为 NOPADDING + * + * + */ + export const NOPADDING = 4; + + + + /** + * + * @brief Cipher 构造函数,参见 Cipher + * + * + */ + export class Cipher extends Class_Cipher {} + + + /** + * + * @brief PKey 构造函数,参见 PKey + * + * + */ + export class PKey extends Class_PKey {} + + + /** + * + * @brief X509Cert 构造函数,参见 X509Cert + * + * + */ + export class X509Cert extends Class_X509Cert {} + + + /** + * + * @brief X509Crl 构造函数,参见 X509Crl + * + * + */ + export class X509Crl extends Class_X509Crl {} + + + /** + * + * @brief X509Req 构造函数,参见 X509Req + * + * + */ + export class X509Req extends Class_X509Req {} + + + + + /** + * + * @brief 根据给定的算法名称创建一个信息摘要对象 + * @param algo 指定信息摘要对象的算法 + * @return 返回信息摘要对象 + * + * + * + */ + export function createHash(algo: string): Class_Digest; + + /** + * + * @brief 根据给定的算法名称创建一个 hmac 信息摘要对象 + * @param algo 指定信息摘要对象的算法 + * @param key 二进制签名密钥 + * @return 返回信息摘要对象 + * + * + * + */ + export function createHmac(algo: string, key: Class_Buffer): Class_Digest; + + /** + * + * @brief 加载一个 PEM/DER 格式的密钥文件 + * @param filename 密钥文件名 + * @param password 解密密码 + * @return 返回包含密钥的对象 + * + * + * + */ + export function loadPKey(filename: string, password?: string/** = ""*/): Class_PKey; + + /** + * + * @brief 加载一个 CRT/PEM/DER/TXT 格式的证书,可多次调用 + * + * loadFile 加载 mozilla 的 certdata,txt, 可于 http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt 下载使用 + * @param filename 证书文件名 + * @return 返回包含证书的对象 + * + * + * + */ + export function loadCert(filename: string): Class_X509Cert; + + /** + * + * @brief 加载一个 PEM/DER 格式的撤销证书,可多次调用 + * @param filename 撤销证书文件名 + * @return 返回包含撤销证书的对象 + * + * + * + */ + export function loadCrl(filename: string): Class_X509Crl; + + /** + * + * @brief 加载一个 PEM/DER 格式的证书请求,可多次调用 + * @param filename 证书请求文件名 + * @return 返回包含请求证书的对象 + * + * + * + */ + export function loadReq(filename: string): Class_X509Req; + + /** + * + * @brief 生成指定尺寸的随机数,使用 havege 生成器 + * @param size 指定生成的随机数尺寸 + * @return 返回生成的随机数 + * + * + * @async + */ + export function randomBytes(size: number): Class_Buffer; + + /** + * + * @brief 生成指定尺寸的低强度随机数,使用快速的算法 + * @param size 指定生成的随机数尺寸 + * @return 返回生成的随机数 + * + * + * @async + */ + export function simpleRandomBytes(size: number): Class_Buffer; + + /** + * + * @brief 生成指定尺寸的伪随机数,使用 entropy 生成器 + * @param size 指定生成的随机数尺寸 + * @return 返回生成的随机数 + * + * + * @async + */ + export function pseudoRandomBytes(size: number): Class_Buffer; + + /** + * + * @brief 生成给定数据的可视化字符图像 + * @param data 指定要展示的数据 + * @param title 指定字符图像的标题,多字节字符会导致宽度错误 + * @param size 字符图像尺寸 + * @return 返回生成的可视化字符串图像 + * + * + * + */ + export function randomArt(data: Class_Buffer, title: string, size?: number/** = 8*/): string; + + /** + * + * @brief 依据 pbkdf1 根据明文 password 生成要求的二进制钥匙 + * @param password 指定使用的密码 + * @param salt 指定 hmac 使用的 salt + * @param iterations 指定迭代次数 + * @param size 指定钥匙尺寸 + * @param algo 指定要使用的 hash 算法,详见 hash 模块 + * @return 返回生成的二进制钥匙 + * + * + * @async + */ + export function pbkdf1(password: Class_Buffer, salt: Class_Buffer, iterations: number, size: number, algo: number): Class_Buffer; + + /** + * + * @brief 依据 pbkdf1 根据明文 password 生成要求的二进制钥匙 + * @param password 指定使用的密码 + * @param salt 指定 hmac 使用的 salt + * @param iterations 指定迭代次数 + * @param size 指定钥匙尺寸 + * @param algoName 指定要使用的 hash 算法,详见 hash 模块 + * @return 返回生成的二进制钥匙 + * + * + * @async + */ + export function pbkdf1(password: Class_Buffer, salt: Class_Buffer, iterations: number, size: number, algoName: string): Class_Buffer; + + /** + * + * @brief 依据 rfc2898 根据明文 password 生成要求的二进制钥匙 + * @param password 指定使用的密码 + * @param salt 指定 hmac 使用的 salt + * @param iterations 指定迭代次数 + * @param size 指定钥匙尺寸 + * @param algo 指定要使用的 hash 算法,详见 hash 模块 + * @return 返回生成的二进制钥匙 + * + * + * @async + */ + export function pbkdf2(password: Class_Buffer, salt: Class_Buffer, iterations: number, size: number, algo: number): Class_Buffer; + + /** + * + * @brief 依据 rfc2898 根据明文 password 生成要求的二进制钥匙 + * @param password 指定使用的密码 + * @param salt 指定 hmac 使用的 salt + * @param iterations 指定迭代次数 + * @param size 指定钥匙尺寸 + * @param algoName 指定要使用的 hash 算法,详见 hash 模块 + * @return 返回生成的二进制钥匙 + * + * + * @async + */ + export function pbkdf2(password: Class_Buffer, salt: Class_Buffer, iterations: number, size: number, algoName: string): Class_Buffer; + + } /** end of `module crypto` */ + export = crypto +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/db.d.ts b/types/fibjs/declare/db.d.ts new file mode 100644 index 0000000000..04cc2f101a --- /dev/null +++ b/types/fibjs/declare/db.d.ts @@ -0,0 +1,345 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 数据库访问模块 + * @detail 基础模块。可用于创建和操作数据库资源,引用方式:,```JavaScript,var db = require('db');,``` + */ +declare module "db" { + + + module db { + + + + + + /** + * + * @brief 打开一个数据库,此方法为通用入口,根据提供的 connString 不同调用不同的引擎 + * @param connString 数据库描述,如:mysql://user:pass\@host/db + * @return 返回数据库连接对象 + * + * + * @async + */ + export function open(connString: string): Class__object; + + /** + * + * @brief 打开一个 mysql 数据库 + * @param connString 数据库描述,如:mysql://user:pass\@host/db + * @return 返回数据库连接对象 + * + * + * @async + */ + export function openMySQL(connString: string): Class_MySQL; + + /** + * + * @brief 打开一个 mysql 数据库 + * @param connString 数据库描述,如:mssql://user:pass\@host/db + * @return 返回数据库连接对象 + * + * + * @async + */ + export function openMSSQL(connString: string): Class_MSSQL; + + /** + * + * @brief 打开一个 sqlite 数据库 + * @param connString 数据库描述,如:sqlite:test.db 或者 test.db + * @return 返回数据库连接对象 + * + * + * @async + */ + export function openSQLite(connString: string): Class_SQLite; + + /** + * + * @brief 打开一个 mongodb 数据库 + * @param connString 数据库描述 + * @return 返回数据库连接对象 + * + * + * @async + */ + export function openMongoDB(connString: string): Class_MongoDB; + + /** + * + * @brief 打开一个 leveldb 数据库 + * @param connString 数据库描述,如:level:test.db 或者 test.db + * @return 返回数据库对象 + * + * + * @async + */ + export function openLevelDB(connString: string): Class_LevelDB; + + /** + * + * @brief 打开一个 Redis 数据库 + * @param connString 数据库描述,如:redis://server:port 或者 "server" + * @return 返回数据库连接对象 + * + * + * @async + */ + export function openRedis(connString: string): Class_Redis; + + /** + * + * @brief 格式化一个 sql 命令,并返回格式化结果 + * + * @param sql 格式化字符串,可选参数用 ? 指定。例如:'SELECT FROM TEST WHERE [id]=?' + * @param args 可选参数列表 + * @return 返回格式化之后的 sql 命令 + * + * + * + */ + export function format(sql: string, ...args: any[]): string; + + /** + * + * @brief 格式化一个 mysql 命令,并返回格式化结果 + * + * @param sql 格式化字符串,可选参数用 ? 指定。例如:'SELECT FROM TEST WHERE [id]=?' + * @param args 可选参数列表 + * @return 返回格式化之后的 sql 命令 + * + * + * + */ + export function formatMySQL(sql: string, ...args: any[]): string; + + /** + * + * @brief 格式化一个 mssql 命令,并返回格式化结果 + * + * @param sql 格式化字符串,可选参数用 ? 指定。例如:'SELECT FROM TEST WHERE [id]=?' + * @param args 可选参数列表 + * @return 返回格式化之后的 sql 命令 + * + * + * + */ + export function formatMSSQL(sql: string, ...args: any[]): string; + + /** + * + * @brief 将字符串编码为 SQL 安全编码字符串 + * @param str 要编码的字符串 + * @param mysql 指定 mysql 编码,缺省为 false + * @return 返回编码后的字符串 + * + * + * + */ + export function escape(str: string, mysql?: boolean/** = false*/): string; + + } /** end of `module db` */ + export = db +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/dgram.d.ts b/types/fibjs/declare/dgram.d.ts new file mode 100644 index 0000000000..0d3ccd20a9 --- /dev/null +++ b/types/fibjs/declare/dgram.d.ts @@ -0,0 +1,294 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief dgram 模块提供了 UDP 数据包 socket 的实现 + * @detail 基础模块,引用方式:,```JavaScript,var dgram = require('dgram');,``` + */ +declare module "dgram" { + + + module dgram { + + + + /** + * + * @brief dgram.Socket 对象是一个封装了数据包函数功能的 EventEmitter。参见 DgramSocket + * dgram.Socket 实例是由 dgram.createSocket() 创建的。创建 dgram.Socket 实例不需要使用 new 关键字。 + * + * + * + */ + export class Socket extends Class_DgramSocket {} + + + + + /** + * + * @brief 创建一个 dgram.Socket 对象 + * + * opts 允许的选项是: + * ```JavaScript + * { + * "type": "udp4" | "udp6", // 必填 + * "reuseAddr": true | false, //若设置为 true,socket.bind() 则会重用地址,即时另一个进程已经在其上面绑定了一个套接字。 默认是 false + * "recvBufferSize": ###, // 设置 SO_RCVBUF 套接字值 + * "sendBufferSize": ### //设置 SO_RCVBUF 套接字值 + * } + * ``` + * @param opts + * @return 返回创建的 Socket 对象 + * + * + * + */ + export function createSocket(opts: object): Class_DgramSocket; + + /** + * + * @brief 创建一个 dgram.Socket 对象 + * + * opts 允许的选项是: + * ```JavaScript + * { + * "type": "udp4" | "udp6", // 必填 + * "reuseAddr": true | false, //若设置为 true,socket.bind() 则会重用地址,即时另一个进程已经在其上面绑定了一个套接字。 默认是 false + * "recvBufferSize": ###, // 设置 SO_RCVBUF 套接字值 + * "sendBufferSize": ### //设置 SO_RCVBUF 套接字值 + * } + * ``` + * @param opts + * @param callback 为 'message' 事件添加一个监听器。 + * @return 返回创建的 Socket 对象 + * + * + * + */ + export function createSocket(opts: object, callback: Function): Class_DgramSocket; + + /** + * + * @brief 创建一个 dgram.Socket 对象 + * @param type 套接字族,'udp4' 或 'udp6'。 + * @return 返回创建的 Socket 对象 + * + * + * + */ + export function createSocket(type: string): Class_DgramSocket; + + /** + * + * @brief 创建一个 dgram.Socket 对象 + * @param type 套接字族,'udp4' 或 'udp6'。 + * @param callback 为 'message' 事件添加一个监听器。 + * @return 返回创建的 Socket 对象 + * + * + * + */ + export function createSocket(type: string, callback: Function): Class_DgramSocket; + + } /** end of `module dgram` */ + export = dgram +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/dns.d.ts b/types/fibjs/declare/dns.d.ts new file mode 100644 index 0000000000..c2b802cb5d --- /dev/null +++ b/types/fibjs/declare/dns.d.ts @@ -0,0 +1,239 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief dns 域名查询模块 + * @detail 基础模块,引用方式:,```JavaScript,var dns = require('dns');,``` + */ +declare module "dns" { + + + module dns { + + + + + + /** + * + * @brief 查询给定的主机名的地址 + * @param name 指定主机名 + * @return 返回查询的 ip 字符串数组 + * + * + * @async + */ + export function resolve(name: string): any[]; + + /** + * + * @brief 查询给定的主机名的地址 + * @param name 指定主机名 + * @return 返回查询的 ip 字符串 + * + * + * @async + */ + export function lookup(name: string): string; + + } /** end of `module dns` */ + export = dns +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/encoding.d.ts b/types/fibjs/declare/encoding.d.ts new file mode 100644 index 0000000000..86db5533ac --- /dev/null +++ b/types/fibjs/declare/encoding.d.ts @@ -0,0 +1,346 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + + + + + + + + + + + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 编码与解码模块,用于处理不同的数据编码格式与二进制之间的转换 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,``` + */ +declare module "encoding" { + + import base32NS = require('base32') + import base64NS = require('base64') + import base64vlqNS = require('base64vlq') + import hexNS = require('hex') + import iconvNS = require('iconv') + import jsonNS = require('json') + import bsonNS = require('bson') + + module encoding { + + + + /** + * + * @brief base32 编码与解码模块 + * + * + */ + + export const base32: typeof base32NS + + /** + * + * @brief base64 编码与解码模块 + * + * + */ + + export const base64: typeof base64NS + + /** + * + * @brief base64vlq 编码与解码模块 + * + * + */ + + export const base64vlq: typeof base64vlqNS + + /** + * + * @brief hex 编码与解码模块 + * + * + */ + + export const hex: typeof hexNS + + /** + * + * @brief iconv 编码与解码模块 + * + * + */ + + export const iconv: typeof iconvNS + + /** + * + * @brief json 编码与解码模块 + * + * + */ + + export const json: typeof jsonNS + + /** + * + * @brief bson 编码与解码模块 + * + * + */ + + export const bson: typeof bsonNS + + + + /** + * + * @brief 将字符串编码为 javascript 转义字符串,用以在 javascript 代码中包含文本 + * @param str 要编码的字符串 + * @param json 是否生成json兼容字符串 + * @return 返回编码的字符串 + * + * + * + */ + export function jsstr(str: string, json?: boolean/** = false*/): string; + + /** + * + * @brief url 字符串安全编码 + * @param url 要编码的 url + * @return 返回编码的字符串 + * + * + * + */ + export function encodeURI(url: string): string; + + /** + * + * @brief url 部件字符串安全编码 + * @param url 要编码的 url + * @return 返回编码的字符串 + * + * + * + */ + export function encodeURIComponent(url: string): string; + + /** + * + * @brief url 安全字符串解码 + * @param url 要解码的 url + * @return 返回解码的字符串 + * + * + * + */ + export function decodeURI(url: string): string; + + } /** end of `module encoding` */ + export = encoding +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/fs.d.ts b/types/fibjs/declare/fs.d.ts new file mode 100644 index 0000000000..b0971e3ee5 --- /dev/null +++ b/types/fibjs/declare/fs.d.ts @@ -0,0 +1,677 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 文件系统处理模块 + * @detail 使用方法:,```JavaScript,var fs = require('fs');,``` + */ +declare module "fs" { + + + module fs { + + /** + * + * @brief seek 方式常量,移动到绝对位置 + * + * + */ + export const SEEK_SET = 0; + + /** + * + * @brief seek 方式常量,移动到当前位置的相对位置 + * + * + */ + export const SEEK_CUR = 1; + + /** + * + * @brief seek 方式常量,移动到文件结尾的相对位置 + * + * + */ + export const SEEK_END = 2; + + + /** + * + * ! fs模块的常量对象 + * + * + */ + export const constants: Object; + + + + + /** + * + * @brief 查询指定的文件或目录是否存在 + * @param path 指定要查询的路径 + * @return 返回 True 表示文件或目录存在 + * + * + * @async + */ + export function exists(path: string): boolean; + + /** + * + * @brief 查询用户对指定的文件的权限 + * @param path 指定要查询的路径 + * @param mode 指定查询的权限,默认为文件是否存在 + * + * + * @async + */ + export function access(path: string, mode?: number/** = 0*/): void; + + /** + * + * @brief 创建硬链接文件, windows 下不支持此方法 + * @param oldPath 源文件 + * @param newPath 将要被创建的文件 + * + * + * @async + */ + export function link(oldPath: string, newPath: string): void; + + /** + * + * @brief 删除指定的文件 + * @param path 指定要删除的路径 + * + * + * @async + */ + export function unlink(path: string): void; + + /** + * + * @brief 创建一个目录 + * @param path 指定要创建的目录名 + * @param mode 指定文件权限,Windows 忽略此参数 + * + * + * @async + */ + export function mkdir(path: string, mode?: number/** = 0777*/): void; + + /** + * + * @brief 删除一个目录 + * @param path 指定要删除的目录名 + * + * + * @async + */ + export function rmdir(path: string): void; + + /** + * + * @brief 重新命名一个文件 + * @param from 指定更名的文件 + * @param to 指定要修改的新文件名 + * + * + * @async + */ + export function rename(from: string, to: string): void; + + /** + * + * @brief 复制一个文件 + * @param from 指定更名的文件 + * @param to 指定要修改的新文件名 + * + * + * @async + */ + export function copy(from: string, to: string): void; + + /** + * + * @brief 设置指定文件的访问权限,Windows 不支持此方法 + * @param path 指定操作的文件 + * @param mode 指定设定的访问权限 + * + * + * @async + */ + export function chmod(path: string, mode: number): void; + + /** + * + * @brief 设置指定文件的访问权限,若文件是软连接则不改变指向文件的权限,只在macOS、BSD 系列平台上可用 + * @param path 指定操作的文件 + * @param mode 指定设定的访问权限 + * + * + * @async + */ + export function lchmod(path: string, mode: number): void; + + /** + * + * @brief 设置指定文件的拥有者,Windows 不支持此方法 + * @param path 指定设置的文件 + * @param uid 文件拥有者用户id + * @param gid 文件拥有者组id + * + * + * @async + */ + export function chown(path: string, uid: number, gid: number): void; + + /** + * + * @brief 设置指定文件的拥有者,如果指定的文件是软连接则不会改变其指向文件的拥有者,Windows 不支持此方法 + * @param path 指定设置的文件 + * @param uid 文件拥有者用户id + * @param gid 文件拥有者组id + * + * + * @async + */ + export function lchown(path: string, uid: number, gid: number): void; + + /** + * + * @brief 查询指定文件的基础信息 + * @param path 指定查询的文件 + * @return 返回文件的基础信息 + * + * + * @async + */ + export function stat(path: string): Class_Stat; + + /** + * + * @brief 查询指定文件的基础信息, 和stat不同的是, 当path是一个软连接的时候,返回的将是这个软连接的信息而不是指向的文件的信息 + * @param path 指定查询的文件 + * @return 返回文件的基础信息 + * + * + * @async + */ + export function lstat(path: string): Class_Stat; + + /** + * + * @brief 读取指定的软连接文件, windows 下不支持此方法 + * @param path 指定读取的软连接文件 + * @return 返回软连接指向的文件名 + * + * + * @async + */ + export function readlink(path: string): string; + + /** + * + * @brief 返回指定路径的绝对路径,如果指定路径中包含相对路径也会被展开 + * @param path 指定读取的路径 + * @return 返回处理后的绝对路径 + * + * + * @async + */ + export function realpath(path: string): string; + + /** + * + * @brief 创建软连接文件 + * @param target 目标文件,可以是文件、目录、或不存在的路径 + * @param linkpath 将被创建的软连接文件 + * @param type 创建的软连接类型, 可选类型为'file', 'dir', 'junction', 默认为'file', 该参数只在windows上有效,当为'junction'的时候将要创建的目标路径linkpath必须为绝对路径, 而target则会被自动转化为绝对路径。 + * + * + * @async + */ + export function symlink(target: string, linkpath: string, type?: string/** = "file"*/): void; + + /** + * + * @brief 修改文件尺寸,如果指定的长度大于源文件大小则用'\0'填充,否则多于的文件内容将丢失 + * @param path 指定被修改文件的路径 + * @param len 指定修改后文件的大小 + * + * + * @async + */ + export function truncate(path: string, len: number): void; + + /** + * + * @brief 根据文件描述符,读取文件内容 + * @param fd 文件描述符 + * @param buffer 读取结果写入的 Buffer 对象 + * @param offset Buffer 写入偏移量, 默认为 0 + * @param length 文件读取字节数,默认为 0 + * @param position 文件读取位置,默认为当前文件位置 + * @return 实际读取的字节数 + * + * + * @async + */ + export function read(fd: number, buffer: Class_Buffer, offset?: number/** = 0*/, length?: number/** = 0*/, position?: number/** = -1*/): number; + + /** + * + * @brief 根据文件描述符,改变文件模式。只在 POSIX 系统有效。 + * @param fd 文件描述符 + * @param mode 文件的模式 + * + * + * @async + */ + export function fchmod(fd: number, mode: number): void; + + /** + * + * @brief 根据文件描述符,改变所有者。只在 POSIX 系统有效。 + * @param fd 文件描述符 + * @param uid 用户id + * @param gid 组id + * + * + * @async + */ + export function fchown(fd: number, uid: number, gid: number): void; + + /** + * + * @brief 根据文件描述符,同步数据到磁盘 + * @param fd 文件描述符 + * + * + * @async + */ + export function fdatasync(fd: number): void; + + /** + * + * @brief 根据文件描述符,同步数据到磁盘 + * @param fd 文件描述符 + * + * + * @async + */ + export function fsync(fd: number): void; + + /** + * + * @brief 读取指定目录的文件信息 + * @param path 指定查询的目录 + * @return 返回目录的文件信息数组 + * + * + * @async + */ + export function readdir(path: string): any[]; + + /** + * + * @brief 打开文件,用于读取,写入,或者同时读写 + * + * 参数 flags 支持的方式如下: + * - 'r' 只读方式,文件不存在则抛出错误。 + * - 'r+' 读写方式,文件不存在则抛出错误。 + * - 'w' 只写方式,文件不存在则自动创建,存在则将被清空。 + * - 'w+' 读写方式,文件不存在则自动创建。 + * - 'a' 只写添加方式,文件不存在则自动创建。 + * - 'a+' 读写添加方式,文件不存在则自动创建。 + * @param fname 指定文件名 + * @param flags 指定文件打开方式,缺省为 "r",只读方式 + * @return 返回打开的文件对象 + * + * + * @async + */ + export function openFile(fname: string, flags?: string/** = "r"*/): Class_SeekableStream; + + /** + * + * @brief 打开文件描述符 + * + * 参数 flags 支持的方式如下: + * - 'r' 只读方式,文件不存在则抛出错误。 + * - 'r+' 读写方式,文件不存在则抛出错误。 + * - 'w' 只写方式,文件不存在则自动创建,存在则将被清空。 + * - 'w+' 读写方式,文件不存在则自动创建。 + * - 'a' 只写添加方式,文件不存在则自动创建。 + * - 'a+' 读写添加方式,文件不存在则自动创建。 + * @param fname 指定文件名 + * @param flags 指定文件打开方式,缺省为 "r",只读方式 + * @param mode 当创建文件的时候,指定文件的模式,默认 0666 + * @return 返回打开的文件描述符 + * + * + * @async + */ + export function open(fname: string, flags?: string/** = "r"*/, mode?: number/** = 0666*/): number; + + /** + * + * @brief 关闭文件描述符 + * @param fd 文件描述符 + * + * + * @async + */ + export function close(fd: number): void; + + /** + * + * @brief 打开文本文件,用于读取,写入,或者同时读写 + * + * 参数 flags 支持的方式如下: + * - 'r' 只读方式,文件不存在则抛出错误。 + * - 'r+' 读写方式,文件不存在则抛出错误。 + * - 'w' 只写方式,文件不存在则自动创建,存在则将被清空。 + * - 'w+' 读写方式,文件不存在则自动创建。 + * - 'a' 只写添加方式,文件不存在则自动创建。 + * - 'a+' 读写添加方式,文件不存在则自动创建。 + * @param fname 指定文件名 + * @param flags 指定文件打开方式,缺省为 "r",只读方式 + * @return 返回打开的文件对象 + * + * + * @async + */ + export function openTextStream(fname: string, flags?: string/** = "r"*/): Class_BufferedStream; + + /** + * + * @brief 打开文本文件,并读取内容 + * @param fname 指定文件名 + * @return 返回文件文本内容 + * + * + * @async + */ + export function readTextFile(fname: string): string; + + /** + * + * @brief 打开二进制文件,并读取内容 + * @param fname 指定文件名 + * @param encoding 指定解码方式,缺省不解码 + * @return 返回文件文本内容 + * + * + * @async + */ + export function readFile(fname: string, encoding?: string/** = ""*/): any; + + /** + * + * @brief 打开文件,以数组方式读取一组文本行,行结尾标识基于 EOL 属性的设置,缺省时,posix:"\n";windows:"\r\n" + * @param fname 指定文件名 + * @param maxlines 指定此次读取的最大行数,缺省读取全部文本行 + * @return 返回读取的文本行数组,若无数据可读,或者连接中断,空数组 + * + * + * + */ + export function readLines(fname: string, maxlines?: number/** = -1*/): any[]; + + /** + * + * @brief 创建文本文件,并写入内容 + * @param fname 指定文件名 + * @param txt 指定要写入的字符串 + * + * + * @async + */ + export function writeTextFile(fname: string, txt: string): void; + + /** + * + * @brief 创建二进制文件,并写入内容 + * @param fname 指定文件名 + * @param data 指定要写入的二进制数据 + * + * + * @async + */ + export function writeFile(fname: string, data: Class_Buffer): void; + + /** + * + * @brief 创建二进制文件,并写入内容 + * @param fname 指定文件名 + * @param data 指定要写入的二进制数据 + * + * + * @async + */ + export function appendFile(fname: string, data: Class_Buffer): void; + + /** + * + * @brief 设置 zip 虚拟文件映射 + * @param fname 指定映射路径 + * @param data 指定映射的 zip 文件数据 + * + * + * + */ + export function setZipFS(fname: string, data: Class_Buffer): void; + + /** + * + * @brief 清除 zip 虚拟文件映射 + * @param fname 指定映射路径,缺省清除全部缓存 + * + * + * + */ + export function clearZipFS(fname?: string/** = ""*/): void; + + } /** end of `module fs` */ + export = fs +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/gd.d.ts b/types/fibjs/declare/gd.d.ts new file mode 100644 index 0000000000..843e74f1e9 --- /dev/null +++ b/types/fibjs/declare/gd.d.ts @@ -0,0 +1,587 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 图像文件处理模块 + * @detail 基础模块。可用于创建和操作图像文件,引用方式:,```JavaScript,var gd = require('gd');,``` + */ +declare module "gd" { + + + module gd { + + /** + * + * @brief 图像格式常量,标示当前图像来源为未知 + * + * + */ + export const NONE = 0; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 jpeg 格式数据 + * + * + */ + export const JPEG = 1; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 gif 格式数据 + * + * + */ + export const GIF = 2; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 png 格式数据 + * + * + */ + export const PNG = 3; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 tiff 格式数据 + * + * + */ + export const TIFF = 4; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 bmp 格式数据 + * + * + */ + export const BMP = 5; + + /** + * + * @brief 图像格式常量,标示当前图像来源为 webp 格式数据 + * + * + */ + export const WEBP = 6; + + /** + * + * @brief 图像类型常量,标示当前图像为真彩色图像 + * + * + */ + export const TRUECOLOR = 0; + + /** + * + * @brief 图像类型常量,标示当前图像为调色板图像 + * + * + */ + export const PALETTE = 1; + + /** + * + * @brief 扇形绘制样式,绘制一条连接开始和结束点的圆弧 + * + * + */ + export const ARC = 0; + + /** + * + * @brief 扇形绘制样式,绘制一条连接原点,开始和结束点的直线 + * + * + */ + export const CHORD = 1; + + /** + * + * @brief 扇形绘制样式,绘制不填充的扇形 + * + * + */ + export const NOFILL = 2; + + /** + * + * @brief 扇形绘制样式,绘制一条连接起点和终点的弧和连接原点的直线 + * + * + */ + export const EDGED = 4; + + /** + * + * @brief 镜像方向,横向做镜像处理 + * + * + */ + export const HORIZONTAL = 1; + + /** + * + * @brief 镜像方向,纵向做镜像处理 + * + * + */ + export const VERTICAL = 2; + + /** + * + * @brief 镜像方向,横向和纵向都做镜像处理 + * + * + */ + export const BOTH = 3; + + /** + * + * @brief 旋转方向,向左旋转 + * + * + */ + export const LEFT = 1; + + /** + * + * @brief 旋转方向,向右旋转 + * + * + */ + export const RIGHT = 2; + + /** + * + * @brief 滤波器类型:用平均移除法来达到轮廓效果 + * + * + */ + export const MEAN_REMOVAL = 0; + + /** + * + * @brief 滤波器类型:用边缘检测来突出图像的边缘 + * + * + */ + export const EDGEDETECT = 1; + + /** + * + * @brief 滤波器类型:使图像浮雕化 + * + * + */ + export const EMBOSS = 2; + + /** + * + * @brief 滤波器类型:模糊图像 + * + * + */ + export const SELECTIVE_BLUR = 3; + + /** + * + * @brief 滤波器类型:用高斯算法模糊图像 + * + * + */ + export const GAUSSIAN_BLUR = 4; + + /** + * + * @brief 滤波器类型:将图像中所有颜色反转 + * + * + */ + export const NEGATE = 5; + + /** + * + * @brief 滤波器类型:将图像转换为灰度图 + * + * + */ + export const GRAYSCALE = 6; + + /** + * + * @brief 滤波器类型:使图像更柔滑,用arg1设定柔滑级别 + * + * + */ + export const SMOOTH = 7; + + /** + * + * @brief 滤波器类型:改变图像的亮度,用arg1设定亮度级别,取值范围是-255~255 + * + * + */ + export const BRIGHTNESS = 8; + + /** + * + * @brief 滤波器类型:改变图像的对比度,用arg1设定对比度级别,取值范围是0~100 + * + * + */ + export const CONTRAST = 9; + + /** + * + * @brief 滤波器类型:改变图像的色调,用arg1、arg2、arg3分别指定red、blue、green,每种颜色范围是0~255,arg4为透明度,取值返回是0~127 + * + * + */ + export const COLORIZE = 10; + + + + + + /** + * + * @brief 创建一个新图像 + * @param width 指定图像宽度 + * @param height 指定图像高度 + * @param color 指定图像类型,允许值为 gd.TRUECOLOR 或 gd.PALETTE + * @return 返回创建成功的图像对象 + * + * + * @async + */ + export function create(width: number, height: number, color?: number/** = undefined*/): Class_Image; + + /** + * + * @brief 从格式数据中解码图像 + * @param data 给定解码的图像数据 + * @return 返回解码成功的图像对象 + * + * + * @async + */ + export function load(data: Class_Buffer): Class_Image; + + /** + * + * @brief 从流对象中解码图像 + * @param stm 给定图像数据所在的流对象 + * @return 返回解码成功的图像对象 + * + * + * @async + */ + export function load(stm: Class_SeekableStream): Class_Image; + + /** + * + * @brief 从指定文件中解码图像 + * @param fname 指定文件名 + * @return 返回解码成功的图像对象 + * + * + * @async + */ + export function load(fname: string): Class_Image; + + /** + * + * @brief 通过 rgb 颜色分量生成组合颜色 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @return 返回组合颜色 + * + * + * + */ + export function rgb(red: number, green: number, blue: number): number; + + /** + * + * @brief 通过 rgba 颜色分量生成组合颜色 + * @param red 红色分量,范围为 0-255 + * @param green 绿色分量,范围为 0-255 + * @param blue 蓝色分量,范围为 0-255 + * @param alpha 透明分量,范围为 0.0-1.0 + * @return 返回组合颜色 + * + * + * + */ + export function rgba(red: number, green: number, blue: number, alpha: number): number; + + /** + * + * @brief 通过 hsl 颜色分量生成组合颜色 + * @param hue 色相分量,范围为 0-360 + * @param saturation 饱和度分量,范围为 0.0-1.0 + * @param lightness 亮度分量,范围为 0.0-1.0 + * @return 返回组合颜色 + * + * + * + */ + export function hsl(hue: number, saturation: number, lightness: number): number; + + /** + * + * @brief 通过 hsla 颜色分量生成组合颜色 + * @param hue 色相分量,范围为 0-360 + * @param saturation 饱和度分量,范围为 0.0-1.0 + * @param lightness 亮度分量,范围为 0.0-1.0 + * @param alpha 透明分量,范围为 0.0-1.0 + * @return 返回组合颜色 + * + * + * + */ + export function hsla(hue: number, saturation: number, lightness: number, alpha: number): number; + + /** + * + * @brief 通过 hsb 颜色分量生成组合颜色 + * @param hue 色相分量,范围为 0-360 + * @param saturation 饱和度分量,范围为 0.0-1.0 + * @param brightness 明亮程度分量,范围为 0.0-1.0 + * @return 返回组合颜色 + * + * + * + */ + export function hsb(hue: number, saturation: number, brightness: number): number; + + /** + * + * @brief 通过 hsba 颜色分量生成组合颜色 + * @param hue 色相分量,范围为 0-360 + * @param saturation 饱和度分量,范围为 0.0-1.0 + * @param brightness 明亮程度分量,范围为 0.0-1.0 + * @param alpha 透明分量,范围为 0.0-1.0 + * @return 返回组合颜色 + * + * + * + */ + export function hsba(hue: number, saturation: number, brightness: number, alpha: number): number; + + /** + * + * @brief 通过字符串生成组合颜色 + * @param color 指定颜色的字符串,如:"#ff0000", "ff0000", "#f00", "f00" + * @return 返回组合颜色 + * + * + * + */ + export function color(color: string): number; + + } /** end of `module gd` */ + export = gd +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/global.d.ts b/types/fibjs/declare/global.d.ts new file mode 100644 index 0000000000..19d539d932 --- /dev/null +++ b/types/fibjs/declare/global.d.ts @@ -0,0 +1,553 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 全局对象,所有脚本均可以访问的基础对象 + * @detail + */ +declare module "global" { + + import consoleNS = require('console') + import processNS = require('process') + + module global { + + + /** + * + * @brief Worker 宿主对象,仅在 Worker 入口脚本有效 + * + * + */ + export const Master: Class_Worker; + + /** + * + * @brief 全局对象 + * + * + */ + export const global: Object; + + /** + * + * @brief 获取当前脚本的运行参数,启动 js 获取进程启动参数,run 执行的脚本获取传递的参数 + * + * + */ + export const argv: any[]; + + /** + * + * @brief 当前脚本文件名 + * + * + */ + export const __filename: string; + + /** + * + * @brief 当前脚本所在目录 + * + * + */ + export const __dirname: string; + + + /** + * + * @brief 二进制数据缓存对象,用于 io 读写的数据处理,参见 Buffer 对象。 + * + * + */ + export class Buffer extends Class_Buffer {} + + + /** + * + * @brief 64位整数对象,参见 Int64 对象。 + * + * + */ + export class Int64 extends Class_Int64 {} + + + /** + * + * @brief 控制台访问对象 + * + * + */ + + export const console: typeof consoleNS + + /** + * + * @brief 进程对象 + * + * + */ + + export const process: typeof processNS + + + + /** + * + * @brief 运行一个脚本 + * @param fname 指定要运行的脚本路径 + * @param argv 指定要运行的参数,此参数可在脚本内使用 argv 获取 + * + * + * + */ + export function run(fname: string, argv?: any[]/** = v8::Array::New(isolate)*/): void; + + /** + * + * @brief 加载一个模块并返回模块对象,更多信息参阅 @ref module + * + * require 可用于加载基础模块,文件模块。 + * + * 基础模块是沙箱创建时初始化的模块,引用时只需传递相应的 id,比如 require("net")。 + * + * 文件模块是用户自定义模块,引用时需传递以 ./ 或 ../ 开头的相对路径。文件模块支持 .js, .jsc 和 .json 文件。 + * + * 文件模块也支持 package.json 格式,当模块为目录结构时,require 会先查询 package.json 中的 main,未发现则尝试加载路径下的 index.js, index.jsc 或 index.json。 + * + * 若引用路径不是 ./ 或 ../ 开头,并且非基础模块,require 从当前模块所在路径下的 node_modules 查找,并上级目录递归。 + * + * 基础流程如下: + * + * ```dot + * digraph{ + * node [fontname = "Helvetica,sans-Serif", fontsize = 10]; + * edge [fontname = "Helvetica,sans-Serif", fontsize = 10]; + * + * start [label="起始"]; + * resolve [label="path.resolve" shape="rect"]; + * search [label="从当前路径\n向上递归查找\nnode_modules" shape="rect"]; + * load [label="加载" shape="rect"]; + * end [label="返回" shape="doublecircle"]; + * + * is_native [label="内置模块?" shape="diamond"]; + * is_mod [label="模块?" shape="diamond"]; + * is_abs [label="绝对路径?" shape="diamond"]; + * has_file [label="原名存在?" shape="diamond"]; + * has_ext [label="增加 .js 存在?" shape="diamond"]; + * has_package [label="/package.json\n存在?" shape="diamond"]; + * has_main [label="main 存在?" shape="diamond"]; + * has_index [label="index.js 存在?" shape="diamond"]; + * + * start -> is_native; + * is_native -> end [label="是"]; + * is_native -> is_mod [label="否"]; + * is_mod -> search [label="是"]; + * search -> has_file; + * is_mod -> is_abs [label="否"]; + * is_abs -> has_file [label="是"]; + * is_abs -> resolve [label="否"]; + * resolve -> has_file; + * has_file -> load [label="是"]; + * has_file -> has_ext [label="否"]; + * has_ext -> load [label="是"]; + * has_ext -> has_package [label="否"]; + * has_package -> has_main [label="是"]; + * has_package -> has_index [label="否"]; + * has_main -> load [label="是"]; + * has_main -> has_index [label="否"]; + * has_index -> load [label="是"]; + * has_index -> end [label="否"]; + * load -> end; + * } + * ``` + * + * @param id 指定要加载的模块名称 + * @return 返回加载模块的引出对象 + * + * + * + */ + export function require(id: string): any; + + /** + * + * @brief 在指定的时间后调用函数 + * @param callback 指定回调函数 + * @param timeout 指定延时的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearTimeout(t: any): void; + + /** + * + * @brief 每间隔指定的时间后调用函数 + * @param callback 指定回调函数 + * @param timeout 指定间隔的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setInterval(callback: Function, timeout: number, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearInterval(t: any): void; + + /** + * + * @brief 每间隔指定的时间后调用函数,这是个高精度定时器,会主动打断正在运行的 JavaScript 脚本执行定时器 + * 由于 setHrInterval 的定时器会中断正在运行的代码执行回调,因此不要在回调函数内修改可能影响其它模块的数据,或者在回调中调用任何标记为 async 的 api 函数,否则将会产生不可预知的结果。例如: + * ```JavaScript + * var timers = require('timers'); + * + * var cnt = 0; + * timers.setHrInterval(() => { + * cnt++; + * }, 100); + * + * while (cnt < 10); + * + * console.error("===============================> done"); + * ``` + * 这段代码中,第 8 行的循环并不会因为 cnt 的改变而结束,因为 JavaScript 在优化代码时会认定在这个循环过程中 cnt 不会被改变。 + * @param callback 指定回调函数 + * @param timeout 指定间隔的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setHrInterval(callback: Function, timeout: number, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearHrInterval(t: any): void; + + /** + * + * @brief 下一个空闲时间立即执行回调函数 + * @param callback 指定回调函数 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setImmediate(callback: Function, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearImmediate(t: any): void; + + /** + * + * @brief 强制要求进行垃圾回收 + * + * + */ + export function GC(): void; + + /** + * + * @brief 进入交互模式,可以交互执行内部命令和代码,仅在启动 js 可以引用 + * + * 参数 cmd 格式如下: + * ```JavaScript + * [ + * { + * cmd: ".test", + * help: "this is a test", + * exec: function(argv) { + * console.log(argv); + * } + * }, + * { + * cmd: ".test1", + * help: "this is an other test", + * exec: function(argv) { + * console.log(argv); + * } + * } + * ] + * ``` + * @param cmds 补充命令 + * + * + * + */ + export function repl(cmds?: any[]/** = v8::Array::New(isolate)*/): void; + + /** + * + * @brief 进入交互模式,可以交互执行内部命令和代码,仅在启动 js 可以引用 + * + * 同一时刻只允许一个 Stream repl,新建一个 Stream repl 时,前一个 repl 将被关闭。 + * + * 参数 cmd 格式如下: + * ```JavaScript + * [ + * { + * cmd: ".test", + * help: "this is a test", + * exec: function(argv) { + * console.log(argv); + * } + * }, + * { + * cmd: ".test1", + * help: "this is an other test", + * exec: function(argv) { + * console.log(argv); + * } + * } + * ] + * ``` + * @param out 输入输出流对象,通常为网络连接 + * @param cmds 补充命令 + * + * + * + */ + export function repl(out: Class_Stream, cmds?: any[]/** = v8::Array::New(isolate)*/): void; + + } /** end of `module global` */ + export = global +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/gui.d.ts b/types/fibjs/declare/gui.d.ts new file mode 100644 index 0000000000..60768a9d93 --- /dev/null +++ b/types/fibjs/declare/gui.d.ts @@ -0,0 +1,304 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief gui 模块 + * @detail 使用方法:,```JavaScript,var gui = require('gui');,``` + */ +declare module "gui" { + + + module gui { + + /** + * + * @brief WebView ie 模拟版本,指定 ie7 + * + * + */ + export const IE7 = 7000; + + /** + * + * @brief WebView ie 模拟版本,指定 ie8 + * + * + */ + export const IE8 = 8000; + + /** + * + * @brief WebView ie 模拟版本,指定 ie9 + * + * + */ + export const IE9 = 9000; + + /** + * + * @brief WebView ie 模拟版本,指定 ie10 + * + * + */ + export const IE10 = 10000; + + /** + * + * @brief WebView ie 模拟版本,指定 ie11 + * + * + */ + export const IE11 = 11000; + + /** + * + * @brief WebView ie 模拟版本,指定 edge + * + * + */ + export const EDGE = 11001; + + + + + + /** + * + * 设置 WebView 内 ie 最高模拟版本,当系统 ie 版本低于此版本时,将模拟系统安装版本 + * @param ver 指定 ie 模拟版本 + * + * + * + */ + export function setVersion(ver: number): void; + + /** + * + * @brief 打开一个窗口并访问指定网址 + * + * 支持以下参数: + * ```JavaScript + * { + * "left": 100, // 窗口左上角 x,缺省系统自动设定 + * "right": 100, // 窗口左上角 y,缺省系统自动设定 + * "width": 100, // 窗口宽度,缺省系统自动设定 + * "height": 100, // 窗口高度,缺省系统自动设定 + * "border": true, // 是否有边框,缺省有边框 + * "caption": true, // 是否有标题栏,缺省有标题栏 + * "resizable": true, // 是否可改变尺寸,缺省可以改变 + * "maximize": false, // 是否最大化显示,缺省不最大化 + * "visible": true, // 是否显示,缺省显示 + * "debug": true // 是否输出 WebView 内的错误和 console 信息,缺省显示 + * } + * ``` + * 当设定 width 和 height,而未设定 left 或 right 时,窗口将自动居中 + * @param url 指定的网址,,可以使用 fs:path 访问本地文件系统 + * @param opt 打开窗口参数 + * @return 返回打开的窗口对象 + * + * + * + */ + export function open(url: string, opt?: object/** = v8::Object::New(isolate)*/): Class_WebView; + + } /** end of `module gui` */ + export = gui +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/hash.d.ts b/types/fibjs/declare/hash.d.ts new file mode 100644 index 0000000000..a51aa76e34 --- /dev/null +++ b/types/fibjs/declare/hash.d.ts @@ -0,0 +1,522 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 信息摘要计算模块,可用于计算信息摘要和摘要签名 + * @detail + */ +declare module "hash" { + + + module hash { + + /** + * + * @brief MD2 信息摘要算法标识常量 + * + * + */ + export const MD2 = 1; + + /** + * + * @brief MD4 信息摘要算法标识常量 + * + * + */ + export const MD4 = 2; + + /** + * + * @brief MD5 信息摘要算法标识常量 + * + * + */ + export const MD5 = 3; + + /** + * + * @brief SHA1 信息摘要算法标识常量 + * + * + */ + export const SHA1 = 4; + + /** + * + * @brief SHA224 信息摘要算法标识常量 + * + * + */ + export const SHA224 = 5; + + /** + * + * @brief SHA256 信息摘要算法标识常量 + * + * + */ + export const SHA256 = 6; + + /** + * + * @brief SHA384 信息摘要算法标识常量 + * + * + */ + export const SHA384 = 7; + + /** + * + * @brief SHA512 信息摘要算法标识常量 + * + * + */ + export const SHA512 = 8; + + /** + * + * @brief RIPEMD160 信息摘要算法标识常量 + * + * + */ + export const RIPEMD160 = 9; + + + + + + /** + * + * @brief 根据指定的算法标识创建一个信息摘要运算对象 + * @param algo 指定摘要运算算法 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function digest(algo: number, data: Class_Buffer): Class_Digest; + + /** + * + * @brief 根据指定的算法标识创建一个信息摘要运算对象 + * @param algo 指定摘要运算算法 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function digest(algo: number): Class_Digest; + + /** + * + * @brief 创建一个 MD2 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function md2(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 MD4 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function md4(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 MD5 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function md5(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA1 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function sha1(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA224 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function sha224(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA256 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function sha256(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA384 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function sha384(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA512 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function sha512(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 RIPEMD160 信息摘要运算对象 + * @param data 创建同时更新的二进制数据 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function ripemd160(data: Class_Buffer): Class_Digest; + + /** + * + * @brief 根据指定的算法标识创建一个信息摘要签名运算对象 + * @param algo 指定摘要运算算法 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac(algo: number, key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 MD2 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_md2(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 MD4 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_md4(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 MD5 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_md5(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA1 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_sha1(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA224 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_sha224(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA256 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_sha256(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA384 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_sha384(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 SHA512 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_sha512(key: Class_Buffer): Class_Digest; + + /** + * + * @brief 创建一个 RIPEMD160 信息摘要签名运算对象 + * @param key 二进制签名密钥 + * @return 返回构造的信息摘要对象 + * + * + * + */ + export function hmac_ripemd160(key: Class_Buffer): Class_Digest; + + } /** end of `module hash` */ + export = hash +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/hex.d.ts b/types/fibjs/declare/hex.d.ts new file mode 100644 index 0000000000..a8254c6de6 --- /dev/null +++ b/types/fibjs/declare/hex.d.ts @@ -0,0 +1,239 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief hex 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var hex = encoding.hex;,```,或者,```JavaScript,var hex = require('hex');,``` + */ +declare module "hex" { + + + module hex { + + + + + + /** + * + * @brief 以 hex 方式编码数据 + * @param data 要编码的数据 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: Class_Buffer): string; + + /** + * + * @brief 以 hex 方式解码字符串为二进制数据 + * @param data 要解码的字符串 + * @return 返回解码的二进制数据 + * + * + * + */ + export function decode(data: string): Class_Buffer; + + } /** end of `module hex` */ + export = hex +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/http.d.ts b/types/fibjs/declare/http.d.ts new file mode 100644 index 0000000000..000f4a6b79 --- /dev/null +++ b/types/fibjs/declare/http.d.ts @@ -0,0 +1,513 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 超文本传输协议模块,用以支持 http 协议处理,模块别名:https + * @detail + */ +declare module "http" { + + + module http { + + + /** + * + * @brief 返回标准的 HTTP 响应状态码的集合,以及各自的简短描述。 + * + * + */ + export const STATUS_CODES: any[]; + + /** + * + * @brief 返回http客户端的 HttpCookie 对象列表 + * + * + */ + export const cookies: any[]; + + /** + * + * @brief 查询和设置超时时间 + * + * + */ + export const timeout: number; + + /** + * + * @brief cookie功能开关,默认开启 + * + * + */ + export const enableCookie: boolean; + + /** + * + * @brief 自动redirect功能开关,默认开启 + * + * + */ + export const autoRedirect: boolean; + + /** + * + * @brief 查询和设置 body 最大尺寸,以 MB 为单位,缺省为 -1,不限制尺寸 + * + * + */ + export const maxBodySize: number; + + /** + * + * @brief 查询和设置 http 请求中的浏览器标识 + * + * + */ + export const userAgent: string; + + /** + * + * @brief 查询和设置 keep-alive 最大缓存连接数,缺省 128 + * + * + */ + export const poolSize: number; + + /** + * + * @brief 查询和设置 keep-alive 缓存连接超时时间,缺省 10000 ms + * + * + */ + export const poolTimeout: number; + + + /** + * + * @brief 创建一个 http 请求对象,参见 HttpRequest + * + * + */ + export class Request extends Class_HttpRequest {} + + + /** + * + * @brief 创建一个 http 响应对象,参见 HttpResponse + * + * + */ + export class Response extends Class_HttpResponse {} + + + /** + * + * @brief 创建一个 http cookie 对象,参见 HttpCookie + * + * + */ + export class Cookie extends Class_HttpCookie {} + + + /** + * + * @brief 创建一个 http 服务器,参见 HttpServer + * + * + */ + export class Server extends Class_HttpServer {} + + + /** + * + * @brief 创建一个 http 客户端,参见 HttpClient + * + * + */ + export class Client extends Class_HttpClient {} + + + /** + * + * @brief 创建一个 https 服务器,参见 HttpsServer + * + * + */ + export class HttpsServer extends Class_HttpsServer {} + + + /** + * + * @brief 创建一个 http 协议处理器对象,参见 HttpHandler + * + * + */ + export class Handler extends Class_HttpHandler {} + + + + + /** + * + * @brief 创建一个 http 静态文件处理器,用以用静态文件响应 http 消息 + * + * fileHandler 支持 gzip 预压缩,当请求接受 gzip 编码,且相同路径下 filename.ext.gz 文件存在时,将直接返回此文件, + * 从而避免重复压缩带来服务器负载。 + * @param root 文件根路径 + * @param mimes 扩展 mime 设置 + * @param autoIndex 是否支持浏览目录文件,缺省为 false,不支持 + * @return 返回一个静态文件处理器用于处理 http 消息 + * + * + * + */ + export function fileHandler(root: string, mimes?: object/** = v8::Object::New(isolate)*/, autoIndex?: boolean/** = false*/): Class_Handler; + + /** + * + * @brief 发送 http 请求到指定的流对象,并返回结果 + * @param conn 指定处理请求的流对象 + * @param req 要发送的 HttpRequest 对象 + * @return 返回服务器响应 + * + * + * @async + */ + export function request(conn: Class_Stream, req: Class_HttpRequest): Class_HttpResponse; + + /** + * + * @brief 请求指定的 url,并返回结果 + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param method 指定 http 请求方法:GET, POST 等 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function request(method: string, url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 GET 方法请求指定的 url,并返回结果,等同于 request("GET", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function get(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 POST 方法请求指定的 url,并返回结果,等同于 request("POST", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function post(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 DELETE 方法请求指定的 url,并返回结果,等同于 request("DELETE", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function del(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 PUT 方法请求指定的 url,并返回结果,等同于 request("PUT", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function put(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + /** + * + * @brief 用 PATCH 方法请求指定的 url,并返回结果,等同于 request("PATCH", ...) + * opts 包含请求的附加选项,支持的内容如下: + * ```JavaScript + * { + * "query": {}, + * "body": SeekedStream | Buffer | String | {}, + * "json": {}, + * "headers": {} + * } + * ``` + * 其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息 + * @param url 指定 url,必须是包含主机的完整 url + * @param opts 指定附加信息 + * @return 返回服务器响应 + * + * + * @async + */ + export function patch(url: string, opts?: object/** = v8::Object::New(isolate)*/): Class_HttpResponse; + + } /** end of `module http` */ + export = http +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/iconv.d.ts b/types/fibjs/declare/iconv.d.ts new file mode 100644 index 0000000000..443ae25e21 --- /dev/null +++ b/types/fibjs/declare/iconv.d.ts @@ -0,0 +1,252 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief iconv 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var iconv = encoding.iconv;,```,或者,```JavaScript,var iconv = require('iconv');,``` + */ +declare module "iconv" { + + + module iconv { + + + + + + /** + * + * @brief 用 iconv 将文本转换为二进制数据 + * @param charset 指定字符集 + * @param data 要转换的文本 + * @return 返回解码的二进制数据 + * + * + * + */ + export function encode(charset: string, data: string): Class_Buffer; + + /** + * + * @brief 用 iconv 将 Buffer 内容转换为文本 + * @param charset 指定字符集 + * @param data 要转换的二进制数据 + * @return 返回编码的字符串 + * + * + * + */ + export function decode(charset: string, data: Class_Buffer): string; + + /** + * + * @brief 检测字符集是否被支持 + * @param charset 指定字符集 + * @return 返回是否支持该字符集 + * + * + * + */ + export function isEncoding(charset: string): boolean; + + } /** end of `module iconv` */ + export = iconv +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/index.d.ts b/types/fibjs/declare/index.d.ts new file mode 100644 index 0000000000..df0e02e683 --- /dev/null +++ b/types/fibjs/declare/index.d.ts @@ -0,0 +1,101 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +import _Global from 'global'; +import _Process from 'process'; + +type GlobalExportsType = any; +interface ModuleType { + exports: GlobalExportsType; +} + +declare global { + var exports: GlobalExportsType; + const module: ModuleType; + + const Buffer: typeof _Global.Buffer + const Int64: typeof _Global.Int64 + /** const console: console; */ + const process: typeof _Global.process + const Master: typeof _Global.Master + const global: typeof _Global.global + /** const run: null; */ + const require: typeof _Global.require + const argv: typeof _Global.argv + const __filename: typeof _Global.__filename + const __dirname: typeof _Global.__dirname + /** const setTimeout: Timer; */ + /** const clearTimeout: null; */ + /** const setInterval: Timer; */ + /** const clearInterval: null; */ + const setHrInterval: typeof _Global.setHrInterval + const clearHrInterval: typeof _Global.clearHrInterval + /** const setImmediate: Timer; */ + /** const clearImmediate: null; */ + const GC: typeof _Global.GC + const repl: typeof _Global.repl +} /** end of `declare global` */ + + diff --git a/types/fibjs/declare/io.d.ts b/types/fibjs/declare/io.d.ts new file mode 100644 index 0000000000..ff9f884f28 --- /dev/null +++ b/types/fibjs/declare/io.d.ts @@ -0,0 +1,259 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 输入输出处理模块 + * @detail 使用方法:,```JavaScript,var io = require('io');,``` + */ +declare module "io" { + + + module io { + + + + /** + * + * @brief 创建一个内存流对象,参见 MemoryStream + * + * + */ + export class MemoryStream extends Class_MemoryStream {} + + + /** + * + * @brief 创建一个缓存流读取对象,参见 BufferedStream + * + * + */ + export class BufferedStream extends Class_BufferedStream {} + + + + + /** + * + * @brief 复制流数据到目标流中 + * @param from 源流对象 + * @param to 目标流对象 + * @param bytes 复制的字节数 + * @return 返回复制的字节数 + * + * + * @async + */ + export function copyStream(from: Class_Stream, to: Class_Stream, bytes?: number/** = -1*/): number; + + /** + * + * @brief 双向复制流数据,直到流中无数据,或者流被关闭 + * @param stm1 流对象一 + * @param stm2 流对象二 + * + * + * @async + */ + export function bridge(stm1: Class_Stream, stm2: Class_Stream): void; + + } /** end of `module io` */ + export = io +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/json.d.ts b/types/fibjs/declare/json.d.ts new file mode 100644 index 0000000000..f90b2d9a4b --- /dev/null +++ b/types/fibjs/declare/json.d.ts @@ -0,0 +1,239 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief json 编码与解码模块 + * @detail 引用方式:,```JavaScript,var encoding = require('encoding');,var json = encoding.json;,```,或者,```JavaScript,var json = require('json');,``` + */ +declare module "json" { + + + module json { + + + + + + /** + * + * @brief 以 json 格式编码变量 + * @param data 要编码的变量 + * @return 返回编码的字符串 + * + * + * + */ + export function encode(data: any): string; + + /** + * + * @brief 以 json 方式解码字符串为一个变量 + * @param data 要解码的字符串 + * @return 返回解码的变量 + * + * + * + */ + export function decode(data: string): any; + + } /** end of `module json` */ + export = json +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/mq.d.ts b/types/fibjs/declare/mq.d.ts new file mode 100644 index 0000000000..4f2af5d198 --- /dev/null +++ b/types/fibjs/declare/mq.d.ts @@ -0,0 +1,307 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 消息队列模块 + * @detail + */ +declare module "mq" { + + + module mq { + + + + /** + * + * @brief 创建一个消息对象,参见 Message + * + * + */ + export class Message extends Class_Message {} + + + /** + * + * @brief 创建一个 http 协议处理器对象,参见 HttpHandler + * + * + */ + export class HttpHandler extends Class_HttpHandler {} + + + /** + * + * @brief 创建一个消息处理器对象,传递值内置处理器则直接返回 + * + * hdlr 接受内置消息处理器,处理函数,链式处理数组,路由对象: + * - Function javascript 函数,将使用此函数进行处理 + * - Handler 内置处理器,将使用此处理器进行处理 + * - 链式处理数组,等同于返回 new mq.Chain(hdlr),参见 Chain + * - 路由对象,等同于返回 new mq.Routing(hdlr),参见 Routing + * + * 消息处理函数语法如下: + * ```JavaScript + * function func(v){ + * } + * ``` + * 参数 v 为正在处理的消息,返回结果允许有四种: + * - Function javascript 函数,将使用此函数进行下一阶段处理 + * - Handler 内置处理器,将使用此处理器进行下一阶段处理 + * - 链式处理数组,等同于 new mq.Chain(v),参见 Chain + * - 路由对象,等同于 new mq.Routing(v),参见 Routing + * + * 无返回或者其他的返回结果将结束消息处理。 + * @param hdlr 内置消息处理器,处理函数,链式处理数组,路由对象 + * @return 返回封装了处理函数的处理器 + * + * + * + */ + export class Handler extends Class_Handler {} + + + /** + * + * @brief 创建一个消息处理器链处理对象,参见 Chain + * + * + */ + export class Chain extends Class_Chain {} + + + /** + * + * @brief 创建一个消息处理器路由对象,参见 Routing + * + * + */ + export class Routing extends Class_Routing {} + + + + + /** + * + * @brief 创建一个空处理器对象,次处理对象不做任何处理直接返回 + * @return 返回空处理函数 + * + * + * + */ + export function nullHandler(): Class_Handler; + + /** + * + * @brief 使用给定的处理器处理一个消息或对象 + * + * 不同于处理器的 invoke 方法,此方法将循环调用每个处理器的返回处理器,直到处理器返回 null 为止。 + * @param hdlr 指定使用的处理器 + * @param v 指定要处理的消息或对象 + * + * + * @async + */ + export function invoke(hdlr: Class_Handler, v: Class__object): void; + + } /** end of `module mq` */ + export = mq +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/net.d.ts b/types/fibjs/declare/net.d.ts new file mode 100644 index 0000000000..8c2bf58055 --- /dev/null +++ b/types/fibjs/declare/net.d.ts @@ -0,0 +1,396 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 网络访问模块 + * @detail 基础模块。可用于创建和操作网络资源,引用方式:,```JavaScript,var net = require('net');,``` + */ +declare module "net" { + + + module net { + + /** + * + * @brief 地址集常量,指定 ipv4 + * + * + */ + export const AF_INET = 2; + + /** + * + * @brief 地址集常量,指定 ipv6 + * + * + */ + export const AF_INET6 = 10; + + /** + * + * @brief 协议族常量,指定 tcp + * + * + */ + export const SOCK_STREAM = 1; + + /** + * + * @brief 协议族常量,指定 udp + * + * + */ + export const SOCK_DGRAM = 2; + + + + /** + * + * @brief 创建一个 Socket 对象,参见 Socket + * + * + */ + export class Socket extends Class_Socket {} + + + /** + * + * @brief 创建一个 Smtp 对象,参见 Smtp + * + * + */ + export class Smtp extends Class_Smtp {} + + + /** + * + * @brief 创建一个 TcpServer 对象,参见 TcpServer + * + * + */ + export class TcpServer extends Class_TcpServer {} + + + /** + * + * @brief 创建一个 UrlObject 对象,参见 UrlObject + * + * + */ + export class Url extends Class_UrlObject {} + + + + + /** + * + * @brief 查询当前运行环境网络信息 + * @return 返回网卡信息 + * + * + * + */ + export function info(): object; + + /** + * + * @brief 查询给定的主机名的地址 + * @param name 指定主机名 + * @param family 指定查询返回类型,缺省为 AF_INET + * @return 返回查询的 ip 字符串 + * + * + * @async + */ + export function resolve(name: string, family?: number/** = undefined*/): string; + + /** + * + * @brief 快速查询的主机地址,等效与 resolve(name) + * @param name 指定主机名 + * @return 返回查询的 ip 字符串 + * + * + * @async + */ + export function ip(name: string): string; + + /** + * + * @brief 快速查询的主机 ipv6 地址,等效与 resolve(name, net.AF_INET6) + * @param name 指定主机名 + * @return 返回查询的 ipv6 字符串 + * + * + * @async + */ + export function ipv6(name: string): string; + + /** + * + * @brief 创建一个 Socket 或 SslSocket 对象并建立连接 + * @param url 指定连接的协议,可以是:tcp://host:port 或者 ssl://host:port + * @param timeout 指定超时时间,单位是毫秒,默认为0 + * @return 返回连接成功的 Socket 或者 SslSocket 对象 + * + * + * @async + */ + export function connect(url: string, timeout?: number/** = 0*/): Class_Stream; + + /** + * + * @brief 创建一个 Smtp 对象并建立连接,参见 Smtp + * @param url 指定连接的协议,可以是:tcp://host:port 或者 ssl://host:port + * @param timeout 指定超时时间,单位是毫秒,默认为0 + * @return 返回连接成功的 Smtp 对象 + * + * + * @async + */ + export function openSmtp(url: string, timeout?: number/** = 0*/): Class_Smtp; + + /** + * + * @brief 查询当前系统异步网络引擎 + * @return 返回网络引擎名称 + * + * + * + */ + export function backend(): string; + + /** + * + * @brief 检测输入是否是 IP 地址 + * @param ip 指定要检测的字符串 + * @return 非合法的 IP 地址,返回 0, 如果是 IPv4 则返回 4,如果是 IPv6 则返回 6 + * + * + * + */ + export function isIP(ip?: string/** = ""*/): number; + + /** + * + * @brief 检测输入是否是 IPv4 地址 + * @param ip 指定要检测的字符串 + * @return 如果是 IPv4 则返回 true.否则返回 false + * + * + * + */ + export function isIPv4(ip?: string/** = ""*/): boolean; + + /** + * + * @brief 检测输入是否是 IPv6 地址 + * @param ip 指定要检测的字符串 + * @return 如果是 IPv6 则返回 true.否则返回 false + * + * + * + */ + export function isIPv6(ip?: string/** = ""*/): boolean; + + } /** end of `module net` */ + export = net +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/object.d.ts b/types/fibjs/declare/object.d.ts new file mode 100644 index 0000000000..6c1b2019e0 --- /dev/null +++ b/types/fibjs/declare/object.d.ts @@ -0,0 +1,54 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/** module Or Internal Object */ +/** + * @brief 基础对象,所有对象均继承于此 + * @detail + */ + +declare class Class__object { + + + + /** + * + * @brief 返回对象的字符串表示,一般返回 "[Native Object]",对象可以根据自己的特性重新实现 + * @return 返回对象的字符串表示 + * + * + * + */ + toString(): string; + + /** + * + * @brief 返回对象的 JSON 格式表示,一般返回对象定义的可读属性集合 + * @param key 未使用 + * @return 返回包含可 JSON 序列化的值 + * + * + * + */ + toJSON(key?: string/** = ""*/): any; + +} /** endof class */ + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/os.d.ts b/types/fibjs/declare/os.d.ts new file mode 100644 index 0000000000..977fc4c6ce --- /dev/null +++ b/types/fibjs/declare/os.d.ts @@ -0,0 +1,481 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 操作系统与文件系统处理模块 + * @detail 使用方法:,```JavaScript,var os = require('os');,``` + */ +declare module "os" { + + + module os { + + + /** + * + * @brief 查询运行环境当前时区 + * + * + */ + export const timezone: number; + + /** + * + * @brief 查询当前运行环境行结尾标识,posix:\"\\n\";windows:\"\\r\\n\" + * + * + */ + export const EOL: string; + + /** + * + * @brief 查询当前运行执行文件完整路径 + * + * + */ + export const execPath: string; + + + /** + * + * @brief Service 构造函数,参见 Service + * + * + */ + export class Service extends Class_Service {} + + + + + /** + * + * @brief 查询当前运行环境主机名 + * @return 返回主机名 + * + * + * + */ + export function hostname(): string; + + /** + * + * @brief 查询当前 CPU 的字节顺序 + * @return 返回字节顺序 + * + * + * + */ + export function endianness(): string; + + /** + * + * @brief 查询当前运行环境操作系统名称 + * @return 返回系统名称 + * + * + * + */ + export function type(): string; + + /** + * + * @brief 查询当前运行环境操作系统版本 + * @return 返回版本信息 + * + * + * + */ + export function release(): string; + + /** + * + * @brief 查询当前用户目录 + * @return 返回目录字符串 + * + * + * + */ + export function homedir(): string; + + /** + * + * @brief 查询当前 cpu 环境 + * @return 返回 cpu 类型,可能的结果为 'amd64', 'arm', 'arm64', 'ia32' + * + * + * + */ + export function arch(): string; + + /** + * + * @brief 查询运行环境运行时间,以秒为单位 + * @return 返回表示时间的数值 + * + * + * + */ + export function uptime(): number; + + /** + * + * @brief 查询运行环境 1分钟,5分钟,15分钟平均负载 + * @return 返回包含三个负载数据的数组 + * + * + * + */ + export function loadavg(): any[]; + + /** + * + * @brief 查询运行环境总内存,以字节为单位 + * @return 返回内存数据 + * + * + * + */ + export function totalmem(): number; + + /** + * + * @brief 查询运行环境可用内存,以字节为单位 + * @return 返回内存数据 + * + * + * + */ + export function freemem(): number; + + /** + * + * @brief 查询当前运行环境 cpu 个数和参数 + * @return 返回包含 cpu 参数的数组,每一项对应一个 cpu + * + * + * + */ + export function cpus(): any[]; + + /** + * + * @brief 查询当前运行环境 cpu 个数 + * @return 返回 cpu 个数 + * + * + * + */ + export function cpuNumbers(): number; + + /** + * + * @brief 查询当前运行环境临时文件目录 + * @return 返回临时文件目录 + * + * + * + */ + export function tmpdir(): string; + + /** + * + * @brief 返回当前有效执行用户信息 + * @param options 用于解释结果字符串的字符编码 + * @return 当前有效执行用户信息 + * + * + * + */ + export function userInfo(options?: object/** = v8::Object::New(isolate)*/): object; + + /** + * + * @brief 查询当前运行环境网络信息 + * @return 返回网卡信息 + * + * + * + */ + export function networkInterfaces(): object; + + /** + * + * @brief 查询当前主机的打印机信息 + * @return 返回打印机信息 + * + * + * + */ + export function printerInfo(): any[]; + + /** + * + * @brief 创建一个打印机输出对象 + * @param name 打印机名称 + * @return 返回打印机输出对象 + * + * + * @async + */ + export function openPrinter(name: string): Class_BufferedStream; + + /** + * + * @brief 查询当前平台名称 + * @return 返回平台名称,可能的结果为 'darwin', 'freebsd', 'linux', 或 'win32' + * + * + * + */ + export function platform(): string; + + /** + * + * @brief 解析时间字符串或查询运行环境当前时间 + * @param tmString 时间字符串,缺省则查询当前时间 + * @return 返回 javascript Date 对象 + * + * + * + */ + export function time(tmString?: string/** = ""*/): Date; + + /** + * + * @brief 时间计算函数,根据 part 指定计算时间 + * @param d 指定用于计算 Date 对象 + * @param num 指定运算的数值 + * @param part 指定运算的时间部位,接收值为:"year", "month", "day", "hour", "minute", "second" + * @return 返回 javascript Date 对象 + * + * + * + */ + export function dateAdd(d: Date, num: number, part: string): Date; + + /** + * + * @brief 查询当前进程内存使用报告 + * + * 内存报告生成类似以下结果: + * ```JavaScript + * { + * "rss": 8622080, + * "heapTotal": 4083456, + * "heapUsed": 1621800, + * "nativeObjects": 122 + * } + * ``` + * 其中: + * - rss 返回进程当前占用物理内存大小 + * - heapTotal 返回 v8 引擎堆内存大小 + * - heapUsed 返回 v8 引擎正在使用堆内存大小 + * - nativeObjects 返回当前有效内置对象数 + * @return 返回包含内存报告 + * + * + * + */ + export function memoryUsage(): object; + + } /** end of `module os` */ + export = os +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/path.d.ts b/types/fibjs/declare/path.d.ts new file mode 100644 index 0000000000..9b6ae9cfec --- /dev/null +++ b/types/fibjs/declare/path.d.ts @@ -0,0 +1,375 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 文件路径处理模块 + * @detail 引用方法:,```JavaScript,var path = require('path');,``` + */ +declare module "path" { + + + module path { + + + /** + * + * @brief 查询当前操作系统的路径分割字符,posix 返回 '/', windows 返回 '\\' + * + * + * + */ + export const sep: string; + + /** + * + * @brief 查询当前操作系统的多路径组合字符,posix 返回 ':', windows 返回 ';' + * + * + * + */ + export const delimiter: string; + + /** + * + * @brief posix 实现,参见 path_posix + * + * + * + */ + export const posix: Object; + + /** + * + * @brief windows 实现,参见 path_win32 + * + * + * + */ + export const win32: Object; + + + + + /** + * + * @brief 标准化路径,处理路径中父目录等信息 + * + * @param path 给定的未处理的路径 + * @return 返回经过处理的路径 + * + * + * + */ + export function normalize(path: string): string; + + /** + * + * @brief 查询路径中的文件名称,若指定扩展名,则自动取消匹配的扩展名 + * + * @param path 给定查询的路径 + * @param ext 指定扩展名,若文件名中有符合条件的扩展名,将自动取消 + * @return 返回文件名称 + * + * + * + */ + export function basename(path: string, ext?: string/** = ""*/): string; + + /** + * + * @brief 查询路径中的文件扩展名 + * + * @param path 给定查询的路径 + * @return 返回得到的扩展名 + * + * + * + */ + export function extname(path: string): string; + + /** + * + * @brief 查询路径中的目录路径 + * + * @param path 给定查询的路径 + * @return 返回得到的目录的路径 + * + * + * + */ + export function dirname(path: string): string; + + /** + * + * @brief 转换给定路径为全路径 + * + * @param path 给定转换的路径 + * @return 返回转换的全路径 + * + * + * + */ + export function fullpath(path: string): string; + + /** + * + * @brief 识别给定的路径是否是绝对路径 + * + * @param path 给定需要识别的路径 + * @return 是绝对路径则返回 true + * + * + * + */ + export function isAbsolute(path: string): boolean; + + /** + * + * @brief 合并一系列路径成为一个单一路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function join(...ps: any[]): string; + + /** + * + * @brief 合并一系列路径成为一个绝对路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function resolve(...ps: any[]): string; + + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + + /** + * + * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 + * see: https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + * @param path 给定的路径。 + * @return 返回得到的新路径 + * + * + * + */ + export function toNamespacedPath(path?: any/** = v8::Undefined(isolate)*/): any; + + } /** end of `module path` */ + export = path +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/path_posix.d.ts b/types/fibjs/declare/path_posix.d.ts new file mode 100644 index 0000000000..bfeea21068 --- /dev/null +++ b/types/fibjs/declare/path_posix.d.ts @@ -0,0 +1,375 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 文件路径处理模块 + * @detail 引用方法:,```JavaScript,var path = require('path').posix;,``` + */ +declare module "path_posix" { + + + module path_posix { + + + /** + * + * @brief 查询当前操作系统的路径分割字符,posix 返回 '/', windows 返回 '\\' + * + * + * + */ + export const sep: string; + + /** + * + * @brief 查询当前操作系统的多路径组合字符,posix 返回 ':', windows 返回 ';' + * + * + * + */ + export const delimiter: string; + + /** + * + * @brief posix 实现,参见 path_posix + * + * + * + */ + export const posix: Object; + + /** + * + * @brief windows 实现,参见 path_win32 + * + * + * + */ + export const win32: Object; + + + + + /** + * + * @brief 标准化路径,处理路径中父目录等信息 + * + * @param path 给定的未处理的路径 + * @return 返回经过处理的路径 + * + * + * + */ + export function normalize(path: string): string; + + /** + * + * @brief 查询路径中的文件名称,若指定扩展名,则自动取消匹配的扩展名 + * + * @param path 给定查询的路径 + * @param ext 指定扩展名,若文件名中有符合条件的扩展名,将自动取消 + * @return 返回文件名称 + * + * + * + */ + export function basename(path: string, ext?: string/** = ""*/): string; + + /** + * + * @brief 查询路径中的文件扩展名 + * + * @param path 给定查询的路径 + * @return 返回得到的扩展名 + * + * + * + */ + export function extname(path: string): string; + + /** + * + * @brief 查询路径中的目录路径 + * + * @param path 给定查询的路径 + * @return 返回得到的目录的路径 + * + * + * + */ + export function dirname(path: string): string; + + /** + * + * @brief 转换给定路径为全路径 + * + * @param path 给定转换的路径 + * @return 返回转换的全路径 + * + * + * + */ + export function fullpath(path: string): string; + + /** + * + * @brief 识别给定的路径是否是绝对路径 + * + * @param path 给定需要识别的路径 + * @return 是绝对路径则返回 true + * + * + * + */ + export function isAbsolute(path: string): boolean; + + /** + * + * @brief 合并一系列路径成为一个单一路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function join(...ps: any[]): string; + + /** + * + * @brief 合并一系列路径成为一个绝对路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function resolve(...ps: any[]): string; + + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + + /** + * + * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 + * see: https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + * @param path 给定的路径。 + * @return 返回得到的新路径 + * + * + * + */ + export function toNamespacedPath(path?: any/** = v8::Undefined(isolate)*/): any; + + } /** end of `module path_posix` */ + export = path_posix +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/path_win32.d.ts b/types/fibjs/declare/path_win32.d.ts new file mode 100644 index 0000000000..25ce64db09 --- /dev/null +++ b/types/fibjs/declare/path_win32.d.ts @@ -0,0 +1,375 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 文件路径处理模块 + * @detail 引用方法:,```JavaScript,var path = require('path').win32;,``` + */ +declare module "path_win32" { + + + module path_win32 { + + + /** + * + * @brief 查询当前操作系统的路径分割字符,posix 返回 '/', windows 返回 '\\' + * + * + * + */ + export const sep: string; + + /** + * + * @brief 查询当前操作系统的多路径组合字符,posix 返回 ':', windows 返回 ';' + * + * + * + */ + export const delimiter: string; + + /** + * + * @brief posix 实现,参见 path_posix + * + * + * + */ + export const posix: Object; + + /** + * + * @brief windows 实现,参见 path_win32 + * + * + * + */ + export const win32: Object; + + + + + /** + * + * @brief 标准化路径,处理路径中父目录等信息 + * + * @param path 给定的未处理的路径 + * @return 返回经过处理的路径 + * + * + * + */ + export function normalize(path: string): string; + + /** + * + * @brief 查询路径中的文件名称,若指定扩展名,则自动取消匹配的扩展名 + * + * @param path 给定查询的路径 + * @param ext 指定扩展名,若文件名中有符合条件的扩展名,将自动取消 + * @return 返回文件名称 + * + * + * + */ + export function basename(path: string, ext?: string/** = ""*/): string; + + /** + * + * @brief 查询路径中的文件扩展名 + * + * @param path 给定查询的路径 + * @return 返回得到的扩展名 + * + * + * + */ + export function extname(path: string): string; + + /** + * + * @brief 查询路径中的目录路径 + * + * @param path 给定查询的路径 + * @return 返回得到的目录的路径 + * + * + * + */ + export function dirname(path: string): string; + + /** + * + * @brief 转换给定路径为全路径 + * + * @param path 给定转换的路径 + * @return 返回转换的全路径 + * + * + * + */ + export function fullpath(path: string): string; + + /** + * + * @brief 识别给定的路径是否是绝对路径 + * + * @param path 给定需要识别的路径 + * @return 是绝对路径则返回 true + * + * + * + */ + export function isAbsolute(path: string): boolean; + + /** + * + * @brief 合并一系列路径成为一个单一路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function join(...ps: any[]): string; + + /** + * + * @brief 合并一系列路径成为一个绝对路径 + * + * @param ps 一个或多个相关的路径 + * @return 返回得到的新路径 + * + * + * + */ + export function resolve(...ps: any[]): string; + + /** + * + * @brief 求 _from 到 to 的相对路径 + * + * @param _from 源路径 + * @param to 目标路径 + * @return 返回得到的相对路径 + * + * + * + */ + export function relative(_from: string, to: string): string; + + /** + * + * @brief 转换成 namespace-prefixed 路径。只在 windows 有效,其他系统直接返回。 + * see: https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + * @param path 给定的路径。 + * @return 返回得到的新路径 + * + * + * + */ + export function toNamespacedPath(path?: any/** = v8::Undefined(isolate)*/): any; + + } /** end of `module path_win32` */ + export = path_win32 +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/process.d.ts b/types/fibjs/declare/process.d.ts new file mode 100644 index 0000000000..1e6e1c8739 --- /dev/null +++ b/types/fibjs/declare/process.d.ts @@ -0,0 +1,561 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 进程处理模块,用以管理当前进程的资源 + * @detail 引用方法:,```JavaScript,var process = require('process');,```,,## 进程事件,process 模块对象是 EventEmitter 的实例,可以通过注册事件监听器响应进程级别的事件。,,### beforeExit 事件,**当 fibjs 的任务已经为空,并且没有额外的工作被添加进来,事件 `beforeExit` 会被触发**,```JavaScript,process.on('beforeExit', exitCode => {});,```,正常情况下,如果没有额外的工作被添加到任务队列,fibjs 进程会结束。但是如果 `beforeExit` 事件绑定的监听器的回调函数中,启动了一个新的任务,比如开启一个 fiber,那么 fibjs 进程会继续运行。,,process.exitCode 作为唯一的参数值传递给 `beforeExit` 事件监听器的回调函数。如果进程由于显式的原因而将要终止,例如直接调用 process.exit 或抛出未捕获的异常,`beforeExit`事件不会被触发。,,### exit 事件,**当 fibjs 退出时,事件 `exit` 会被触发,一旦所有与 `exit` 事件绑定的监听器执行完成,进程会终止**,```JavaScript,process.on('exit', exitCode => {});,```,`exit` 事件监听器的回调函数,只有一个入参,这个参数的值可以是 process.exitCode 的属性值,或者是调用 process.exit 方法时传入的 `exitCode` 值。,,### Signal 事件,**当 fibjs 进程接收到一个信号时,会触发信号事件,目前支持的信号有 SIGINT 和 SIGTERM。每个事件名称,以信号名称的大写表示 (比如事件'SIGINT' 对应信号 SIGINT)。**,,信号事件不同于其它进程事件,信号事件是抢占的,当信号发生时,无论当前在 io 操作,还是 JavaScript 运算,都会尽快触发相应事件。比如你可以用下面的代码,中断当前应用,并输出运行状态:,```JavaScript,var coroutine = require('coroutine');,,process.on('SIGINT', () => {, coroutine.fibers.forEach(f => console.error("Fiber %d:\n%s", f.id, f.stack));, process.exit();,});,```,信号名称及其意义如下:,* SIGINT:在终端运行时,可以被所有平台支持,通常可以通过 CTRL+C 触发。,* SIGTERM:当进程被 kill 时触发此信号。Windows 下不支持。 + */ +declare module "process" { + + + module process { + + + /** + * + * @brief 返回当前进程的命令行参数 + * + * + */ + export const argv: any[]; + + /** + * + * @brief 返回当前进程的特殊命令行参数,这些参数被 fibjs 用于设置运行环境 + * + * + */ + export const execArgv: any[]; + + /** + * + * @brief 返回 fibjs 版本字符串 + * + * + */ + export const version: string; + + /** + * + * @brief 返回 fibjs 及组件的版本信息 + * + * + */ + export const versions: Object; + + /** + * + * @brief 查询当前运行执行文件完整路径 + * + * + */ + export const execPath: string; + + /** + * + * @brief 查询当前进程的环境变量 + * + * + */ + export const env: Object; + + /** + * + * @brief 查询当前 cpu 环境,可能的结果为 'amd64', 'arm', 'arm64', 'ia32' + * + * + */ + export const arch: string; + + /** + * + * @brief 查询当前平台名称,可能的结果为 'darwin', 'freebsd', 'linux', 或 'win32' + * + * + */ + export const platform: string; + + /** + * + * @brief 查询当前进程标准输入对象 + * + * + */ + export const stdin: Class_File; + + /** + * + * @brief 查询当前进程标准输出对象 + * + * + */ + export const stdout: Class_File; + + /** + * + * @brief 查询当前进程标准错误输出对象 + * + * + */ + export const stderr: Class_File; + + /** + * + * @brief 查询和设置当前进程的退出码 + * + * + */ + export const exitCode: number; + + + + + /** + * + * @brief 改变当前的 umask,Windows 不支持此方法 + * @param mask 指定新的掩码 + * @return 返回之前的 mask + * + * + * + */ + export function umask(mask: number): number; + + /** + * + * @brief 改变当前的 umask,Windows 不支持此方法 + * @param mask 指定新的掩码, 字符串类型八进制(e.g: "0664") + * @return 返回之前的 mask + * + * + * + */ + export function umask(mask: string): number; + + /** + * + * @brief 返回当前的 umask,Windows 不支持此方法 + * @return 返回当前的 mask 值 + * + * + * + */ + export function umask(): number; + + /** + * + * @brief 返回系统高精度时间,此时间与当前时间无关,仅用于高精度计时 + * @param diff 用于比较的初始时间 + * @return 返回计时时间,格式为 [seconds, nanoseconds] + * + * + * + */ + export function hrtime(diff?: any[]/** = v8::Array::New(isolate)*/): any[]; + + /** + * + * @brief 退出当前进程,并返回 exitCode 作为进程结果 + * + * + */ + export function exit(): void; + + /** + * + * @brief 退出当前进程,并返回结果 + * @param code 返回进程结果 + * + * + * + */ + export function exit(code: number): void; + + /** + * + * @brief 返回操作系统当前工作路径 + * @return 返回当前系统路径 + * + * + * + */ + export function cwd(): string; + + /** + * + * @brief 修改操作系统当前工作路径 + * @param directory 指定设定的新路径 + * + * + * + */ + export function chdir(directory: string): void; + + /** + * + * @brief 查询运行环境运行时间,以秒为单位 + * @return 返回表示时间的数值 + * + * + * + */ + export function uptime(): number; + + /** + * + * @brief 查询当前进程内存使用报告 + * + * 内存报告生成类似以下结果: + * ```JavaScript + * { + * "rss": 8622080, + * "heapTotal": 4083456, + * "heapUsed": 1621800 + * } + * ``` + * 其中: + * - rss 返回进程当前占用物理内存大小 + * - heapTotal 返回 v8 引擎堆内存大小 + * - heapUsed 返回 v8 引擎正在使用堆内存大小 + * @return 返回包含内存报告 + * + * + * + */ + export function memoryUsage(): object; + + /** + * + * @brief 启动一个纤程 + * @param func 制定纤程执行的函数 + * @param args 可变参数序列,此序列会在纤程内传递给函数 + * + * + * + */ + export function nextTick(func: Function, ...args: any[]): void; + + /** + * + * @brief 运行指定的命令行,接管进程输入输出流,并返回进程对象 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param args 指定运行的参数列表 + * @param opts 指定运行的选项 + * @return 返回包含运行结果的进程对象 + * + * + * + */ + export function open(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; + + /** + * + * @brief 运行指定的命令行,接管进程输入输出流,并返回进程对象 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param opts 指定运行的选项 + * @return 返回包含运行结果的进程对象 + * + * + * + */ + export function open(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; + + /** + * + * @brief 运行指定的命令行,并返回进程对象 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param args 指定运行的参数列表 + * @param opts 指定运行的选项 + * @return 返回包含运行结果的进程对象 + * + * + * + */ + export function start(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; + + /** + * + * @brief 运行指定的命令行,并返回进程对象 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param opts 指定运行的选项 + * @return 返回包含运行结果的进程对象 + * + * + * + */ + export function start(command: string, opts?: object/** = v8::Object::New(isolate)*/): Class_SubProcess; + + /** + * + * @brief 运行指定的命令行,并返回进程的结束代码 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param args 指定运行的参数列表 + * @param opts 指定运行的选项 + * @return 返回命令的运行结果 + * + * + * + */ + export function run(command: string, args: any[], opts?: object/** = v8::Object::New(isolate)*/): number; + + /** + * + * @brief 运行指定的命令行,并返回进程的结束代码 + * + * opts 支持的选项如下: + * ```JavaScript + * { + * "timeout": 100, // 单位为 ms + * "envs": [] // 进程环境变量 + * } + * ``` + * @param command 指定运行的命令行 + * @param opts 指定运行的选项 + * @return 返回命令的运行结果 + * + * + * + */ + export function run(command: string, opts?: object/** = v8::Object::New(isolate)*/): number; + + } /** end of `module process` */ + export = process +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/profiler.d.ts b/types/fibjs/declare/profiler.d.ts new file mode 100644 index 0000000000..5d3459ddbb --- /dev/null +++ b/types/fibjs/declare/profiler.d.ts @@ -0,0 +1,440 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 内存 profiler 模块 + * @detail 使用方法:,```JavaScript,var profiler = require('profiler');,``` + */ +declare module "profiler" { + + + module profiler { + + /** + * + * @brief 隐藏节点,当显示给用户时可以被过滤掉 + * + * + */ + export const Node_Hidden = 0; + + /** + * + * @brief 数组 + * + * + */ + export const Node_Array = 1; + + /** + * + * @brief 字符串 + * + * + */ + export const Node_String = 2; + + /** + * + * @brief JS对象(字符串和数组除外) + * + * + */ + export const Node_Object = 3; + + /** + * + * @brief 编译后的代码 + * + * + */ + export const Node_Code = 4; + + /** + * + * @brief 函数闭包 + * + * + */ + export const Node_Closure = 5; + + /** + * + * @brief 正则表达式 + * + * + */ + export const Node_RegExp = 6; + + /** + * + * @brief 堆中排好序的数字 + * + * + */ + export const Node_HeapNumber = 7; + + /** + * + * @brief Native对象(非v8堆上的) + * + * + */ + export const Node_Native = 8; + + /** + * + * @brief Synthetic对象 + * + * + */ + export const Node_Synthetic = 9; + + /** + * + * @brief 拼接的字符串 + * + * + */ + export const Node_ConsString = 10; + + /** + * + * @brief 分割的字符串 + * + * + */ + export const Node_SlicedString = 11; + + /** + * + * @brief 符号(ES6) + * + * + */ + export const Node_Symbol = 12; + + /** + * + * @brief 堆中排好序的SIMD值(ES7) + * + * + */ + export const Node_SimdValue = 13; + + /** + * + * @brief 函数中的变量 + * + * + */ + export const Edge_ContextVariable = 0; + + /** + * + * @brief 数组中的元素 + * + * + */ + export const Edge_Element = 1; + + /** + * + * @brief 有名对象的属性 + * + * + */ + export const Edge_Property = 2; + + /** + * + * @brief JS无法进入的链接 + * + * + */ + export const Edge_Internal = 3; + + /** + * + * @brief 指向需要事先计算出空间大小的节点 + * + * + */ + export const Edge_Hidden = 4; + + /** + * + * @brief 指向无法事先计算出空间大小的节点 + * + * + */ + export const Edge_Shortcut = 5; + + /** + * + * @brief 一个弱引用(被GC忽视) + * + * + */ + export const Edge_Weak = 6; + + + + + + /** + * + * @brief 根据指定名称保存一个堆快照 + * @param fname 堆快照名称 + * + * + * + */ + export function saveSnapshot(fname: string): void; + + /** + * + * @brief 根据指定名称读取一个堆快照 + * @param fname 堆快照名称 + * @return 返回读取到的堆快照 + * + * + * + */ + export function loadSnapshot(fname: string): Class_HeapSnapshot; + + /** + * + * @brief 获取当前时间节点的堆快照,堆快照记录了当前时刻JS堆的状态 + * @return 返回获取到的堆信息快照 + * + * + * + */ + export function takeSnapshot(): Class_HeapSnapshot; + + /** + * + * @brief 执行给定的函数,并对比执行前后 v8 堆的变化 + * @param test 给定要测试的函数 + * @return 返回对比的结果 + * + * + * + */ + export function diff(test: Function): object; + + /** + * + * @brief 启动一次运行状态采样日志 + * @param fname 给定日志存储文件名 + * @param time 指定采样时间,缺省 1 分钟 + * @param interval 指定间隔时间,缺省 100 毫秒 + * @return 返回采样定时器,可以通过 clear 方法提前停止采样 + * + * + * + */ + export function start(fname: string, time?: number/** = 60000*/, interval?: number/** = 100*/): Class_Timer; + + } /** end of `module profiler` */ + export = profiler +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/punycode.d.ts b/types/fibjs/declare/punycode.d.ts new file mode 100644 index 0000000000..2d2e423bb7 --- /dev/null +++ b/types/fibjs/declare/punycode.d.ts @@ -0,0 +1,261 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief punycode 国际化域名转换模块 + * @detail Punycode 是由 RFC 3492 定义的主要用于国际化域名的字符编码方案。因为 URL 中主机名限制只能是 ASCII 字符,包括非 ASCII 字符的主机名必须使用 punycode 算法转化为ASCII。,,使用方法:,```JavaScript,var punycode = require('punycode');,``` + */ +declare module "punycode" { + + + module punycode { + + + + + + /** + * + * @brief 将一个 Unicode 字符串转化为等价的只含有 ASCII 字符的 Punycode 字符串 + * @param domain 给定Unicode 字符串 + * @return 返回编码后的只含有 ASCII 字符的 Punycode 字符串 + * + * + * + */ + export function encode(domain: string): string; + + /** + * + * @brief 将一个 Punycode 字符串转化为等价的 Unicode 字符串 + * @param domain 给定Unicode 字符串 + * @return 返回解码后的 Unicode 字符串 + * + * + * + */ + export function decode(domain: string): string; + + /** + * + * @brief 转换一个代表了一个域名的Unicode字符串为一个只含有 ASCII 字符的字符串。只有代表了域名的部分的非 ASCII 字符串会被转换。也就是说,如果你调用了一个已经被转换为ASCII的字符串,也是没有问题的。 + * @param domain 给定Unicode 字符串 + * @return 返回编码后的 ASCII 字符串 + * + * + * + */ + export function toASCII(domain: string): string; + + /** + * + * @brief 转换一个代表了一个域名的Punycode字符串为一个Unicode字符串。只有代表了域名的部分的Punycode字符串会被转换。也就是说,如果你调用了一个已经被转换为Unicode的字符串,也是没有问题的。 + * @param domain 给定 ASCII 字符串 + * @return 返回解码后的 Unicode 字符串 + * + * + * + */ + export function toUnicode(domain: string): string; + + } /** end of `module punycode` */ + export = punycode +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/querystring.d.ts b/types/fibjs/declare/querystring.d.ts new file mode 100644 index 0000000000..bd939a0621 --- /dev/null +++ b/types/fibjs/declare/querystring.d.ts @@ -0,0 +1,267 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief http query 处理模块 + * @detail 引用方法:,```JavaScript,var querystring = require('querystring');,``` + */ +declare module "querystring" { + + + module querystring { + + + + + + /** + * + * @brief url 部件字符串安全编码 + * @param str 要编码的 url + * @return 返回编码的字符串 + * + * + * + */ + export function escape(str: string): string; + + /** + * + * @brief url 安全字符串解码 + * @param str 要解码的 url + * @return 返回解码的字符串 + * + * + * + */ + export function unescape(str: string): string; + + /** + * + * @brief 解析 query 字符串 + * @param str 要解析的字符串 + * @param sep 解析时使用的分割字符串,缺省为 & + * @param eq 解析时使用的赋值字符串,缺省为 = + * @param opt 解析参数,暂未支持 + * @return 返回解码的对象 + * + * + * + */ + export function parse(str: string, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): Class_HttpCollection; + + /** + * + * @brief 序列化一个对象为 query 字符串 + * @param obj 要序列化的对象 + * @param sep 序列化时使用的分割字符串,缺省为 & + * @param eq 序列化时使用的赋值字符串,缺省为 = + * @param opt 解析参数,暂未支持 + * @return 返回序列化后的字符串 + * + * + * + */ + export function stringify(obj: object, sep?: string/** = "&"*/, eq?: string/** = "="*/, opt?: object/** = v8::Object::New(isolate)*/): string; + + } /** end of `module querystring` */ + export = querystring +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/registry.d.ts b/types/fibjs/declare/registry.d.ts new file mode 100644 index 0000000000..3190eaf5d5 --- /dev/null +++ b/types/fibjs/declare/registry.d.ts @@ -0,0 +1,386 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief Windows 注册表访问模块 + * @detail 引用方式:,```JavaScript,var registry = require('registry');,var value = registry.get(registry.CLASSES_ROOT, "\node1\node2\value");,``` + */ +declare module "registry" { + + + module registry { + + /** + * + * @brief 注册表根,存储Windows可识别的文件类型的详细列表,以及相关联的程序 + * + * + */ + export const CLASSES_ROOT = 0; + + /** + * + * @brief 注册表根,存储当前用户设置的信息 + * + * + */ + export const CURRENT_USER = 1; + + /** + * + * @brief 注册表根,包括安装在计算机上的硬件和软件的信息 + * + * + */ + export const LOCAL_MACHINE = 2; + + /** + * + * @brief 注册表根,包含使用计算机的用户的信息 + * + * + */ + export const USERS = 3; + + /** + * + * @brief 注册表根,这个分支包含计算机当前的硬件配置信息 + * + * + */ + export const CURRENT_CONFIG = 5; + + /** + * + * @brief 注册表数据类型,字符串 + * + * + */ + export const SZ = 1; + + /** + * + * @brief 注册表数据类型,扩展字符串 + * + * + */ + export const EXPAND_SZ = 2; + + /** + * + * @brief 注册表数据类型,32 位数值 + * + * + */ + export const DWORD = 4; + + /** + * + * @brief 注册表数据类型,64 位数值 + * + * + */ + export const QWORD = 11; + + + + + + /** + * + * @brief 返回指定键值下的所有子健 + * @param root 指定注册表根 + * @param key 指定键值 + * @return 返回该键值下所有子健 + * + * + * + */ + export function listSubKey(root: number, key: string): any[]; + + /** + * + * @brief 返回指定键值下的所有数据的健 + * @param root 指定注册表根 + * @param key 指定键值 + * @return 返回该键值下所有数据的健 + * + * + * + */ + export function listValue(root: number, key: string): any[]; + + /** + * + * @brief 查询指定键值的数值 + * @param root 指定注册表根 + * @param key 指定键值 + * @return 返回指定键值的数值 + * + * + * + */ + export function get(root: number, key: string): any; + + /** + * + * @brief 设置指定键值为数字 + * @param root 指定注册表根 + * @param key 指定键值 + * @param value 指定数字 + * @param type 指定类型,允许的类型为 DWORD 和 QWORD,缺省为 DWORD + * + * + * + */ + export function set(root: number, key: string, value: number, type?: number/** = undefined*/): void; + + /** + * + * @brief 设置指定键值为字符串 + * @param root 指定注册表根 + * @param key 指定键值 + * @param value 指定字符串 + * @param type 指定类型,允许的类型为 SZ 和 EXPAND_SZ,缺省为 SZ + * + * + * + */ + export function set(root: number, key: string, value: string, type?: number/** = undefined*/): void; + + /** + * + * @brief 设置指定键值为多字符串 + * @param root 指定注册表根 + * @param key 指定键值 + * @param value 指定多字符串数组 + * + * + * + */ + export function set(root: number, key: string, value: any[]): void; + + /** + * + * @brief 设置指定键值为二进制 + * @param root 指定注册表根 + * @param key 指定键值 + * @param value 指定二进制数据 + * + * + * + */ + export function set(root: number, key: string, value: Class_Buffer): void; + + /** + * + * @brief 删除指定键值的数值 + * @param root 指定注册表根 + * @param key 指定键值 + * + * + * + */ + export function del(root: number, key: string): void; + + } /** end of `module registry` */ + export = registry +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/ssl.d.ts b/types/fibjs/declare/ssl.d.ts new file mode 100644 index 0000000000..e331eeb691 --- /dev/null +++ b/types/fibjs/declare/ssl.d.ts @@ -0,0 +1,408 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief ssl/tls 模块,模块别名:tls + * @detail + */ +declare module "ssl" { + + + module ssl { + + /** + * + * @brief 证书验证模式,不验证 + * + * + */ + export const VERIFY_NONE = 0; + + /** + * + * @brief 证书验证模式,可选验证,允许验证不通过 + * + * + */ + export const VERIFY_OPTIONAL = 1; + + /** + * + * @brief 证书验证模式,要求验证,验证不通过则中断 + * + * + */ + export const VERIFY_REQUIRED = 2; + + /** + * + * @brief 证书验证结果,证书超时 + * + * + */ + export const BADCERT_EXPIRED = 1; + + /** + * + * @brief 证书验证结果,证书被撤销 + * + * + */ + export const BADCERT_REVOKED = 2; + + /** + * + * @brief 证书验证结果,证书名错误 + * + * + */ + export const BADCERT_CN_MISMATCH = 4; + + /** + * + * @brief 证书验证结果,证书不可信 + * + * + */ + export const BADCERT_NOT_TRUSTED = 8; + + /** + * + * @brief ssl 协议版本 ssl 3.0 + * + * + */ + export const ssl3 = 0; + + /** + * + * @brief ssl 协议版本 tls 1.0 + * + * + */ + export const tls1 = 1; + + /** + * + * @brief ssl 协议版本 tls 1.1 + * + * + */ + export const tls1_1 = 2; + + /** + * + * @brief ssl 协议版本 tls 1.2 + * + * + */ + export const tls1_2 = 3; + + + /** + * + * @brief 全局证书,用于 ssl 客户端模式验证服务器证书 + * + * + */ + export const ca: Class_X509Cert; + + /** + * + * @brief 设定证书验证模式,缺省为 VERIFY_REQUIRED + * + * + */ + export const verification: number; + + /** + * + * @brief 设定最低版本支持,缺省 ssl3 + * + * + */ + export const min_version: number; + + /** + * + * @brief 设定最高版本支持,缺省 tls1_1 + * + * + */ + export const max_version: number; + + + /** + * + * @brief 创建一个 SslSocket 对象,参见 SslSocket + * + * + */ + export class Socket extends Class_SslSocket {} + + + /** + * + * @brief 创建一个 SslHandler 对象,参见 SslHandler + * + * + */ + export class Handler extends Class_SslHandler {} + + + /** + * + * @brief 创建一个 SslServer 对象,参见 SslServer + * + * + */ + export class Server extends Class_SslServer {} + + + + + /** + * + * @brief 创建一个 SslSocket 对象并建立连接 + * @param url 指定连接的协议,可以是:ssl://host:port + * @param timeout 指定超时时间,单位是毫秒,默认为0 + * @return 返回连接成功的 SslSocket 对象 + * + * + * @async + */ + export function connect(url: string, timeout?: number/** = 0*/): Class_Stream; + + /** + * + * @brief 设定缺省客户端证书 + * @param crt X509Cert 证书,用于客户端验证服务器 + * @param key PKey 私钥,用于与客户端会话 + * + * + * + */ + export function setClientCert(crt: Class_X509Cert, key: Class_PKey): void; + + /** + * + * @brief 从文件中加载缺省客户端证书 + * @param crtFile X509Cert 证书文件,用于客户端验证服务器 + * @param keyFile PKey 私钥文件,用于与客户端会话 + * @param password 解密密码 + * + * + * + */ + export function loadClientCertFile(crtFile: string, keyFile: string, password?: string/** = ""*/): void; + + /** + * + * @brief 加载自带的缺省根证书,等同于 ssl.ca.loadRootCerts + * 此证书内容源自:http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt + * + * + */ + export function loadRootCerts(): void; + + } /** end of `module ssl` */ + export = ssl +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/string_decoder.d.ts b/types/fibjs/declare/string_decoder.d.ts new file mode 100644 index 0000000000..22b4a8aed6 --- /dev/null +++ b/types/fibjs/declare/string_decoder.d.ts @@ -0,0 +1,226 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 解码 Buffer 到字符串 + * @detail 使用方法:,```JavaScript, const { StringDecoder } = require('string_decoder');, const decoder = new StringDecoder('utf8');,, const cent = Buffer.from([0xC2, 0xA2]);, console.log(decoder.write(cent));,, const euro = Buffer.from([0xE2, 0x82, 0xAC]);, console.log(decoder.write(euro));,``` + */ +declare module "string_decoder" { + + + module string_decoder { + + + + /** + * + * @brief 创建一个解码对象,参见 StringDecoder + * + * + */ + export class StringDecoder extends Class_StringDecoder {} + + + + + } /** end of `module string_decoder` */ + export = string_decoder +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/test.d.ts b/types/fibjs/declare/test.d.ts new file mode 100644 index 0000000000..c3f7d36456 --- /dev/null +++ b/types/fibjs/declare/test.d.ts @@ -0,0 +1,366 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 测试套件模块,用以定义管理测试套件 + * @detail 使用方法 :,,```JavaScript,var test = require('test');,test.setup();,,describe('test', () => {, before(() => {, // setup before the whole test, });,, beforeEach(() => {, // setup before each test, });,, after(() => {, // cleanup after the whole test, });,, afterEach(() => {, // cleanup after each test, });,, it('case', () => {, assert.ok(true);, });,, // ignored test case, xit('case', () => {, assert.ok(true);, });,, // ignored test case, it.skip('case', () => {, assert.ok(true);, });,, // only test case, oit('case', () => {, assert.ok(true);, });,, // only test case, it.only('case', () => {, assert.ok(true);, });,});,,// async function test,describe('test async', () => {,it('pass case', async() => {, assert.ok(true);,});,,it('error case', async() => {, throw new Error('some thing wrong!');,});,});,,// callback function test,// cannot use callback mode in jsc,describe('test callback', () => {,it('pass case', done => {, setTimeout(() => {, assert.ok(true);, done();, }, 0);,});,,it('error case', done => {, setTimeout(() => {, done(new Error('some thing wrong!'));, }, 0);,});,});,,process.exit(-test.run(console.DEBUG));,``` + */ +declare module "test" { + + import consoleNS = require('console') + import assertNS = require('assert') + + module test { + + + /** + * + * @brief 设置和查询慢速测试警告阀值,以 ms 为单位,缺省为 75 + * + * + * + */ + export const slow: number; + + + /** + * + * @brief 断言测试模块,如果测试值为假,则报错,报错行为可设定继续运行或者错误抛出 + * + * + */ + + export const assert: typeof assertNS + + + + /** + * + * @brief 定义一个测试模块,可嵌套定义 + * @param name 定义模块名称 + * @param block 模块初始化代码 + * + * + * + */ + export function describe(name: string, block: Function): void; + + /** + * + * @brief 暂停测试的模块定义,test.setup 后可使用 describe.skip 调用 + * @param name 定义模块名称 + * @param block 模块初始化代码 + * + * + * + */ + export function xdescribe(name: string, block: Function): void; + + /** + * + * @brief 独立测试的模块定义,test.setup 后可使用 describe.only 调用 + * @param name 定义模块名称 + * @param block 模块初始化代码 + * + * + * + */ + export function odescribe(name: string, block: Function): void; + + /** + * + * @brief 定义一个测试项目 + * @param name 定义项目名称 + * @param block 测试内容 + * + * + * + */ + export function it(name: string, block: Function): void; + + /** + * + * @brief 暂停测试的项目定义,test.setup 后可使用 it.skip 调用 + * @param name 定义项目名称 + * @param block 测试内容 + * + * + * + */ + export function xit(name: string, block: Function): void; + + /** + * + * @brief 独立测试的项目定义,test.setup 后可使用 it.only 调用 + * @param name 定义项目名称 + * @param block 测试内容 + * + * + * + */ + export function oit(name: string, block: Function): void; + + /** + * + * @brief 定义当前测试模块进入事件 + * @param func 事件函数 + * + * + * + */ + export function before(func: Function): void; + + /** + * + * @brief 定义当前测试模块退出事件 + * @param func 事件函数 + * + * + * + */ + export function after(func: Function): void; + + /** + * + * @brief 定义当前测试模块测试项目进入事件 + * @param func 事件函数 + * + * + * + */ + export function beforeEach(func: Function): void; + + /** + * + * @brief 定义当前测试模块测试项目退出事件 + * @param func 事件函数 + * + * + * + */ + export function afterEach(func: Function): void; + + /** + * + * @brief 开始执行定义的测试模块 + * @param loglevel 指定进行测试时的日志输出级别,ERROR 时,项目报错信息集中在报告后显示,低于 ERROR 时,输出信息随时显示,高于 ERROR 时,只显示报告 + * @return 返回测试用例统计结果,正确则返回 0,错误则返回错误个数 + * + * + * + */ + export function run(loglevel?: number/** = undefined*/): number; + + /** + * + * @brief 初始化当前脚本的测试环境,将 test 模块方法复制为当前脚本全局变量 + * + * + */ + export function setup(): void; + + } /** end of `module test` */ + export = test +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/timers.d.ts b/types/fibjs/declare/timers.d.ts new file mode 100644 index 0000000000..8de6e72812 --- /dev/null +++ b/types/fibjs/declare/timers.d.ts @@ -0,0 +1,335 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief timers 模块 + * @detail + */ +declare module "timers" { + + + module timers { + + + + + + /** + * + * @brief 在指定的时间后调用函数 + * @param callback 指定回调函数 + * @param timeout 指定延时的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setTimeout(callback: Function, timeout?: number/** = 1*/, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearTimeout(t: any): void; + + /** + * + * @brief 每间隔指定的时间后调用函数 + * @param callback 指定回调函数 + * @param timeout 指定间隔的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setInterval(callback: Function, timeout: number, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearInterval(t: any): void; + + /** + * + * @brief 每间隔指定的时间后调用函数,这是个高精度定时器,会主动打断正在运行的 JavaScript 脚本执行定时器 + * 由于 setHrInterval 的定时器会中断正在运行的代码执行回调,因此不要在回调函数内修改可能影响其它模块的数据,或者在回调中调用任何标记为 async 的 api 函数,否则将会产生不可预知的结果。例如: + * ```JavaScript + * var timers = require('timers'); + * + * var cnt = 0; + * timers.setHrInterval(() => { + * cnt++; + * }, 100); + * + * while (cnt < 10); + * + * console.error("===============================> done"); + * ``` + * 这段代码中,第 8 行的循环并不会因为 cnt 的改变而结束,因为 JavaScript 在优化代码时会认定在这个循环过程中 cnt 不会被改变。 + * @param callback 指定回调函数 + * @param timeout 指定间隔的时间,以毫秒为单位。超过 2^31 的话,立即执行。 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setHrInterval(callback: Function, timeout: number, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearHrInterval(t: any): void; + + /** + * + * @brief 下一个空闲时间立即执行回调函数 + * @param callback 指定回调函数 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回定时器对象 + * + * + * + */ + export function setImmediate(callback: Function, ...args: any[]): Class_Timer; + + /** + * + * @brief 清除指定的定时器 + * @param t 指定要清除的定时器 + * + * + * + */ + export function clearImmediate(t: any): void; + + /** + * + * @brief 调用给定的函数,并在超时时间到期时中断函数运行 + * @param func 指定要运行的函数 + * @param timeout 指定超时时间 + * @param args 额外的参数,传入到指定的 callback 内,可选。 + * @return 返回 func 的运行结果 + * + * + * + */ + export function call(func: Function, timeout: number, ...args: any[]): any; + + } /** end of `module timers` */ + export = timers +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/tty.d.ts b/types/fibjs/declare/tty.d.ts new file mode 100644 index 0000000000..c2a20d7d2f --- /dev/null +++ b/types/fibjs/declare/tty.d.ts @@ -0,0 +1,228 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief tty 模块 + * @detail 使用方法:,```JavaScript,const tty = require('tty');,``` + */ +declare module "tty" { + + + module tty { + + + + + + /** + * + * @brief 查询是否是命令交互窗口 + * @param fd 文件描述符 + * @return 如果文件描述符同一个终端窗口关联则返回 true ,否则返回 false + * + * + * + */ + export function isatty(fd: number): boolean; + + } /** end of `module tty` */ + export = tty +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/url.d.ts b/types/fibjs/declare/url.d.ts new file mode 100644 index 0000000000..545b516cd2 --- /dev/null +++ b/types/fibjs/declare/url.d.ts @@ -0,0 +1,241 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief url 处理模块 + * @detail + */ +declare module "url" { + + + module url { + + + + + + /** + * + * @brief 参数构造 UrlObject 对象 + * @param args 指定构造参数的字典对象,支持的字段有:protocol, slashes, username, password, hostname, port, pathname, query, hash + * @return 返回构造成功的字符串 + * + * + * + */ + export function format(args: object): string; + + /** + * + * @brief 解析一个 url 字符串 + * @param url 指定需要解析的 url 字符串 + * @param parseQueryString 指定是否解析 query + * @param slashesDenoteHost 默认为false, 如果设置为true,则从字符串'//'之后到下一个'/'之前的字符串会被解析为host,例如'//foo/bar', 结果应该是{host: 'foo', pathname: '/bar'}而不是{pathname: '//foo/bar'} + * @return 返回包含解析数据的对象 + * + * + * + */ + export function parse(url: string, parseQueryString?: boolean/** = false*/, slashesDenoteHost?: boolean/** = false*/): Class_UrlObject; + + } /** end of `module url` */ + export = url +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/util.d.ts b/types/fibjs/declare/util.d.ts new file mode 100644 index 0000000000..1b38c49399 --- /dev/null +++ b/types/fibjs/declare/util.d.ts @@ -0,0 +1,988 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 常用工具模块 + * @detail + */ +declare module "util" { + + + module util { + + + + /** + * + * @brief 数据统计对象,用以构建应用运行时数据收集,参见 Stats 对象。 + * + * + */ + export class Stats extends Class_Stats {} + + + /** + * + * @brief LRU(least recently used) 缓存对象,参见 LruCache 对象。 + * + * + */ + export class LruCache extends Class_LruCache {} + + + + + /** + * + * @brief 按照指定的格式格式化变量 + * + * @param fmt 格式化字符串 + * @param args 可选参数列表 + * @return 返回格式化后的字符串 + * + * + * + */ + export function format(fmt: string, ...args: any[]): string; + + /** + * + * @brief 格式格式化变量 + * + * @param args 可选参数列表 + * @return 返回格式化后的字符串 + * + * + * + */ + export function format(...args: any[]): string; + + /** + * + * @brief 从一个构造函数 constructor 继承原型方法到另一个。构造函数的原型将被设置为一个新的从超类(superConstructor)创建的对象。 + * + * @param constructor 初始的构造函数 + * @param superConstructor 被继承的超类 + * + * + * + */ + export function inherits(constructor: any, superConstructor: any): void; + + /** + * + * @brief 方法返回 obj 的字符串表示,主要用于调试。 附加的 options 可用于改变格式化字符串的某些方面。 + * + * @param obj 指定需要处理的对象 + * @param options 指定格式控制选项 + * @return 返回格式化后的字符串 + * + * + * + */ + export function inspect(obj: object, options?: object/** = v8::Object::New(isolate)*/): string; + + /** + * + * @brief 检测给定的变量是否不包含任何值(没有可枚举的属性) + * + * @param v 给定需要检测的变量 + * @return 如果为空则返回 True + * + * + * + */ + export function isEmpty(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是数组 + * + * @param v 给定需要检测的变量 + * @return 如果是数组则返回 True + * + * + * + */ + export function isArray(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Boolean + * + * @param v 给定需要检测的变量 + * @return 如果是 Boolean 则返回 True + * + * + * + */ + export function isBoolean(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Null + * + * @param v 给定需要检测的变量 + * @return 如果是 Null 则返回 True + * + * + * + */ + export function isNull(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Null 或者 Undefined + * + * @param v 给定需要检测的变量 + * @return 如果是 Null 或者 Undefined 则返回 True + * + * + * + */ + export function isNullOrUndefined(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是数字 + * + * @param v 给定需要检测的变量 + * @return 如果是数字则返回 True + * + * + * + */ + export function isNumber(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是字符串 + * + * @param v 给定需要检测的变量 + * @return 如果是字符串则返回 True + * + * + * + */ + export function isString(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Undefined + * + * @param v 给定需要检测的变量 + * @return 如果是 Undefined 则返回 True + * + * + * + */ + export function isUndefined(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是正则对象 + * + * @param v 给定需要检测的变量 + * @return 如果是正则对象则返回 True + * + * + * + */ + export function isRegExp(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是对象 + * + * @param v 给定需要检测的变量 + * @return 如果是对象则返回 True + * + * + * + */ + export function isObject(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是日期对象 + * + * @param v 给定需要检测的变量 + * @return 如果是日期对象则返回 True + * + * + * + */ + export function isDate(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是错误对象 + * + * @param v 给定需要检测的变量 + * @return 如果是错误对象则返回 True + * + * + * + */ + export function isNativeError(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是原始类型 + * + * @param v 给定需要检测的变量 + * @return 如果是原始类型则返回 True + * + * + * + */ + export function isPrimitive(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是Symbol类型 + * + * @param v 给定需要检测的变量 + * @return 如果是Symbol类型则返回 True + * + * + * + */ + export function isSymbol(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 DataView 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 DataView 类型则返回 True + * + * + * + */ + export function isDataView(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 External 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 External 类型则返回 True + * + * + * + */ + export function isExternal(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Map 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 Map 类型则返回 True + * + * + * + */ + export function isMap(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 MapIterator 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 MapIterator 类型则返回 True + * + * + * + */ + export function isMapIterator(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Promise 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 Promise 类型则返回 True + * + * + * + */ + export function isPromise(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 AsyncFunction 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 AsyncFunction 类型则返回 True + * + * + * + */ + export function isAsyncFunction(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Set 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 Set 类型则返回 True + * + * + * + */ + export function isSet(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 SetIterator 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 SetIterator 类型则返回 True + * + * + * + */ + export function isSetIterator(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 TypedArray 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 TypedArray 类型则返回 True + * + * + * + */ + export function isTypedArray(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是 Uint8Array 类型 + * + * @param v 给定需要检测的变量 + * @return 如果是 Uint8Array 类型则返回 True + * + * + * + */ + export function isUint8Array(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是函数对象 + * + * @param v 给定需要检测的变量 + * @return 如果是函数对象则返回 True + * + * + * + */ + export function isFunction(v: any): boolean; + + /** + * + * @brief 检测给定的变量是否是函数 Buffer 对象 + * + * @param v 给定需要检测的变量 + * @return 如果是函数 Buffer 对象则返回 True + * + * + * + */ + export function isBuffer(v: any): boolean; + + /** + * + * @brief 查询指定对象是否包含给定的键 + * + * @param v 给定需要查询的对象 + * @param key 指定需要查询的键 + * @return 返回对象的全部键数组 + * + * + * + */ + export function has(v: any, key: string): boolean; + + /** + * + * @brief 查询指定对象的全部键数组 + * + * @param v 给定需要查询的对象 + * @return 返回对象的全部键数组 + * + * + * + */ + export function keys(v: any): any[]; + + /** + * + * @brief 查询指定对象的全部值数组 + * + * @param v 给定需要查询的对象 + * @return 返回对象的全部值数组 + * + * + * + */ + export function values(v: any): any[]; + + /** + * + * @brief 克隆给定变量,如果是对象或数组,则复制内容到新对象 + * + * @param v 给定要克隆的变量 + * @return 返回克隆结果 + * + * + * + */ + export function clone(v: any): any; + + /** + * + * @brief 深度冻结一个对象,被冻结后的对象及其包含的对象都将不允许修改 + * + * @param v 指定要冻结的对象 + * + * + * + */ + export function deepFreeze(v: any): void; + + /** + * + * @brief 将一个或者多个对象的键值扩展到指定对象 + * + * @param v 指定要扩展的对象 + * @param objs 指定一个或者多个用于扩展的对象 + * @return 返回扩展的结果 + * + * + * + */ + export function extend(v: any, ...objs: any[]): any; + + /** + * + * @brief 将一个或者多个对象的键值扩展到指定对象,是 extend 的别名 + * + * @param v 指定要扩展的对象 + * @param objs 指定一个或者多个用于扩展的对象 + * @return 返回扩展的结果 + * + * + * + */ + export function _extend(v: any, ...objs: any[]): any; + + /** + * + * @brief 返回一个object副本,只过滤出指定键的属性值 + * + * @param v 指定要过滤的对象 + * @param objs 指定一个或者多个用于选择的键 + * @return 返回过滤的结果 + * + * + * + */ + export function pick(v: any, ...objs: any[]): object; + + /** + * + * @brief 返回一个object副本,只过排除指定键的属性值 + * + * @param v 指定要过滤的对象 + * @param keys 指定一个或者多个用于排除的键 + * @return 返回排除的结果 + * + * + * + */ + export function omit(v: any, ...keys: any[]): object; + + /** + * + * @brief 获取数组的第一个元素 + * + * @param v 给定要获取的数组 + * @return 返回获取的元素 + * + * + * + */ + export function first(v: any): any; + + /** + * + * @brief 获取数组的开始多个元素 + * + * @param v 给定要获取的数组 + * @param n 指定要获取的元素个数 + * @return 返回获取的元素数组 + * + * + * + */ + export function first(v: any, n: number): any; + + /** + * + * @brief 获取数组的第后一个元素 + * + * @param v 给定要获取的数组 + * @return 返回获取的元素 + * + * + * + */ + export function last(v: any): any; + + /** + * + * @brief 获取数组的结尾多个元素 + * + * @param v 给定要获取的数组 + * @param n 指定要获取的元素个数 + * @return 返回获取的元素数组 + * + * + * + */ + export function last(v: any, n: number): any; + + /** + * + * @brief 获取数组的元素去重后的副本 + * + * @param v 给定要去重的数组 + * @param sorted 指定数组是否排序,如果指定数组排序,将使用快速算法 + * @return 返回去重元素后的数组 + * + * + * + */ + export function unique(v: any, sorted?: boolean/** = false*/): any[]; + + /** + * + * @brief 将一个或者多个数组的值合并成一个值唯一的数组 + * + * @param arrs 指定一个或者多个用于合并的数组 + * @return 返回合并的结果 + * + * + * + */ + export function union(...arrs: any[]): any[]; + + /** + * + * @brief 返回一个包含 arr 数组中排除一个或者多个数组元素的交集 + * + * @param arrs 指定一个或者多个用于计算交集的数组 + * @return 返回计算交集的结果 + * + * + * + */ + export function intersection(...arrs: any[]): any[]; + + /** + * + * @brief 将一个嵌套多层的数组(嵌套可以是任何层数)转换为只有一层的数组。 如果你传递 shallow 参数,数组将只减少一维的嵌套。 + * + * @param arr 指定需要转换的数组 + * @param shallow 指定是否只减少一维的嵌套,缺省为 false + * @return 返回转换的结果 + * + * + * + */ + export function flatten(arr: any, shallow?: boolean/** = false*/): any[]; + + /** + * + * @brief 返回一个包含 arr 数组中排除一个或者多个元素后的数组 + * + * @param arr 指定需要排除的数组 + * @param els 指定一个或者多个用于排除的元素 + * @return 返回排除的结果 + * + * + * + */ + export function without(arr: any, ...els: any[]): any[]; + + /** + * + * @brief 返回一个包含 arr 数组中排除 without 数组元素之后的数组 + * + * @param list 指定需要排除的数组 + * @param arrs 指定用于排除的一个或者多个数组 + * @return 返回排除的结果 + * + * + * + */ + export function difference(list: any[], ...arrs: any[]): any[]; + + /** + * + * @brief 遍历 list 中的所有元素,按顺序用遍历输出每个元素。如果传递了 context 参数,则把 iterator 绑定到 context 对象上。每次调用 iterator 都会传递三个参数:(element, index, list) + * + * @param list 指定需要遍历的列表或对象 + * @param iterator 指定用于遍历的回调函数 + * @param context 指定调用 iterator 时绑定的 context 对象 + * @return 返回 list 本身 + * + * + * + */ + export function each(list: any, iterator: Function, context?: any/** = v8::Undefined(isolate)*/): any; + + /** + * + * @brief 通过变换函数(iterator迭代器)把 list 中的每个值映射到一个新的数组中。如果传递了 context 参数,则把 iterator 绑定到 context 对象上。每次调用 iterator 都会传递三个参数:(element, index, list) + * + * @param list 指定需要变换的列表或对象 + * @param iterator 指定用于变换的回调函数 + * @param context 指定调用 iterator 时绑定的 context 对象 + * @return 返回变换的结果 + * + * + * + */ + export function map(list: any, iterator: Function, context?: any/** = v8::Undefined(isolate)*/): any[]; + + /** + * + * @brief 把 list中 元素归结为一个单独的数值。如果传递了 context 参数,则把 iterator 绑定到 context 对象上。每次调用 iterator 都会传递三个参数:(memo, element, index, list) + * + * @param list 指定需要归结的列表或对象 + * @param iterator 指定用于归结的回调函数 + * @param memo 指定归结的初始值 + * @param context 指定调用 iterator 时绑定的 context 对象 + * @return 返回归结的结果 + * + * + * + */ + export function reduce(list: any, iterator: Function, memo: any, context?: any/** = v8::Undefined(isolate)*/): any; + + /** + * + * @brief 编译脚本为二进制代码 + * util.compile 可以将脚本编译为 v8 内部运行数据块(非机器执行代码)。编译以后的代码,保存为 *.jsc 后,可以由 run 和 require 直接加载执行。 + * + * 由于编译之后,目标代码将不能逆向获取源代码,依赖于 Function.toString 的程序将不能正常运行。 + * + * @param srcname 指定要添加的脚本名称 + * @param script 指定要编译的脚本代码 + * @param mode 编译模式,0: module, 1: script, 2: worker,缺省为 0 + * @return 返回编译出的二进制代码 + * + * + * + */ + export function compile(srcname: string, script: string, mode?: number/** = 0*/): Class_Buffer; + + /** + * + * @brief 包裹 callback 或 async 方法为同步调用 + * + * util.sync 将 callback 方法或者 async 方法处理为 sync 方法,以方便调用。 + * + * callback 示例如下: + * ```JavaScript + * // callback + * var util = require('util'); + * + * function cb_test(a, b, cb) { + * setTimeout(() => { + * cb(null, a + b); + * }, 100); + * } + * + * var fn_sync = util.sync(cb_test); + * console.log(fn_sync(100, 200)); + * ``` + * async 示例如下: + * ```JavaScript + * // async/await + * var util = require('util'); + * + * async function async_test(a, b) { + * return a + b; + * } + * + * var fn_sync = util.sync(async_test); + * console.log(fn_sync(100, 200)); + * ``` + * 对于未标记为 async 的返回 promise 的函数,可以手动指定 sync 模式: + * ```JavaScript + * // async/await + * var util = require('util'); + * + * function async_test(a, b) { + * return new Promise(function (resolve, reject) { + * resolve(a + b); + * }); + * } + * + * var fn_sync = util.sync(async_test, true); + * console.log(fn_sync(100, 200)); + * ``` + * + * @param func 给定需要包裹的方法 + * @param async_func 指定以 async 函数方式处理 func,为 false 则自动判断 + * @return 返回同步运行的方法 + * + * + * + */ + export function sync(func: Function, async_func?: boolean/** = false*/): Function; + + /** + * + * @brief 查询当前引擎及各组件版本信息 + * + * ```JavaScript + * { + * "fibjs": "0.25.0", + * "clang": "9.1", + * "date": "Jun 12 2018 07:22:40", + * "vender": { + * "ev": "4.24", + * "expat": "2.2.5", + * "gd": "2.2.4", + * "jpeg": "8.3", + * "leveldb": "1.17", + * "mongo": "0.7", + * "pcre": "8.21", + * "png": "1.5.4", + * "mbedtls": "2.6.1", + * "snappy": "1.1.2", + * "sqlite": "3.23.0", + * "tiff": "3.9.5", + * "uuid": "1.6.2", + * "v8": "6.7.288.20", + * "v8-snapshot": true, + * "zlib": "1.2.7", + * "zmq": "3.1" + * } + * } + * ``` + * @return 返回组件版本对象 + * + * + * + */ + export function buildInfo(): object; + + } /** end of `module util` */ + export = util +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/uuid.d.ts b/types/fibjs/declare/uuid.d.ts new file mode 100644 index 0000000000..b891509800 --- /dev/null +++ b/types/fibjs/declare/uuid.d.ts @@ -0,0 +1,311 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief uuid 唯一 id 模块 + * @detail 基础模块。提供唯一 id 的创建于操作,```JavaScript,var uuid = require('uuid');,``` + */ +declare module "uuid" { + + + module uuid { + + /** + * + * @brief md5 与 sha1 创建 uuid 时指定 name 命名为域名 + * + * + */ + export const DNS = 0; + + /** + * + * @brief md5 与 sha1 创建 uuid 时指定 name 命名为 url 地址 + * + * + */ + export const URL = 1; + + /** + * + * @brief md5 与 sha1 创建 uuid 时指定 name 命名为 ISO OID + * + * + */ + export const OID = 2; + + /** + * + * @brief md5 与 sha1 创建 uuid 时指定 name 命名为 X.500 DN + * + * + */ + export const X509 = 3; + + + /** + * + * @brief 查询和修改 Snowflake 算法的主机 id + * + * + */ + export const hostID: number; + + + + + /** + * + * @brief 使用时间和主机名创建 uuid + * @return 返回一个生成的二进制 id + * + * + * + */ + export function node(): Class_Buffer; + + /** + * + * @brief 使用特定命名的 md5 创建 uuid + * @param ns 指定命名空间,可以为 uuid.DNS, uuid.URL, uuid.OID, uuid.X509 + * @param name 指定名称 + * @return 返回一个生成的二进制 id + * + * + * + */ + export function md5(ns: number, name: string): Class_Buffer; + + /** + * + * @brief 使用随机数创建 uuid + * @return 返回一个生成的二进制 id + * + * + * + */ + export function random(): Class_Buffer; + + /** + * + * @brief 使用特定命名的 sha1 创建 uuid + * @param ns 指定命名空间,可以为 uuid.DNS, uuid.URL, uuid.OID, uuid.X509 + * @param name 指定名称 + * @return 返回一个生成的二进制 id + * + * + * + */ + export function sha1(ns: number, name: string): Class_Buffer; + + /** + * + * @brief 使用 Snowflake 算法创建 uuid + * @return 返回一个生成的二进制 id + * + * + * + */ + export function snowflake(): Class_Buffer; + + } /** end of `module uuid` */ + export = uuid +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/vm.d.ts b/types/fibjs/declare/vm.d.ts new file mode 100644 index 0000000000..6cb2c89ead --- /dev/null +++ b/types/fibjs/declare/vm.d.ts @@ -0,0 +1,226 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief 安全沙箱模块,用于隔离不同安全等级的运行环境 + * @detail 通过建立安全沙箱,可以限制脚本运行时可以接触的资源,隔离不同脚本执行环境,并可以为不同的环境定制基础模块,以保障整体运行环境的安全。,,下面的示例创建一个沙箱,限制只允许访问全局基础模块中的 assert 模块,并添加 a 和 b 两个定制模块:,```JavaScript,var vm = require('vm');,var sbox = new vm.SandBox({, a: 100,, b: 200,, assert: require('assert'),});,,var mod_in_sbox = sbox.require('./path/to/mod');,``` + */ +declare module "vm" { + + + module vm { + + + + /** + * + * @brief 创建一个 SandBox 对象,参见 SandBox + * + * + */ + export class SandBox extends Class_SandBox {} + + + + + } /** end of `module vm` */ + export = vm +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/ws.d.ts b/types/fibjs/declare/ws.d.ts new file mode 100644 index 0000000000..e31944594a --- /dev/null +++ b/types/fibjs/declare/ws.d.ts @@ -0,0 +1,327 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief websocket 支持模块 + * @detail 使用方法:,```JavaScript,var ws = require('ws');,```,创建一个服务器:,```JavaScript,var ws = require('ws');,var http = require('http');,,var svr = new http.Server(80, {, '/ws': ws.upgrade((conn, req) => {, conn.onmessage = e => console.log(e.data);, }),});,svr.run();,```,使用 WebSocket 客户端:,```JavaScript,var ws = require('ws');,,var conn = new ws.Socket('ws://127.0.0.1/ws');,conn.ommessage = e => console.log(e.data);,``` + */ +declare module "ws" { + + + module ws { + + /** + * + * @brief 指定 websocket 消息类型 0,代表一个继续帧 + * + * + */ + export const CONTINUE = 0; + + /** + * + * @brief 指定 websocket 消息类型 1,代表一个文本帧 + * + * + */ + export const TEXT = 1; + + /** + * + * @brief 指定 websocket 消息类型 2,代表一个二进制帧 + * + * + */ + export const BINARY = 2; + + /** + * + * @brief 指定 websocket 消息类型 8,连接关闭 + * + * + */ + export const CLOSE = 8; + + /** + * + * @brief 指定 websocket 消息类型 9,代表一个 ping 帧 + * + * + */ + export const PING = 9; + + /** + * + * @brief 指定 websocket 消息类型 10,代表一个 pong 帧 + * + * + */ + export const PONG = 10; + + /** + * + * @brief 指定 WebSocket 状态,表示正在连接中 + * + * + */ + export const CONNECTING = 0; + + /** + * + * @brief 指定 WebSocket 状态,表示打开状态 + * + * + */ + export const OPEN = 1; + + /** + * + * @brief 指定 WebSocket 状态,表示已发送 CLOSE 消息,等待关闭中 + * + * + */ + export const CLOSING = 2; + + /** + * + * @brief 指定 WebSocket 状态,表示已经关闭 + * + * + */ + export const CLOSED = 3; + + + + /** + * + * @brief 创建一个 websocket 消息对象,参见 WebSocketMessage + * + * + */ + export class Message extends Class_WebSocketMessage {} + + + /** + * + * @brief WebSocket 对象,参见 WebSocket + * + * + */ + export class Socket extends Class_WebSocket {} + + + + + /** + * + * @brief 创建一个 websocket 协议处理器,从 http 接收 upgrade 请求并握手,生成 WebSocket 对象 + * accept 函数调用时,将传递两个参数,第一个参数为接收到的 WebSocket 对象,第二个参数为握手时的 HttpRequest 对象。 + * @param accept 连接成功处理函数 + * @return 返回协议处理器,可与 HttpServer, Chain, Routing 等对接 + * + * + * + */ + export function upgrade(accept: Function): Class_Handler; + + } /** end of `module ws` */ + export = ws +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/xml.d.ts b/types/fibjs/declare/xml.d.ts new file mode 100644 index 0000000000..454d7defe5 --- /dev/null +++ b/types/fibjs/declare/xml.d.ts @@ -0,0 +1,333 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief xml 处理模块 + * @detail + */ +declare module "xml" { + + + module xml { + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlElement 对象 + * + * + * + */ + export const ELEMENT_NODE = 1; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlAttr 对象 + * + * + * + */ + export const ATTRIBUTE_NODE = 2; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlText 对象 + * + * + * + */ + export const TEXT_NODE = 3; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlCDATASection 对象 + * + * + * + */ + export const CDATA_SECTION_NODE = 4; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlProcessingInstruction 对象 + * + * + * + */ + export const PROCESSING_INSTRUCTION_NODE = 7; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlComment 对象 + * + * + * + */ + export const COMMENT_NODE = 8; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlDocument 对象 + * + * + * + */ + export const DOCUMENT_NODE = 9; + + /** + * + * @brief XmlNode 的 nodeType 属性常量,表示节点为 XmlDocumentType 对象 + * + * + * + */ + export const DOCUMENT_TYPE_NODE = 10; + + + + /** + * + * @brief xml 文档对象,参见 XmlDocument 对象 + * + * + */ + export class Document extends Class_XmlDocument {} + + + + + /** + * + * @brief 解析 xml/html 文本,并创建 XmlDocument 对象,不支持多语种 + * @param source 指定需要解析的 xml/html 文本 + * @param type 指定文本类型,缺省为 text/xml,也可指定为 text/html + * @return 返回创建的 XmlDocument 对象 + * + * + * + */ + export function parse(source: string, type?: string/** = "text/xml"*/): Class_XmlDocument; + + /** + * + * @brief 解析 xml/html,并创建 XmlDocument 对象,解析时会根据指定的语种转换 + * @param source 指定需要解析的 xml/html 二进制数据 + * @param type 指定文本类型,缺省为 text/xml,也可指定为 text/html + * @return 返回创建的 XmlDocument 对象 + * + * + * + */ + export function parse(source: Class_Buffer, type?: string/** = "text/xml"*/): Class_XmlDocument; + + /** + * + * @brief 序列化 XmlNode 为字符串 + * @param node 指定需要序列化的 XmlNode + * @return 返回序列化的字符串 + * + * + * + */ + export function serialize(node: Class_XmlNode): string; + + } /** end of `module xml` */ + export = xml +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/zip.d.ts b/types/fibjs/declare/zip.d.ts new file mode 100644 index 0000000000..45c87abb46 --- /dev/null +++ b/types/fibjs/declare/zip.d.ts @@ -0,0 +1,283 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief zip 格式文件压缩解压模块 + * @detail 使用方法:,```JavaScript,var zip = require('zip');,``` + */ +declare module "zip" { + + + module zip { + + /** + * + * @brief 压缩类型常量, 不压缩, 仅存储 + * + * + */ + export const ZIP_STORED = 0; + + /** + * + * @brief 压缩类型常量, 需要依赖zlib库进行压缩 + * + * + */ + export const ZIP_DEFLATED = 1; + + + + + + /** + * + * @brief 判断文件是否是zip格式 + * @param filename 文件名 + * @return 返回true代表文件是zip文件 + * + * + * @async + */ + export function isZipFile(filename: string): boolean; + + /** + * + * @brief 打开一个zip文件 + * @param path 文件路径 + * @param mod 打开文件模式, "r"代表读取, "w"代表创建, "a"代表在zip文件后追加 + * @param compress_type 压缩类型, ZIP_STORED 代表不压缩, 仅存储。 默认使用ZIP_DEFLATED 代表使用zlib库进行压缩。 + * @return 返回zip文件对象 + * + * + * @async + */ + export function open(path: string, mod?: string/** = "r"*/, compress_type?: number/** = undefined*/): Class_ZipFile; + + /** + * + * @brief 打开一个zip文件 + * @param data zip文件数据 + * @param mod 打开文件模式, "r"代表读取, "w"代表创建, "a"代表在zip文件后追加 + * @param compress_type 压缩类型, ZIP_STORED 代表不压缩, 仅存储。 默认使用ZIP_DEFLATED 代表使用zlib库进行压缩。 + * @return 返回zip文件对象 + * + * + * @async + */ + export function open(data: Class_Buffer, mod?: string/** = "r"*/, compress_type?: number/** = undefined*/): Class_ZipFile; + + /** + * + * @brief 打开一个zip文件 + * @param strm zip文件流 + * @param mod 打开文件模式, "r"代表读取, "w"代表创建, "a"代表在zip文件后追加 + * @param compress_type 压缩类型, ZIP_STORED 代表不压缩, 仅存储。 默认使用ZIP_DEFLATED 代表使用zlib库进行压缩。 + * @return 返回zip文件对象 + * + * + * @async + */ + export function open(strm: Class_SeekableStream, mod?: string/** = "r"*/, compress_type?: number/** = undefined*/): Class_ZipFile; + + } /** end of `module zip` */ + export = zip +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/zlib.d.ts b/types/fibjs/declare/zlib.d.ts new file mode 100644 index 0000000000..693dcf81bf --- /dev/null +++ b/types/fibjs/declare/zlib.d.ts @@ -0,0 +1,525 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief zlib 压缩解压模块 + * @detail 使用方法:,```JavaScript,var zlib = require('zlib');,``` + */ +declare module "zlib" { + + + module zlib { + + /** + * + * @brief deflate 压缩级别,设定不压缩 + * + * + */ + export const NO_COMPRESSION = 0; + + /** + * + * @brief deflate 压缩级别,设定最快压缩 + * + * + */ + export const BEST_SPEED = 1; + + /** + * + * @brief deflate 压缩级别,设定最高压缩 + * + * + */ + export const BEST_COMPRESSION = 9; + + /** + * + * @brief deflate 压缩级别,设定缺省设置 + * + * + */ + export const DEFAULT_COMPRESSION = -1; + + + + + + /** + * + * @brief 创建一个 deflate 流对象 + * @param to 用于存储处理结果的流 + * @return 返回封装过的流对象 + * + * + */ + export function createDeflate(to: Class_Stream): Class_Stream; + + /** + * + * @brief 创建一个 deflateRaw 流对象 + * @param to 用于存储处理结果的流 + * @return 返回封装过的流对象 + * + * + */ + export function createDeflateRaw(to: Class_Stream): Class_Stream; + + /** + * + * @brief 创建一个 gunzip 流对象 + * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回封装过的流对象 + * + * + */ + export function createGunzip(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; + + /** + * + * @brief 创建一个 gzip 流对象 + * @param to 用于存储处理结果的流 + * @return 返回封装过的流对象 + * + * + */ + export function createGzip(to: Class_Stream): Class_Stream; + + /** + * + * @brief 创建一个 inflate 流对象 + * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回封装过的流对象 + * + * + */ + export function createInflate(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; + + /** + * + * @brief 创建一个 inflateRaw 流对象 + * @param to 用于存储处理结果的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回封装过的流对象 + * + * + */ + export function createInflateRaw(to: Class_Stream, maxSize?: number/** = -1*/): Class_Stream; + + /** + * + * @brief 使用 deflate 算法压缩数据(zlib格式) + * @param data 给定要压缩的数据 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * @return 返回压缩后的二进制数据 + * + * + * @async + */ + export function deflate(data: Class_Buffer, level?: number/** = undefined*/): Class_Buffer; + + /** + * + * @brief 使用 deflate 算法压缩数据到流对象中(zlib格式) + * @param data 给定要压缩的数据 + * @param stm 指定存储压缩数据的流 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * + * + * @async + */ + export function deflateTo(data: Class_Buffer, stm: Class_Stream, level?: number/** = undefined*/): void; + + /** + * + * @brief 使用 deflate 算法压缩源流中的数据到流对象中(zlib格式) + * @param src 给定要压缩的数据所在的流 + * @param stm 指定存储压缩数据的流 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * + * + * @async + */ + export function deflateTo(src: Class_Stream, stm: Class_Stream, level?: number/** = undefined*/): void; + + /** + * + * @brief 解压缩 deflate 算法压缩的数据(zlib格式) + * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回解压缩后的二进制数据 + * + * + * @async + */ + export function inflate(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 解压缩 deflate 算法压缩的数据到流对象中(zlib格式) + * @param data 给定要解压缩的数据 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function inflateTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + /** + * + * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(zlib格式) + * @param src 给定要解压缩的数据所在的流 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function inflateTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + /** + * + * @brief 使用 gzip 算法压缩数据 + * @param data 给定要压缩的数据 + * @return 返回压缩后的二进制数据 + * + * + * @async + */ + export function gzip(data: Class_Buffer): Class_Buffer; + + /** + * + * @brief 使用 gzip 算法压缩数据到流对象中 + * @param data 给定要压缩的数据 + * @param stm 指定存储压缩数据的流 + * + * + * @async + */ + export function gzipTo(data: Class_Buffer, stm: Class_Stream): void; + + /** + * + * @brief 使用 gzip 算法压缩源流中的数据到流对象中 + * @param src 给定要压缩的数据所在的流 + * @param stm 指定存储压缩数据的流 + * + * + * @async + */ + export function gzipTo(src: Class_Stream, stm: Class_Stream): void; + + /** + * + * @brief 解压缩 gzip 算法压缩的数据 + * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回解压缩后的二进制数据 + * + * + * @async + */ + export function gunzip(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 解压缩 gzip 算法压缩的数据到流对象中 + * @param data 给定要解压缩的数据 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function gunzipTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + /** + * + * @brief 解压缩源流中 gzip 算法压缩的数据到流对象中 + * @param src 给定要解压缩的数据所在的流 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function gunzipTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + /** + * + * @brief 使用 deflate 算法压缩数据(deflateRaw) + * @param data 给定要压缩的数据 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * @return 返回压缩后的二进制数据 + * + * + * @async + */ + export function deflateRaw(data: Class_Buffer, level?: number/** = undefined*/): Class_Buffer; + + /** + * + * @brief 使用 deflate 算法压缩数据到流对象中(deflateRaw) + * @param data 给定要压缩的数据 + * @param stm 指定存储压缩数据的流 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * + * + * @async + */ + export function deflateRawTo(data: Class_Buffer, stm: Class_Stream, level?: number/** = undefined*/): void; + + /** + * + * @brief 使用 deflate 算法压缩源流中的数据到流对象中(deflateRaw) + * @param src 给定要压缩的数据所在的流 + * @param stm 指定存储压缩数据的流 + * @param level 指定压缩级别,缺省为 DEFAULT_COMPRESSION + * + * + * @async + */ + export function deflateRawTo(src: Class_Stream, stm: Class_Stream, level?: number/** = undefined*/): void; + + /** + * + * @brief 解压缩 deflate 算法压缩的数据(inflateRaw) + * @param data 给定压缩后的数据 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * @return 返回解压缩后的二进制数据 + * + * + * @async + */ + export function inflateRaw(data: Class_Buffer, maxSize?: number/** = -1*/): Class_Buffer; + + /** + * + * @brief 解压缩 deflate 算法压缩的数据到流对象中(inflateRaw) + * @param data 给定要解压缩的数据 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function inflateRawTo(data: Class_Buffer, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + /** + * + * @brief 解压缩源流中 deflate 算法压缩的数据到流对象中(inflateRaw) + * @param src 给定要解压缩的数据所在的流 + * @param stm 指定存储解压缩数据的流 + * @param maxSize 指定解压缩尺寸限制,缺省为 -1,不限制 + * + * + * @async + */ + export function inflateRawTo(src: Class_Stream, stm: Class_Stream, maxSize?: number/** = -1*/): void; + + } /** end of `module zlib` */ + export = zlib +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/declare/zmq.d.ts b/types/fibjs/declare/zmq.d.ts new file mode 100644 index 0000000000..11f119e8f7 --- /dev/null +++ b/types/fibjs/declare/zmq.d.ts @@ -0,0 +1,314 @@ +/*************************************************************************** + * * + * This file was automatically generated with idlc.js * + * build info: * + * - fibjs : 0.25.0 * + * - date : Jun 12 2018 07:22:40 * + * * + ***************************************************************************/ + +/** + * @author Richard + * + */ + + + + + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + +/// + + + +/** module Or Internal Object */ +/** + * @brief zeroMQ 消息队列模块 + * @detail 基础模块。提供 zeroMQ 消息队列支撑。,```JavaScript,var zmq = require('zmq');,``` + */ +declare module "zmq" { + + + module zmq { + + /** + * + * + * + * + */ + export const PAIR = 0; + + /** + * + * @brief 发布类型,所发送的消息将会分发给所有订阅者。 + * + * + */ + export const PUB = 1; + + /** + * + * @brief 订阅类型,用于接收 PUB 分发的消息。 + * + * + */ + export const SUB = 2; + + /** + * + * @brief 请求类型,此类型的接口只允许交替进行 send 和 recv 消息,每一个接受的消息都是最后一次发送请求的响应。 + * + * + */ + export const REQ = 3; + + /** + * + * @brief 响应类型,此类型的接口只允许交替进行 recv 和 send 消息,每一个发送的消息都会作为最后一次接受的请求的回应。 + * + * + */ + export const REP = 4; + + /** + * + * + * + * + */ + export const DEALER = 5; + + /** + * + * + * + * + */ + export const ROUTER = 6; + + /** + * + * @brief 获取消息类型,上游推送的消息将被公平的分发到此类接口。 + * + * + */ + export const PULL = 7; + + /** + * + * @brief 推送类型,推送的消息将均衡发送到下游接口。 + * + * + */ + export const PUSH = 8; + + /** + * + * + * + * + */ + export const XPUB = 9; + + /** + * + * + * + * + */ + export const XSUB = 10; + + + + /** + * + * @brief ZmqSocket 对象,参见 ZmqSocket + * + * + */ + export class Socket extends Class_ZmqSocket {} + + + + + } /** end of `module zmq` */ + export = zmq +} + +/** endof `module Or Internal Object` */ + + diff --git a/types/fibjs/fibjs-tests.ts b/types/fibjs/fibjs-tests.ts new file mode 100644 index 0000000000..90b5f5ff6c --- /dev/null +++ b/types/fibjs/fibjs-tests.ts @@ -0,0 +1,48 @@ +import assert = require('assert'); +import base32 = require('base32'); +import base64 = require('base64'); +import base64vlq = require('base64vlq'); +import bson = require('bson'); +import console = require('console'); +import constants = require('constants'); +import coroutine = require('coroutine'); +import crypto = require('crypto'); +import db = require('db'); +import dgram = require('dgram'); +import dns = require('dns'); +// import encoding = require('encoding'); +import fs = require('fs'); +import gd = require('gd'); +// import global = require('global'); +import gui = require('gui'); +import hash = require('hash'); +import hex = require('hex'); +import http = require('http'); +import iconv = require('iconv'); +import io = require('io'); +import json = require('json'); +import mq = require('mq'); +import net = require('net'); +import os = require('os'); +import path = require('path'); +import path_posix = require('path_posix'); +import path_win32 = require('path_win32'); +import process = require('process'); +import profiler = require('profiler'); +import punycode = require('punycode'); +import querystring = require('querystring'); +import registry = require('registry'); +import ssl = require('ssl'); +import string_decoder = require('string_decoder'); +// import test = require('test'); +import timers = require('timers'); +import tty = require('tty'); +import url = require('url'); +import util = require('util'); +import uuid = require('uuid'); +import vm = require('vm'); +import ws = require('ws'); +import xml = require('xml'); +import zip = require('zip'); +import zlib = require('zlib'); +import zmq = require('zmq'); diff --git a/types/fibjs/index.d.ts b/types/fibjs/index.d.ts new file mode 100644 index 0000000000..02201fd904 --- /dev/null +++ b/types/fibjs/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for fibjs 0.26 +// Project: https://github.com/fibjs/fibjs +// Definitions by: richardo2016 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// diff --git a/types/fibjs/tsconfig.json b/types/fibjs/tsconfig.json new file mode 100644 index 0000000000..c42204e812 --- /dev/null +++ b/types/fibjs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fibjs-tests.ts" + ] +} diff --git a/types/fibjs/tslint.json b/types/fibjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fibjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/figlet/figlet-tests.ts b/types/figlet/figlet-tests.ts new file mode 100644 index 0000000000..676fb9003f --- /dev/null +++ b/types/figlet/figlet-tests.ts @@ -0,0 +1,95 @@ +import figlet = require('figlet'); + +figlet('abc', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet('My World', '1Row', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +// $ExpectError +figlet('fweGWEPewfe', 'What is the font? I cannot get it'); +// $ExpectError +figlet('qweoqw'); +// $ExpectError +figlet('qweoqw', '1Row'); +// $ExpectError +figlet('qweoqw', '1Row', undefined as any, undefined as any); + +figlet.text('tokiyo tomare', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Hi', 'Flower Power', (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Annyeong', { + font: 'Fun Face', + horizontalLayout: 'full', + verticalLayout: 'fitted', +}, (err, str) => { + // $ExpectType Error | null + err; + // $ExpectType string | undefined + str; +}); +figlet.text('Oreehe', { + font: 'Fun Face', + // $ExpectError + value: 'abc', +}, undefined as any); +// $ExpectError +figlet.text('It cannot make sense'); + +// $ExpectType string +figlet.textSync('test text'); +// $ExpectType string +figlet.textSync('text desu', 'Fuzzy'); +// $ExpectType string +figlet.textSync('oho', { + font: 'Invita', +}); +// $ExpectError +figlet.textSync(); + +figlet.metadata('JS Block Letters', (err, fontOptions, headerComment) => { + // $ExpectType Error | null + err; + // $ExpectType FontOptions | undefined + fontOptions; + // $ExpectType string | undefined + headerComment; +}); +// $ExpectError +figlet.metadata('This is random font name which cannot make sense', undefined as any); +// $ExpectError +figlet.metadata('Alligator', undefined as any, undefined as any); + +// $ExpectType Defaults +figlet.defaults(); +// $ExpectType Defaults +figlet.defaults({}); +// $ExpectType Defaults +figlet.defaults({ + font: 'Patorjk\'s Cheese' +}); + +figlet.fonts((err, fonts) => { + // $ExpectType Error | null + err; + // $ExpectType Fonts[] | undefined + fonts; +}); + +// $ExpectType Fonts[] +figlet.fontsSync(); diff --git a/types/figlet/index.d.ts b/types/figlet/index.d.ts new file mode 100644 index 0000000000..07bb706066 --- /dev/null +++ b/types/figlet/index.d.ts @@ -0,0 +1,406 @@ +// Type definitions for figlet 1.2 +// Project: https://github.com/patorjk/figlet.js +// Definitions by: Junyoung Clare Jang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.1 + +declare namespace figlet { + type Fonts = + | '1Row' + | '3-D' + | '3D Diagonal' + | '3D-ASCII' + | '3x5' + | '4Max' + | '5 Line Oblique' + | 'AMC 3 Line' + | 'AMC 3 Liv1' + | 'AMC AAA01' + | 'AMC Neko' + | 'AMC Razor' + | 'AMC Razor2' + | 'AMC Slash' + | 'AMC Slider' + | 'AMC Thin' + | 'AMC Tubes' + | 'AMC Untitled' + | 'ANSI Shadow' + | 'ASCII New Roman' + | 'Acrobatic' + | 'Alligator' + | 'Alligator2' + | 'Alpha' + | 'Alphabet' + | 'Arrows' + | 'Avatar' + | 'B1FF' + | 'B1FF' + | 'Banner' + | 'Banner3-D' + | 'Banner3' + | 'Banner4' + | 'Barbwire' + | 'Basic' + | 'Bear' + | 'Bell' + | 'Benjamin' + | 'Big Chief' + | 'Big Money-ne' + | 'Big Money-nw' + | 'Big Money-se' + | 'Big Money-sw' + | 'Big' + | 'Bigfig' + | 'Binary' + | 'Block' + | 'Blocks' + | 'Bloody' + | 'Bolger' + | 'Braced' + | 'Bright' + | 'Broadway KB' + | 'Broadway' + | 'Bubble' + | 'Bulbhead' + | 'Caligraphy' + | 'Caligraphy2' + | 'Calvin S' + | 'Cards' + | 'Catwalk' + | 'Chiseled' + | 'Chunky' + | 'Coinstak' + | 'Cola' + | 'Colossal' + | 'Computer' + | 'Contessa' + | 'Contrast' + | 'Cosmike' + | 'Crawford' + | 'Crawford2' + | 'Crazy' + | 'Cricket' + | 'Cursive' + | 'Cyberlarge' + | 'Cybermedium' + | 'Cybersmall' + | 'Cygnet' + | 'DANC4' + | 'DOS Rebel' + | 'DWhistled' + | 'Dancing Font' + | 'Decimal' + | 'Def Leppard' + | 'Delta Corps Priest 1' + | 'Diamond' + | 'Diet Cola' + | 'Digital' + | 'Doh' + | 'Doom' + | 'Dot Matrix' + | 'Double Shorts' + | 'Double' + | 'Dr Pepper' + | 'Efti Chess' + | 'Efti Font' + | 'Efti Italic' + | 'Efti Piti' + | 'Efti Robot' + | 'Efti Wall' + | 'Efti Water' + | 'Electronic' + | 'Elite' + | 'Epic' + | 'Fender' + | 'Filter' + | 'Fire Font-k' + | 'Fire Font-s' + | 'Flipped' + | 'Flower Power' + | 'Four Tops' + | 'Fraktur' + | 'Fun Face' + | 'Fun Faces' + | 'Fuzzy' + | 'Georgi16' + | 'Georgia11' + | 'Ghost' + | 'Ghoulish' + | 'Glenyn' + | 'Goofy' + | 'Gothic' + | 'Graceful' + | 'Gradient' + | 'Graffiti' + | 'Greek' + | 'Heart Left' + | 'Heart Right' + | 'Henry 3D' + | 'Hex' + | 'Hieroglyphs' + | 'Hollywood' + | 'Horizontal Left' + | 'Horizontal Right' + | 'ICL-1900' + | 'Impossible' + | 'Invita' + | 'Isometric1' + | 'Isometric2' + | 'Isometric3' + | 'Isometric4' + | 'Italic' + | 'Ivrit' + | 'JS Block Letters' + | 'JS Bracket Letters' + | 'JS Capital Curves' + | 'JS Cursive' + | 'JS Stick Letters' + | 'Jacky' + | 'Jazmine' + | 'Jerusalem' + | 'Katakana' + | 'Kban' + | 'Keyboard' + | 'Knob' + | 'Konto Slant' + | 'Konto' + | 'LCD' + | 'Larry 3D 2' + | 'Larry 3D' + | 'Lean' + | 'Letters' + | 'Lil Devil' + | 'Line Blocks' + | 'Linux' + | 'Lockergnome' + | 'Madrid' + | 'Marquee' + | 'Maxfour' + | 'Merlin1' + | 'Merlin2' + | 'Mike' + | 'Mini' + | 'Mirror' + | 'Mnemonic' + | 'Modular' + | 'Morse' + | 'Morse2' + | 'Moscow' + | 'Mshebrew210' + | 'Muzzle' + | 'NScript' + | 'NT Greek' + | 'NV Script' + | 'Nancyj-Fancy' + | 'Nancyj-Improved' + | 'Nancyj-Underlined' + | 'Nancyj' + | 'Nipples' + | 'O8' + | 'OS2' + | 'Octal' + | 'Ogre' + | 'Old Banner' + | 'Patorjk\'s Cheese' + | 'Patorjk-HeX' + | 'Pawp' + | 'Peaks Slant' + | 'Peaks' + | 'Pebbles' + | 'Pepper' + | 'Poison' + | 'Puffy' + | 'Puzzle' + | 'Pyramid' + | 'Rammstein' + | 'Rectangles' + | 'Red Phoenix' + | 'Relief' + | 'Relief2' + | 'Reverse' + | 'Roman' + | 'Rot13' + | 'Rot13' + | 'Rotated' + | 'Rounded' + | 'Rowan Cap' + | 'Rozzo' + | 'Runic' + | 'Runyc' + | 'S Blood' + | 'SL Script' + | 'Santa Clara' + | 'Script' + | 'Serifcap' + | 'Shadow' + | 'Shimrod' + | 'Short' + | 'Slant Relief' + | 'Slant' + | 'Slide' + | 'Small Caps' + | 'Small Isometric1' + | 'Small Keyboard' + | 'Small Poison' + | 'Small Script' + | 'Small Shadow' + | 'Small Slant' + | 'Small Tengwar' + | 'Small' + | 'Soft' + | 'Speed' + | 'Spliff' + | 'Stacey' + | 'Stampate' + | 'Stampatello' + | 'Standard' + | 'Star Strips' + | 'Star Wars' + | 'Stellar' + | 'Stforek' + | 'Stick Letters' + | 'Stop' + | 'Straight' + | 'Stronger Than All' + | 'Sub-Zero' + | 'Swamp Land' + | 'Swan' + | 'Sweet' + | 'THIS' + | 'Tanja' + | 'Tengwar' + | 'Term' + | 'Test1' + | 'The Edge' + | 'Thick' + | 'Thin' + | 'Thorned' + | 'Three Point' + | 'Ticks Slant' + | 'Ticks' + | 'Tiles' + | 'Tinker-Toy' + | 'Tombstone' + | 'Train' + | 'Trek' + | 'Tsalagi' + | 'Tubular' + | 'Twisted' + | 'Two Point' + | 'USA Flag' + | 'Univers' + | 'Varsity' + | 'Wavy' + | 'Weird' + | 'Wet Letter' + | 'Whimsy' + | 'Wow' + ; + + type KerningMethods = + | 'default' + | 'full' + | 'fitted' + | 'controlled smushing' + | 'universal smushing' + ; + type PrintDirection = number; + + interface FittingRules { + vLayout: number; + vRule5: boolean; + vRule4: boolean; + vRule3: boolean; + vRule2: boolean; + vRule1: boolean; + hLayout: number; + hRule6: boolean; + hRule5: boolean; + hRule4: boolean; + hRule3: boolean; + hRule2: boolean; + hRule1: boolean; + } + + interface Options { + font?: Fonts; + horizontalLayout?: KerningMethods; + verticalLayout?: KerningMethods; + printDirection?: PrintDirection; + showHardBlanks?: boolean; + } + interface FontOptions { + hardBlank: string; + height: number; + baseline: number; + maxLength: number; + oldLayout: number; + numCommentLines: number; + printDirection: PrintDirection; + fullLayout: number | null; + codeTagCount: number | null; + fittingRules: FittingRules; + } + interface Defaults { + font: Fonts; + fontPath: string; + } + + function text(txt: string, cb: (error: Error | null, result?: string) => void): void; + function text(txt: string, font: Fonts, cb: (error: Error | null, result?: string) => void): void; + /** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ + // tslint:disable-next-line: unified-signatures + function text(txt: string, options: Options | undefined, cb: (error: Error | null, result?: string) => void): void; + + function textSync(txt: string, font?: Fonts): string; + /** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ + // tslint:disable-next-line: unified-signatures + function textSync(txt: string, options: Options): string; + + function metadata(font: Fonts, cb: (error: Error | null, fontOptions?: FontOptions, headerComment?: string) => void): void; + + function defaults(opt?: Partial): Defaults; + + function loadFont(font: Fonts, cb: (error: Error | null, fontOptions?: FontOptions) => void): void; + /** + * @todo + * Use 'node' namespace to add following methods only in node environment. + */ + /** + * @warn + * This method works in node environment only. + * In browser environment, this method does not work. + */ + function loadFontSync(font: Fonts): FontOptions; + /** + * @warn + * This method exists in node environment only. + * In browser environment, this method does not exist. + */ + function fonts(cb: (error: Error | null, fontList?: Fonts[]) => void): void; + /** + * @warn + * This method exists in node environment only. + * In browser environment, this method does not exist. + */ + function fontsSync(): Fonts[]; +} + +declare function figlet(txt: string, cb: (error: Error | null, result?: string) => void): void; +declare function figlet(txt: string, font: figlet.Fonts, cb: (error: Error | null, result?: string) => void): void; +/** + * @desc + * This `unified-signatures` is disabled because `Fonts` type is too long + */ +// tslint:disable-next-line: unified-signatures +declare function figlet(txt: string, options: figlet.Options | undefined, cb: (error: Error | null, result?: string) => void): void; + +export as namespace figlet; +export = figlet; diff --git a/types/figlet/tsconfig.json b/types/figlet/tsconfig.json new file mode 100644 index 0000000000..946bec6c7d --- /dev/null +++ b/types/figlet/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "figlet-tests.ts" + ] +} diff --git a/types/figlet/tslint.json b/types/figlet/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/figlet/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/find-parent-dir/find-parent-dir-tests.ts b/types/find-parent-dir/find-parent-dir-tests.ts new file mode 100644 index 0000000000..31b3307377 --- /dev/null +++ b/types/find-parent-dir/find-parent-dir-tests.ts @@ -0,0 +1,19 @@ +/// + +import findParentDir = require("find-parent-dir"); + +let parentDir: string | null; + +findParentDir(__dirname, ".git", (err, dir) => { + if (err) { + console.error("error", err); + } else { + parentDir = dir; + } +}); + +try { + parentDir = findParentDir.sync(__dirname, ".git"); +} catch (err) { + console.error("error", err); +} diff --git a/types/find-parent-dir/index.d.ts b/types/find-parent-dir/index.d.ts new file mode 100644 index 0000000000..0302255198 --- /dev/null +++ b/types/find-parent-dir/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for find-parent-dir 0.3 +// Project: https://github.com/thlorenz/find-parent-dir +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the first parent directory that contains a given file or directory. + */ +declare function findParentDir( + currentFullPath: string, + clue: string, + cb: (err: any, dir: string | null) => void +): void; + +declare namespace findParentDir { + function sync(currentFullPath: string, clue: string): string | null; +} + +export = findParentDir; diff --git a/types/find-parent-dir/tsconfig.json b/types/find-parent-dir/tsconfig.json new file mode 100644 index 0000000000..83c817d86c --- /dev/null +++ b/types/find-parent-dir/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-parent-dir-tests.ts"] +} diff --git a/types/find-parent-dir/tslint.json b/types/find-parent-dir/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-parent-dir/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/find-project-root/find-project-root-tests.ts b/types/find-project-root/find-project-root-tests.ts new file mode 100644 index 0000000000..b77d7846d0 --- /dev/null +++ b/types/find-project-root/find-project-root-tests.ts @@ -0,0 +1,7 @@ +/// + +import findProjectRoot = require("find-project-root"); + +const root: string | null = findProjectRoot(process.cwd(), { + maxDepth: 12 +}); diff --git a/types/find-project-root/index.d.ts b/types/find-project-root/index.d.ts new file mode 100644 index 0000000000..a541c1f982 --- /dev/null +++ b/types/find-project-root/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for find-project-root 1.1 +// Project: https://github.com/kirstein/find-project-root +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Finds the project root by custom markers + */ +declare function findProjectRoot( + path: string, + options?: findProjectRoot.Options +): null | string; + +declare namespace findProjectRoot { + interface Options { + /** + * total number of levels the algorithm can traverse + */ + maxDepth?: number; + /** + * markers that it will search for + */ + markers?: string[]; + } +} + +export = findProjectRoot; diff --git a/types/find-project-root/tsconfig.json b/types/find-project-root/tsconfig.json new file mode 100644 index 0000000000..1e727f9025 --- /dev/null +++ b/types/find-project-root/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "find-project-root-tests.ts"] +} diff --git a/types/find-project-root/tslint.json b/types/find-project-root/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/find-project-root/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/find/find-tests.ts b/types/find/find-tests.ts index c6c1cd04f5..3ca401f69a 100644 --- a/types/find/find-tests.ts +++ b/types/find/find-tests.ts @@ -16,9 +16,9 @@ find.file(regexPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); find.fileSync(rootDir); // $ExpectType string[] find.fileSync(stringPattern, rootDir); // $ExpectType string[] find.fileSync(regexPattern, rootDir); // $ExpectType string[] -find.eachFile(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachFile(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachFile(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachfile(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(emptyCb); // $ExpectType void find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void @@ -27,6 +27,6 @@ find.dir(rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType find.dirSync(rootDir); // $ExpectType string[] find.dirSync(stringPattern, rootDir); // $ExpectType string[] find.dirSync(regexPattern, rootDir); // $ExpectType string[] -find.eachDir(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachDir(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream -find.eachDir(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachdir(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream diff --git a/types/find/index.d.ts b/types/find/index.d.ts index 61166669db..1ffb2f8aee 100644 --- a/types/find/index.d.ts +++ b/types/find/index.d.ts @@ -45,7 +45,7 @@ export function file(pattern: string | RegExp, root: string, callback: (files: s * @param root The root directory * @param callback A callback that accepts each file separately */ -export function eachFile(root: string, callback: (file: string) => void): FindEachStream; +export function eachfile(root: string, callback: (file: string) => void): FindEachStream; /** * Find all files that match a glob pattern in a given directory asynchronously. @@ -53,7 +53,7 @@ export function eachFile(root: string, callback: (file: string) => void): FindEa * @param root The root directory * @param callback A callback that accepts an array of the found files */ -export function eachFile(pattern: string | RegExp, root: string, callback: (file: string) => void): FindEachStream; +export function eachfile(pattern: string | RegExp, root: string, callback: (file: string) => void): FindEachStream; /** * Find all files in a given directory synchronously. @@ -105,7 +105,7 @@ export function dirSync(pattern: string | RegExp, root: string): string[]; * @param root The root directory * @param callback A callback that accepts each of the found directories separately */ -export function eachDir(root: string, callback: (directory: string) => void): FindEachStream; +export function eachdir(root: string, callback: (directory: string) => void): FindEachStream; /** * Find all directories that match a glob pattern in a given directory asynchronously. @@ -113,4 +113,4 @@ export function eachDir(root: string, callback: (directory: string) => void): Fi * @param root The root directory * @param callback A callback that accepts each of the found directories separately */ -export function eachDir(pattern: string | RegExp, root: string, callback: (directory: string) => void): FindEachStream; +export function eachdir(pattern: string | RegExp, root: string, callback: (directory: string) => void): FindEachStream; diff --git a/types/fixed-data-table-2/fixed-data-table-2-tests.tsx b/types/fixed-data-table-2/fixed-data-table-2-tests.tsx index 3b34d6a44a..754b8e86e8 100644 --- a/types/fixed-data-table-2/fixed-data-table-2-tests.tsx +++ b/types/fixed-data-table-2/fixed-data-table-2-tests.tsx @@ -46,19 +46,15 @@ interface MyTable3State { } class MyTable3 extends React.Component<{}, MyTable3State> { - constructor(props: {}) { - super(props); - - this.state = { - myTableData: [ - { name: "Rylan" }, - { name: "Amelia" }, - { name: "Estevan" }, - { name: "Florence" }, - { name: "Tressa" }, - ] - }; - } + state = { + myTableData: [ + { name: "Rylan" }, + { name: "Amelia" }, + { name: "Estevan" }, + { name: "Florence" }, + { name: "Tressa" }, + ] + }; render() { return ( @@ -130,18 +126,15 @@ interface MyTable4State { } class MyTable4 extends React.Component<{}, MyTable4State> { - constructor(props: {}) { - super(props); - this.state = { - tableData: [ - { name: "Rylan", email: "Angelita_Weimann42@gmail.com" }, - { name: "Amelia", email: "Dexter.Trantow57@hotmail.com" }, - { name: "Estevan", email: "Aimee7@hotmail.com" }, - { name: "Florence", email: "Jarrod.Bernier13@yahoo.com" }, - { name: "Tressa", email: "Yadira1@hotmail.com" } - ] - }; - } + state = { + tableData: [ + { name: "Rylan", email: "Angelita_Weimann42@gmail.com" }, + { name: "Amelia", email: "Dexter.Trantow57@hotmail.com" }, + { name: "Estevan", email: "Aimee7@hotmail.com" }, + { name: "Florence", email: "Jarrod.Bernier13@yahoo.com" }, + { name: "Tressa", email: "Yadira1@hotmail.com" } + ] + }; render() { return ( diff --git a/types/fixed-data-table-2/index.d.ts b/types/fixed-data-table-2/index.d.ts index 0b844ec194..16b0c0f3c5 100644 --- a/types/fixed-data-table-2/index.d.ts +++ b/types/fixed-data-table-2/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/schrodinger/fixed-data-table-2 // Definitions by: Ilya Petukhov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as React from "react"; diff --git a/types/fixed-data-table/fixed-data-table-tests.tsx b/types/fixed-data-table/fixed-data-table-tests.tsx index bb09fedcaf..758b33d2a2 100644 --- a/types/fixed-data-table/fixed-data-table-tests.tsx +++ b/types/fixed-data-table/fixed-data-table-tests.tsx @@ -41,19 +41,15 @@ interface MyTable3State { class MyTable3 extends React.Component<{}, MyTable3State> { - constructor(props: {}) { - super(props); - - this.state = { - myTableData: [ - {name: "Rylan"}, - {name: "Amelia"}, - {name: "Estevan"}, - {name: "Florence"}, - {name: "Tressa"}, - ] - }; - } + state = { + myTableData: [ + {name: "Rylan"}, + {name: "Amelia"}, + {name: "Estevan"}, + {name: "Florence"}, + {name: "Tressa"}, + ] + }; render(): React.ReactElement { return ( @@ -127,18 +123,15 @@ interface MyTable4State { class MyTable4 extends React.Component<{}, MyTable4State> { - constructor(props: {}) { - super(props); - this.state = { - tableData: [ - {name: "Rylan", email: "Angelita_Weimann42@gmail.com"}, - {name: "Amelia", email: "Dexter.Trantow57@hotmail.com"}, - {name: "Estevan", email: "Aimee7@hotmail.com"}, - {name: "Florence", email: "Jarrod.Bernier13@yahoo.com"}, - {name: "Tressa", email: "Yadira1@hotmail.com"} - ] - }; - } + state = { + tableData: [ + {name: "Rylan", email: "Angelita_Weimann42@gmail.com"}, + {name: "Amelia", email: "Dexter.Trantow57@hotmail.com"}, + {name: "Estevan", email: "Aimee7@hotmail.com"}, + {name: "Florence", email: "Jarrod.Bernier13@yahoo.com"}, + {name: "Tressa", email: "Yadira1@hotmail.com"} + ] + }; render(): React.ReactElement { return ( diff --git a/types/fixed-data-table/index.d.ts b/types/fixed-data-table/index.d.ts index c8ee33a2a1..4c0b7f176f 100644 --- a/types/fixed-data-table/index.d.ts +++ b/types/fixed-data-table/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/facebook/fixed-data-table // Definitions by: Petar Paar , Stephen Jelfs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// diff --git a/types/flatbuffers/index.d.ts b/types/flatbuffers/index.d.ts index b95741200b..bd74387bf2 100644 --- a/types/flatbuffers/index.d.ts +++ b/types/flatbuffers/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for flatbuffers 1.6 +// Type definitions for flatbuffers 1.9 // Project: http://google.github.io/flatbuffers/index.html // Definitions by: Kamil Rojewski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,7 +10,7 @@ declare global { type Offset = number; interface Table { - bb: ByteBuffer; + bb: ByteBuffer|null; bb_pos: number; } @@ -241,6 +241,8 @@ declare global { writeFloat32(offset: number, value: number): void; writeFloat64(offset: number, value: number): void; + getBufferIdentifier(): string; + /** * Look up a field in the vtable, return an offset into the object, or 0 if the * field is not present. diff --git a/types/flight/flight-tests.ts b/types/flight/flight-tests.ts index bd2f22d1c3..dd21f32f48 100644 --- a/types/flight/flight-tests.ts +++ b/types/flight/flight-tests.ts @@ -1,6 +1,6 @@ declare var el: Element; -declare var els: Element[]; +declare var els: HTMLElement[]; declare var mixinFn: Function; function TestComponent() { diff --git a/types/flush-write-stream/flush-write-stream-tests.ts b/types/flush-write-stream/flush-write-stream-tests.ts new file mode 100644 index 0000000000..3f308d2f88 --- /dev/null +++ b/types/flush-write-stream/flush-write-stream-tests.ts @@ -0,0 +1,18 @@ +import writer = require("flush-write-stream"); + +const stream = writer(write, flush); + +stream.on("finish", () => console.log("finished")); + +stream.write("hello"); +stream.write("world"); +stream.end(); + +function write(data: any, encoding: string, callback: (error?: Error) => void): void { + console.log("Writing", data.toString()); + callback(); +} + +function flush(callback: (error?: Error) => void): void { + setTimeout(callback, 1000); +} diff --git a/types/flush-write-stream/index.d.ts b/types/flush-write-stream/index.d.ts new file mode 100644 index 0000000000..3faae23da2 --- /dev/null +++ b/types/flush-write-stream/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for flush-write-stream 1.0 +// Project: https://github.com/mafintosh/flush-write-stream +// Definitions by: Daniel Cassidy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Writable, WritableOptions } from "stream"; + +type Callback = (error?: Error) => void; +type Write = (chunk: any, encoding: string, callback: Callback) => void; +type Flush = (callback: Callback) => void; + +declare const WriteStream: { + (opts: WritableOptions, write: Write, flush?: Flush): Writable; + (write: Write, flush?: Flush): Writable; + new(opts: WritableOptions, write: Write, flush?: Flush): Writable; + new(write: Write, flush?: Flush): Writable; + obj(opts: WritableOptions, write: Write, flush?: Flush): Writable; + obj(write: Write, flush?: Flush): Writable; +}; + +export = WriteStream; diff --git a/types/flush-write-stream/tsconfig.json b/types/flush-write-stream/tsconfig.json new file mode 100644 index 0000000000..95d5eca832 --- /dev/null +++ b/types/flush-write-stream/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "flush-write-stream-tests.ts" + ] +} diff --git a/types/flush-write-stream/tslint.json b/types/flush-write-stream/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/flush-write-stream/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/flux/index.d.ts b/types/flux/index.d.ts index ffc0330228..cafb6a5a0b 100644 --- a/types/flux/index.d.ts +++ b/types/flux/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Steve Baker // Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import Dispatcher = require("./lib/Dispatcher"); diff --git a/types/fluxible-router/index.d.ts b/types/fluxible-router/index.d.ts index 2dea024107..097c2b3c2d 100644 --- a/types/fluxible-router/index.d.ts +++ b/types/fluxible-router/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/yahoo/fluxible#readme // Definitions by: xbim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 /// import * as React from 'react'; import { FluxibleContext } from 'fluxible'; diff --git a/types/fluxxor/index.d.ts b/types/fluxxor/index.d.ts index 3457dba949..191332fa7a 100644 --- a/types/fluxxor/index.d.ts +++ b/types/fluxxor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/BinaryMuse/fluxxor // Definitions by: Yuichi Murata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 import * as EventEmitter3 from 'eventemitter3'; import * as React from "react"; diff --git a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts b/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts deleted file mode 100644 index 78ead793b4..0000000000 --- a/types/fork-ts-checker-webpack-plugin/fork-ts-checker-webpack-plugin-tests.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Configuration } from 'webpack'; -import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; - -let config: Configuration = { - plugins: [ - new ForkTsCheckerWebpackPlugin() - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({}) - ] -}; - -config = { - plugins: [ - new ForkTsCheckerWebpackPlugin({ - vue: true - }) - ] -}; - -export default config; diff --git a/types/fork-ts-checker-webpack-plugin/index.d.ts b/types/fork-ts-checker-webpack-plugin/index.d.ts deleted file mode 100644 index ace3db5b24..0000000000 --- a/types/fork-ts-checker-webpack-plugin/index.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Type definitions for fork-ts-checker-webpack-plugin 0.4 -// Project: https://github.com/Realytics/fork-ts-checker-webpack-plugin#readme -// Definitions by: JounQin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -import { RuleFailure } from 'tslint'; -import { Diagnostic } from 'typescript'; -import { Plugin } from 'webpack'; - -declare namespace ForkTsCheckerWebpackPlugin { - type ErrorType = 'diagnostic' | 'lint'; - type Severity = 'error' | 'warning'; - - interface NormalizedMessageJson { - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - } - - class NormalizedMessage { - static TYPE_DIAGNOSTIC: ErrorType; - static TYPE_LINT: ErrorType; - static SEVERITY_ERROR: Severity; - static SEVERITY_WARNING: Severity; - type: ErrorType; - code: string | number; - severity: Severity; - content: string; - file: string; - line: number; - character: number; - constructor(data: NormalizedMessageJson); - static createFromDiagnostic(diagnostic: Diagnostic): NormalizedMessage; - static createFromLint(lint: RuleFailure): NormalizedMessage; - static createFromJSON(json: NormalizedMessageJson): NormalizedMessage; - static compare( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): number; - static equals( - messageA: NormalizedMessage, - messageB: NormalizedMessage, - ): boolean; - static deduplicate(messages: NormalizedMessage[]): NormalizedMessage[]; - static compareTypes(typeA: ErrorType, typeB: ErrorType): number; - static compareSeverities( - severityA: Severity, - severityB: Severity, - ): number; - static compareOptionalStrings(stringA: string, stringB: string): number; - static compareNumbers(numberA: number, numberB: number): number; - toJSON(): NormalizedMessageJson; - getType(): ErrorType; - isDiagnosticType(): boolean; - isLintType(): boolean; - getCode(): string | number; - getFormattedCode(): string | number; - getSeverity(): Severity; - isErrorSeverity(): boolean; - isWarningSeverity(): boolean; - getContent(): string; - getFile(): string; - getLine(): number; - getCharacter(): number; - } - - type Formatter = (message: NormalizedMessage, useColors: boolean) => string; - - interface Options { - tsconfig?: string; - tslint?: string | true; - watch?: string | string[]; - async?: boolean; - ignoreDiagnostics?: number[]; - ignoreLints?: string[]; - colors?: boolean; - logger?: Console; - formatter?: 'default' | 'codeframe' | Formatter; - formatterOptions?: { - highlightCode?: boolean - linesAbove?: number - linesBelow?: number - forceColor?: boolean - }; - silent?: boolean; - checkSyntacticErrors?: boolean; - memoryLimit?: number; - workers?: number; - vue?: boolean; - } -} - -declare class ForkTsCheckerWebpackPlugin extends Plugin { - constructor(options?: ForkTsCheckerWebpackPlugin.Options); -} - -export = ForkTsCheckerWebpackPlugin; diff --git a/types/form-serialize/form-serialize-tests.ts b/types/form-serialize/form-serialize-tests.ts new file mode 100644 index 0000000000..42b587dd80 --- /dev/null +++ b/types/form-serialize/form-serialize-tests.ts @@ -0,0 +1,17 @@ +import serialize = require("form-serialize"); + +const form = document.createElement("form"); +serialize(form, { hash: true }); // $ExpectType ResultHash +serialize(form, true); // $ExpectType ResultHash +serialize(form, { hash: false }); // $ExpectType string +serialize(form, false); // $ExpectType string +serialize(form); // $ExpectType string + +interface CustomResult { + foo: string; +} + +// $ExpectType CustomResult +serialize(form, { + serializer: (): CustomResult => ({ foo: "bar" }) +}); diff --git a/types/form-serialize/index.d.ts b/types/form-serialize/index.d.ts new file mode 100644 index 0000000000..b433f6b81b --- /dev/null +++ b/types/form-serialize/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for form-serialize 0.7 +// Project: https://github.com/defunctzombie/form-serialize#readme +// Definitions by: Tyler Johnson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface ResultHash { + [key: string]: string | string[] | ResultHash; +} + +interface Options { + /** Configure the output type. If true, the output will be a js object. */ + hash?: boolean; + /** + * Optional serializer function to override the default one. The function takes 3 arguments (result, key, + * value) and should return new result hash and url encoded str serializers are provided with this module + */ + serializer?: (result: Result, key: string, value: string) => Result; + /** If true serialize disabled fields. */ + disabled?: boolean; + /** If true serialize empty fields */ + empty?: boolean; +} + +interface OptionsHash extends Options { + hash: true; +} + +interface OptionsString extends Options { + hash: false; +} + +declare function serialize(form: HTMLFormElement, options: OptionsHash | true): ResultHash; +declare function serialize(form: HTMLFormElement, options?: OptionsString | false): string; +declare function serialize(form: HTMLFormElement, options?: Options | boolean): Result; + +export = serialize; diff --git a/types/form-serialize/tsconfig.json b/types/form-serialize/tsconfig.json new file mode 100644 index 0000000000..b37dff4ca2 --- /dev/null +++ b/types/form-serialize/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "form-serialize-tests.ts" + ] +} diff --git a/types/form-serialize/tslint.json b/types/form-serialize/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/form-serialize/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/frctl__fractal/frctl__fractal-tests.ts b/types/frctl__fractal/frctl__fractal-tests.ts new file mode 100644 index 0000000000..b641563a45 --- /dev/null +++ b/types/frctl__fractal/frctl__fractal-tests.ts @@ -0,0 +1,198 @@ +// Source: https://fractal.build/guide + +/* Create a new Fractal instance and export it for use elsewhere if required */ +import { create } from '@frctl/fractal'; + +const fractal = create(); + +/* Set the title of the project */ +fractal.set('project.title', 'FooCorp Component Library'); +fractal.set('project.version', 'v1.0'); +fractal.set('project.author', 'Mickey Mouse'); + +/* Tell Fractal where the components will live */ +fractal.components.set('path', __dirname + '/src/components'); + +/* Tell Fractal where the documentation pages will live */ +fractal.docs.set('path', __dirname + '/src/docs'); + +/* Specify a directory of static assets */ +fractal.web.set('static.path', __dirname + '/public'); + +/* Set the static HTML build destination */ +fractal.web.set('builder.dest', __dirname + '/build'); + +// Source: https://fractal.build/guide/components/configuration + +fractal.components.set('default.collated', true); +fractal.components.set('default.collator', (markup: string, item: any) => { + return `\n${markup}\n\n`; +}); +fractal.components.set('default.context', { + 'site-name': 'FooCorp' +}); +fractal.components.set('default.display', { + 'max-width': '400px' +}); +fractal.components.set('default.prefix', 'foobar'); +fractal.components.set('default.preview', '@my-preview-layout'); +fractal.components.set('default.status', 'wip'); +fractal.components.set('ext', '.handlebars'); +fractal.components.set('label', 'Patterns'); +fractal.components.set('path', __dirname + '/src/components'); +fractal.components.set('statuses', { + doing: { + label: "Doing", + description: "I'm doing it.", + color: '#F00' + }, + done: { + label: "Done", + description: "I'm done with this.", + color: "green" + } +}); +fractal.components.set('title', 'Patterns'); +fractal.components.set('yield', 'rendered_content'); + +// Source: https://fractal.build/guide/docs/configuration + +fractal.docs.set('default.context', { + 'site-name': 'FooCorp' +}); +fractal.docs.set('default.prefix', 'foobar'); +fractal.docs.set('default.status', 'wip'); +fractal.docs.set('ext', '.html'); +fractal.docs.set('indexLabel', 'Listing'); +fractal.docs.set('label', 'Pages'); +fractal.docs.set('markdown', false); +fractal.docs.set('markdown.smartypants', false); +fractal.docs.set('path', __dirname + '/src/docs'); +fractal.docs.set('statuses', { + doing: { + label: "Doing", + description: "I'm doing it.", + color: '#F00' + }, + done: { + label: "Done", + description: "I'm done with this.", + color: "green" + } +}); +fractal.docs.set('title', 'Pages'); + +// Source: https://fractal.build/guide/web/configuration + +fractal.web.set('builder.concurrency', 5); +fractal.web.set('builder.dest', __dirname + '/export'); +fractal.web.set('builder.ext', '.php'); +fractal.web.set('builder.urls.ext', null); +fractal.web.set('server.sync', true); +fractal.web.set('server.syncOptions', { + open: true, + browser: ['google chrome', 'firefox'], + notify: true +}); +fractal.web.set('server.port', 4444); +fractal.web.set('server.watch', true); +fractal.web.set('static.path', __dirname + '/public'); +fractal.web.set('static.mount', 'project-assets'); + +// Source: https://fractal.build/guide/cli/custom-commands + +{ + const config = { + description: 'Lists components in the project' + }; + + fractal.cli.command('list-components', function(args, done) { + const app = this.fractal; + for (const item of app.components.flatten()) { + this.log(`${item.handle} - ${item.status.label}`); + } + done(); + }, config); +} + +fractal.cli.exec('list-components'); + +fractal.cli.command('foo [optionalArg] [anotherOptionalArg]', (args, done) => { + console.log(args.requiredArg); + done(); +}); + +{ + const config = { + options: [ + ['-p, --port ', 'The port to use.'], + ] + }; + + fractal.cli.command('foo', (args, done) => { + // do something + console.log(`Something was started on port ${args.options.port}`); + done(); + }, config); +} + +// Source: https://fractal.build/guide/integration/build-tools + +import * as gulp from 'gulp'; +{ + /* + * Configure a Fractal instance. + * + * This configuration could also be done in a separate file, provided that this file + * then imported the configured fractal instance from it to work with in your Gulp tasks. + * i.e. const fractal = require('./my-fractal-config-file'); + */ + + fractal.set('project.title', 'FooCorp Component Library'); // title for the project + fractal.web.set('builder.dest', 'build'); // destination for the static export + fractal.docs.set('path', `${__dirname}/docs`); // location of the documentation directory. + fractal.components.set('path', `${__dirname}/components`); // location of the component directory. + + // any other configuration or customisation here + + const logger = fractal.cli.console; // keep a reference to the fractal CLI console utility + + /* + * Start the Fractal server + * + * In this example we are passing the option 'sync: true' which means that it will + * use BrowserSync to watch for changes to the filesystem and refresh the browser automatically. + * Obviously this is completely optional! + * + * This task will also log any errors to the console. + */ + + gulp.task('fractal:start', () => { + const server = fractal.web.server({ + sync: true + }); + server.on('error', err => logger.error(err.message)); + return server.start().then(() => { + logger.success(`Fractal server is now running at ${server.url}`); + }); + }); + + /* + * Run a static export of the project web UI. + * + * This task will report on progress using the 'progress' event emitted by the + * builder instance, and log any errors to the terminal. + * + * The build destination will be the directory specified in the 'builder.dest' + * configuration option set above. + */ + + gulp.task('fractal:build', () => { + const builder = fractal.web.builder(); + builder.on('progress', (completed, total) => logger.update(`Exported ${completed} of ${total} items`, 'info')); + builder.on('error', err => logger.error(err.message)); + return builder.build().then(() => { + logger.success('Fractal build completed!'); + }); + }); +} diff --git a/types/frctl__fractal/index.d.ts b/types/frctl__fractal/index.d.ts new file mode 100644 index 0000000000..8e88f82948 --- /dev/null +++ b/types/frctl__fractal/index.d.ts @@ -0,0 +1,700 @@ +// Type definitions for @frctl/fractal 1.x +// Project: https://github.com/frctl/fractal +// Definitions by: Phil McCloghry-Laing +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EventEmitter } from 'events'; +import { Stats as FileStats } from 'fs'; +import { Server as HttpServer } from 'http'; +import { Readable as ReadableStream } from 'stream'; +import * as VinylFile from 'vinyl'; + +export namespace fractal { + namespace core { + interface StatusInfo { + label: string; + description?: string; + color?: string; + } + namespace entities { + abstract class Entity extends mixins.Entity { + readonly isComponent?: true; + readonly isCollection?: true; + readonly isDoc?: true; + readonly isVariant?: true; + readonly status: StatusInfo; + getResolvedContext(): any; + hasContext(): Promise; + setContext(data: any): void; + getContext(): any; + toJSON(): {}; + } + interface EntitySource extends mixins.Source { + entities(): T[]; + + engine(adapterFactory?: string | { + register(source: EntitySource, app: any): Adapter; + } | (() => ({ + register(source: EntitySource, app: any): Adapter; + }))): Adapter; + + getProp(key: string): string | {}; + statusInfo(handle: string): StatusInfo | null; + toJSON(): {}; + } + interface EntityCollection extends mixins.Entity, mixins.Collection { + readonly entities: this; + toJSON(): {}; + } + } + + namespace mixins { + abstract class Configurable { + config(): T; + config(config: T): this; + set(path: K, value: T[K] | null): this; + get(path: K, defaultValue?: V): T[K] | V | null | undefined; + } + /** + * Combined EventEmitter and Configurable mixins + */ + abstract class ConfigurableEmitter extends EventEmitter { } + interface ConfigurableEmitter extends Configurable { } + interface Collection { + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: true; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + readonly size: number; + readonly items: T[]; + toArray(): T[]; + setItems(items: T[]): this; + pushItem(item: T): this; + removeItem(item: T): this; + toJSON(): {}; + toStream(): ReadableStream; + each(fn: (item: T) => void): this; + forEach(fn: (item: T) => void): this; + map(fn: (item: T) => T): this; + first(): T | undefined; + last(): T | undefined; + eq(pos: number): T | undefined; + collections(): this; + orderBy(): this; + find(handle: string): T; + find(name: TKey, value: T[TKey]): T; + findCollection(handle: string): Collection; + findCollection(name: TKey, value: T[TKey]): Collection; + flatten(): this; + flattenDeep(): this; + squash(): this; + filter(handle: string): T[]; + filter(name: TKey, value: T[TKey]): T[]; + filterItems(items: T[], handle: string): T[]; + filterItems(items: T[], name: TKey, value: T[TKey]): T[]; + flattenItems(items: T[], deep?: boolean): T[]; + squashItems(items: T[]): T[]; + newSelf(items: T[]): this; + [Symbol.iterator](): IterableIterator; + } + abstract class Entity { + initEntity(name: string, config: any, parent: Entity): void; + name: string; + handle: string; + label: string; + title: string; + order: number; + id: string; + config: any; + readonly alias: string | null; + readonly source: entities.EntitySource; + readonly parent: Entity; + readonly isHidden: boolean; + toJSON(): {}; + } + interface Source extends ConfigurableEmitter, Collection { + readonly label: string; + readonly title: string; + readonly source: this; + readonly isWatching: boolean; + readonly fullPath: string | null; + readonly relPath: string; + toStream(): ReadableStream; + exists(): boolean; + load(force?: boolean): Promise; + refresh(): Promise; + watch(): void; + unwatch(): void; + isConfig(file: string): boolean; + } + } + } + + namespace api { + namespace assets { + class Asset extends core.entities.Entity { + readonly isAsset: true; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + toVinyl(): VinylFile; + } + interface AssetCollection extends core.entities.EntityCollection { + assets(): this; + toVinylArray(): VinylFile[]; + } + interface AssetSource extends core.mixins.Source { + assets(): VinylFile[]; + toVinylArray(): VinylFile[]; + toVinylStream(): ReadableStream; + gulpify(): ReadableStream; + } + interface AssetSourceCollection extends core.mixins.ConfigurableEmitter { + readonly label: string; + readonly title: string; + add(name: string, config: any): AssetSource; + remove(name: string): this; + find(name: string): AssetSource | undefined; + sources(): AssetSource[]; + toArray(): AssetSource[]; + visible(): AssetSource[]; + watch(): this; + unwatch(): this; + load(): Promise; + toJSON(): {}; + [Symbol.iterator](): IterableIterator; + } + } + + namespace components { + class Component extends core.entities.Entity { + constructor(config: {}, files: files.FileCollection, resources: assets.AssetCollection, parent: core.entities.Entity); + readonly isAsset: undefined; + readonly isComponent: true; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: undefined; + readonly isVariant: undefined; + defaultName: string; + lang: string; + editorMode: string; + editorScope: string; + viewPath: string; + viewDir: string; + configData: string; + relViewPath: string; + isCollated(): boolean; + readonly content: string; + readonly references: any[]; + readonly referencedBy: any[]; + readonly baseHandle: string; + readonly notes: string; + render(context: any, env: any, opts: any): Promise; + getPreviewContext(): Promise; + getPreviewContent(): Promise; + setVariants(variantCollection: variants.VariantCollection): void; + hasTag(tag: string): boolean; + resources(): assets.AssetCollection; + resourcesJSON(): {}; + flatten(): variants.VariantCollection; + component(): this; + variants(): variants.VariantCollection; + static create(config: {}, files: files.FileCollection, resources: assets.AssetCollection, parent: core.entities.Entity): IterableIterator<{} | variants.VariantCollection | Component>; + } + interface ComponentCollection extends core.entities.EntityCollection { + components(): this; + variants(): this; + } + type Collator = (markup: string, item: { handle: string; }) => string; + interface ComponentDefaultConfig { + collated?: boolean; + collator?: Collator; + context?: any; + display?: any; + prefix?: string; + preview?: string; + status?: string; + } + interface ComponentConfig { + path?: string; + ext?: string; + default?: ComponentDefaultConfig; + label?: string; + statuses?: { + [status: string]: core.StatusInfo; + }; + title?: string; + yield?: string; + 'default.collated'?: boolean; + 'default.collator'?: Collator; + 'default.context'?: any; + 'default.display'?: any; + 'default.prefix'?: string; + 'default.preview'?: string; + 'default.status'?: string; + } + interface ComponentSource extends core.entities.EntitySource { + resources(): files.FileCollection; + components(): Component[]; + getReferencesOf(target: { id: string; handle: string; alias: string; }): any[]; + variants(): this; + find(): any; + findFile(filePath: string): files.File | undefined; + resolve(context: any): any; + renderString(str: string, context: any, env: any): Promise; + renderPreview(entity: string | core.entities.Entity, preview?: boolean, env?: any): Promise; + render(entity: string | core.entities.Entity, context: any, env?: any, opts?: {}): Promise; + } + } + namespace docs { + class Doc extends core.entities.Entity { + constructor(config: any, content: string, parent: core.entities.Entity); + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: true; + readonly isFile: undefined; + readonly isVariant: undefined; + readonly isIndex: boolean; + getContent(): Promise; + getContentSync(): string; + render(context: any, env?: any, opts?: any): Promise; + toc(maxDepth?: number): Promise; + static create(config: any, content: string, parent: core.entities.Entity): Doc; + } + interface DocCollection extends core.entities.EntityCollection { + pages(): this; + } + interface DocDefaultConfig { + context?: any; + prefix?: string; + status?: string; + } + interface DocMarkdownConfig { + gfm?: boolean; + tables?: boolean; + breaks?: boolean; + pedantic?: boolean; + sanitize?: boolean; + smartLists?: boolean; + smartypants?: boolean; + } + interface DocConfig { + default?: DocDefaultConfig; + ext?: string; + indexLabel?: string; + label?: string; + markdown?: boolean | DocMarkdownConfig; + path?: string; + statuses?: { + [status: string]: core.StatusInfo; + }; + title?: string; + 'default.context'?: any; + 'default.prefix'?: string; + 'default.status'?: string; + 'markdown.gfm'?: boolean; + 'markdown.tables'?: boolean; + 'markdown.breaks'?: boolean; + 'markdown.pedantic'?: boolean; + 'markdown.sanitize'?: boolean; + 'markdown.smartLists'?: boolean; + 'markdown.smartypants'?: boolean; + } + interface DocSource extends core.entities.EntitySource { + pages(): this; + docs(): this; + resolve(context: any): any; + toc(page: files.File, maxDepth?: number): Promise; + render(page: string | files.File, context?: any, env?: any, opts?: {}): Promise; + renderString(str: string, context: any, env?: any): Promise; + isPage(file: string): boolean; + isTemplate(file: string): boolean; + } + } + namespace files { + interface FileCollection extends core.mixins.Collection { + files(): this; + match(test: string | RegExp | Array): this; + matchItems(items: core.mixins.Collection, test: string | RegExp | Array): File; + toVinylArray(): VinylFile[]; + toVinylStream(): ReadableStream; + gulpify(): ReadableStream; + } + interface File { + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: true; + readonly isVariant: undefined; + id: string; + path: string; + cwd: string; + relPath: string; + base: string; + dir: string; + handle: string; + name: string; + ext: string; + stat: FileStats | null; + lang: string; + editorMode: string; + editorScope: string; + githubColor: string; + isBinary: boolean; + mime: string; + getContext(): any; + readonly contents: Buffer; + readonly isImage: boolean; + getContent(): Promise; + getContentSync(): string; + read(): Promise; + readSync(): string; + toVinyl(): VinylFile; + } + } + namespace variants { + class Variant extends core.entities.Entity { + constructor(config: {}, view: any, resources: assets.AssetCollection, parent: components.Component); + readonly isAsset: undefined; + readonly isComponent: undefined; + readonly isCollection: undefined; + readonly isDoc: undefined; + readonly isFile: true; + readonly isVariant: true; + view: any; + viewPath: string; + viewDir: string; + relViewPath: string; + isDefault: boolean; + lang: string; + editorMode: string; + editorScope: string; + readonly notes: string; + readonly alias: string | null; + readonly siblings: VariantCollection; + readonly content: string; + readonly baseHandle: string; + readonly references: any[]; + readonly referencedBy: any[]; + render(context: any, env?: any, opts?: any): Promise; + getPreviewContext(): Promise; + getPreviewContent(): Promise; + component(): components.Component; + variant(): this; + defaultVariant(): this; + resources(): assets.AssetCollection; + resourcesJSON(): {}; + getContent(): Promise; + getContentSync(): string; + static create(config: {}, view: any, resources: assets.AssetCollection, parent: components.Component): Variant; + } + interface VariantCollection extends core.entities.EntityCollection { + default(): Variant; + getCollatedContent(): Promise; + getCollatedContentSync(): string; + getCOllatedContext(): Promise; + readonly references: any[]; + readonly referencedBy: any[]; + } + } + } + + namespace cli { + class Cli { + console: Console; + notify: Notifier; + has(command: string): boolean; + get(command: string): any; + isInteractive(): boolean; + command( + commandString: string, + callback: (this: Cli & { fractal: Fractal }, args: any, done: () => void) => void, opts?: string | { + description?: string; + options?: string[][]; + }): void; + exec(command: string): void; + log(message: string): void; + error(message: string): void; + } + class Console { + theme: CliTheme; + br(): this; + log(text: string): this; + debug(text: string, data?: any): this; + success(text: string): this; + warn(text: string): this; + update(text: string, type?: string): this; + clear(): this; + persist(): this; + error(err: Error): this; + error(err: string, data: Error): this; + dump(data: any): void; + box(header?: string, body?: string[], footer?: string): this; + write(str: string, type?: string): void; + columns(data: any, options?: any): this; + slog(): this; + unslog(): this; + isSlogging(): boolean; + debugMode(status: boolean): void; + } + class Notifier { + updateAvailable(details: { + current: string; + latest: string; + name: string; + }): void; + versionMismatch(details: { + cli: string; + local: string; + }): void; + } + } + + namespace web { + class Builder extends EventEmitter { + /** + * @deprecated Use start() instead. + */ + build(): Promise<{ errorCount: number; }>; + start(): Promise<{ errorCount: number; }>; + stop(): void; + use(): void; + } + class Server extends EventEmitter { + readonly isSynced: boolean; + readonly port?: number; + readonly ports: { + sync?: number; + server?: number; + }; + readonly url?: string; + readonly urls: { + sync?: { + local?: string; + external?: string; + ui?: string; + }; + server?: string; + }; + start(sync?: boolean): Promise; + stop(): void; + use(mount: string, middleware: any): void; + } + interface WebServerSyncOptions { + open?: boolean; + browser?: string[]; + notify?: boolean; + } + interface WebServerConfig { + sync?: boolean; + syncOptions?: WebServerSyncOptions; + port?: number; + watch?: boolean; + theme?: WebTheme | string; + } + interface WebBuilderUrls { + ext?: string; + } + interface WebBuilderConfig { + concurrency?: number; + dest?: string; + ext?: string; + urls?: WebBuilderUrls; + theme?: WebTheme | string; + } + interface WebStaticConfig { + path?: string; + mount?: string; + } + interface WebConfig { + builder?: WebBuilderConfig; + server?: WebServerConfig; + static?: WebStaticConfig; + 'builder.concurrency'?: number; + 'builder.dest'?: string; + 'builder.ext'?: string; + 'builder.urls'?: WebBuilderUrls; + 'builder.urls.ext'?: string; + 'builder.theme'?: WebTheme | string; + 'server.sync'?: boolean; + 'server.syncOptions'?: WebServerSyncOptions; + 'server.syncOptions.open'?: boolean; + 'server.syncOptions.browser'?: string[]; + 'server.syncOptions.notify'?: boolean; + 'server.port'?: number; + 'server.watch'?: boolean; + 'server.theme'?: WebTheme | string; + 'static.path'?: string; + 'static.mount'?: string; + } + class Web extends core.mixins.ConfigurableEmitter { + server(config?: WebServerConfig): Server; + builder(config?: WebBuilderConfig): Builder; + theme(name: string, instance?: WebTheme): this; + defaultTheme(): WebTheme; + defaultTheme(instance: WebTheme): this; + } + } + + const Fractal: { + new: Fractal; + }; +} + +export interface FractalConfig { + project?: { + title?: string; + version?: string; + author?: string; + }; + 'project.title'?: string; + 'project.version'?: string; + 'project.author'?: string; +} + +export function create(config?: FractalConfig): Fractal; + +export class Fractal extends fractal.core.mixins.ConfigurableEmitter { + constructor(config?: FractalConfig); + readonly components: fractal.api.components.ComponentSource; + readonly docs: fractal.api.docs.DocSource; + readonly assets: fractal.api.assets.AssetSourceCollection; + readonly cli: fractal.cli.Cli; + readonly web: fractal.web.Web; + readonly version: string; + readonly debug: boolean; + + extend(plugin: string | ((this: this, core: any) => void)): this; + + watch(): this; + unwatch(): this; + + load(): Promise; +} + +export interface CliThemeConfig { + delimiter?: { + text?: string; + format?: (str: string) => string; + }; + styles?: { + [key: string]: any; + }; + 'delimiter.text'?: string; + 'delimiter.format'?: (str: string) => string; +} +export class CliTheme extends fractal.core.mixins.ConfigurableEmitter { + constructor(config?: CliThemeConfig); + setDelimiter(text: string, formatter: (str: string) => string): void; + delimiter(): string; + setStyle(name: string, opts: any): void; + style(name: string): any; + format(str: string, style?: string, strip?: boolean): string; +} + +export interface WebThemeOptions { + skin?: string; + panels?: string[]; + rtl: boolean; + lang?: string; + styles?: string[]; + scripts?: string[]; + format?: string; + static?: { + mount?: string; + }; + version?: string; + favicon?: string; + nav?: string[]; + 'static.mount': string; +} +export class WebTheme extends fractal.core.mixins.ConfigurableEmitter { + constructor(viewPaths: string[], options?: WebThemeOptions); + options(): WebThemeOptions; + options(value: WebThemeOptions): this; + setOption(key: K, value: WebThemeOptions[K]): this; + getOption(key: K): WebThemeOptions[K]; + addLoadPath(path: string): this; + loadPaths(): string[]; + setErrorView(view: string): void; + errorView(): string; + setRedirectView(view: string): void; + redirectView(): string; + addStatic(path: string, mount: string): void; + static(): Array<{ path: string; mount: string; }>; + addRoute(path: string, opts: { + handle?: string; + }, resolver?: any): this; + addResolver(handle: string, resolvers: any): this; + routes(): any[]; + resolvers(): any; + matchRoute(urlPath: string): { + route: { + handle: string; + view: string; + }; + params: any; + } | false; + urlFromRoute(handle: string, params: any, noRedirect?: boolean): string | null; +} + +export abstract class Adapter extends EventEmitter { + constructor(engine: TEngine, source: fractal.core.entities.EntitySource); + protected _source: fractal.core.entities.EntitySource; + readonly engine: TEngine; + readonly views: Array<{ + handle: string; + path: string; + content: string; + }>; + setHandlePrefix(prefix: string): this; + load(): void; + getReferencesForView(handle: string): any[]; + getView(handle: string): any; + + protected _resolve(value: PromiseLike | T): Promise; + + abstract render(path: string, str: string, context: any, meta: any): Promise; +} + +export namespace utils { + function lang(filePath: string): { + name: string, + mode: string, + scope: string | null, + color: string | null, + }; + function titlize(str: string): string; + function slugify(str: string): string; + function toJSON(item: any): {}; + function escapeForRegexp(str: string): string; + function parseArgv(): { + command: string; + args: string[]; + opts: any; + }; + function stringify(data: any, indent?: number): string; + function fileExistsSync(path: string): boolean; + function isPromise(value: T | PromiseLike): value is PromiseLike; + function isPromise(value: any): value is PromiseLike; + function md5(str: string): string; + function mergeProp(prop: any, upstream: any): any; + function defaultsDeep(...args: T[]): T; + function relUrlPath(toPath: string, fromPath: string, opts?: any): string; +} + +export namespace core { + type Component = fractal.api.components.Component; + const Component: typeof fractal.api.components.Component; + type Variant = fractal.api.variants.Variant; + const Variant: typeof fractal.api.variants.Variant; + type Doc = fractal.api.docs.Doc; + const Doc: typeof fractal.api.docs.Doc; +} diff --git a/types/frctl__fractal/tsconfig.json b/types/frctl__fractal/tsconfig.json new file mode 100644 index 0000000000..7ef7117640 --- /dev/null +++ b/types/frctl__fractal/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "@frctl/fractal": ["frctl__fractal"] + } + }, + "files": [ + "index.d.ts", + "frctl__fractal-tests.ts" + ] +} diff --git a/types/frctl__fractal/tslint.json b/types/frctl__fractal/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/frctl__fractal/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index a7222b9d5d..c2c12f6d28 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/overlookmotel/fs-extra-promise // Definitions by: midknight41 , Jason Swearingen , Hiromi Shikata // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 153b285ae1..c5eddbf416 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -207,9 +207,9 @@ export function rmdir(path: string | Buffer): Promise; export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function stat(path: string | Buffer): Promise; -export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: fs.symlink.Type | undefined, callback: (err: NodeJS.ErrnoException) => void): void; +export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: FsSymlinkType | undefined, callback: (err: NodeJS.ErrnoException) => void): void; export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; -export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: fs.symlink.Type): Promise; +export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: FsSymlinkType): Promise; export function truncate(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function truncate(path: string | Buffer, len: number, callback: (err: NodeJS.ErrnoException) => void): void; @@ -261,6 +261,7 @@ export type CopyFilterSync = (src: string, dest: string) => boolean; export type CopyFilterAsync = (src: string, dest: string) => Promise; export type SymlinkType = "dir" | "file"; +export type FsSymlinkType = "dir" | "file" | "junction"; export interface CopyOptions { dereference?: boolean; diff --git a/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts b/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts index 97730fe2e5..b5d83d4e9c 100644 --- a/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts +++ b/types/fuzzaldrin-plus/fuzzaldrin-plus-tests.ts @@ -1,4 +1,8 @@ -import * as fz from "fuzzaldrin-plus"; +import * as fz from 'fuzzaldrin-plus' + +// +// Simple use cases +// ---------------------------------------------------------------------- const candidates = [ 'Find And Replace: Select All', @@ -7,14 +11,201 @@ const candidates = [ 'Application: Install Update', 'Install' ] -const objectCandidates = candidates.map(s => ({ foo: s })); +const objectCandidates = candidates.map(s => ({ foo: s })) +const options: fz.IOptions = { allowErrors: true } +const filterOptions: fz.IFilterOptions = { + allowErrors: true, + key: 'foo' +} -fz.filter(candidates, 'install'); -fz.filter(objectCandidates, 'install', { key: 'foo' }); +fz.filter(candidates, 'install') +fz.filter(candidates, 'install', options) +fz.filter(candidates, 'install', filterOptions) +fz.filter(objectCandidates, 'install', { key: 'foo' }) -const prepQuery = fz.prepQuery('install'); -fz.score('Application: Install Update', 'install'); -fz.score('Application: Install Update', 'install', prepQuery); +const preparedQuery: fz.Query = fz.prepareQuery('install') -fz.match('Application: Install Update', 'install'); -fz.match('Application: Install Update', 'install', prepQuery); +fz.score('Maybe', 'me') +fz.score('Maybe', 'me', undefined) +fz.score('Maybe', 'me', null) +fz.score('Maybe', 'me', {}) +fz.score('Maybe', 'me', { allowErrors: true }) +fz.score('Application: Install Update', 'install') +fz.score('Application: Install Update', 'install', { preparedQuery }) + +fz.match('Maybe', 'me') +fz.match('Application: Install Update', 'install') +fz.match('Application: Install Update', 'install', { preparedQuery }) + +fz.wrap('Maybe', 'me') + +// +// Complex filter cases, using all the options +// ---------------------------------------------------------------------- + +fz.filter(['Maybe', 'Me'], 'me') +fz.filter(['Maybe', 'Me'], 'me', undefined) +fz.filter(['Maybe', 'Me'], 'me', null) +fz.filter(['Maybe', 'Me'], 'me', {}) +fz.filter(['Maybe', 'Me'], 'me', { allowErrors: true }) +fz.filter(['Maybe', 'Me'], 'me', { key: 'key' }) +fz.filter(['Maybe', 'Me'], 'me', { + preparedQuery: fz.prepareQuery('me') +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '/' +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp('') +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + } +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10 +}) +fz.filter(['Maybe', 'Me'], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10, + maxInners: 10 +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: true, + usePathScoring: true, + useExtensionBonus: true, + pathSeparator: '\\', + optCharRegEx: new RegExp(''), + wrap: { + tagOpen: '', + tagClass: '', + tagClose: '' + }, + maxResults: 10, + maxInners: 10, + key: 'title' +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: true, + key: 'title' +}) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + key: 'title' +}) + +/** + * ====================================================================== + * Incorrect Usage: + * ====================================================================== + */ + +// $ExpectError +fz.score() +// $ExpectError +fz.match() +// $ExpectError +fz.wrap() +// $ExpectError +fz.prepareQuery() +// $ExpectError +fz.score('Maybe', 'me', true) +// $ExpectError +fz.score('Maybe', 'me', 'string') +// $ExpectError +fz.score('Maybe', 'me', 1) + +const items = ['Maybe', 'Me'] +// $ExpectError +fz.score(items, 'me') +// $ExpectError +fz.score('Maybe', 'me', { unknownProperty: true }) +// $ExpectError +fz.match(items, 'me') +// $ExpectError +fz.wrap(items, 'me') +// $ExpectError +fz.prepareQuery() + +// $ExpectError +const incorrectOptions: fz.IFilterOptions = { allowErrors: 'not a boolean' } + +// $ExpectError +fz.filter(candidates, 'install', { allowErrors: 'not a boolean' }) +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + // $ExpectError + incorrectProperty: true, + key: 'title' +}) + +// $ExpectError +fz.score('Maybe', 'me', undefined, options) +// $ExpectError +fz.match('Maybe', 'me', undefined, options) + +// $ExpectError +fz.filter() +// $ExpectError +fz.filter('not an array', 'query') +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { allowErrors: 'not a boolean' }) +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { key: true }) +// $ExpectError +fz.filter(['Maybe', 'Me'], 'me', { preparedQuery: {} }) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + key: 1 +}) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: 'not a boolean', + key: 1 +}) +// $ExpectError +fz.filter([{ title: 'Maybe' }, { title: 'Me' }], 'me', { + allowErrors: 'not a boolean', + key: 'title' +}) diff --git a/types/fuzzaldrin-plus/index.d.ts b/types/fuzzaldrin-plus/index.d.ts index 34d6949ace..cd52c501d4 100644 --- a/types/fuzzaldrin-plus/index.d.ts +++ b/types/fuzzaldrin-plus/index.d.ts @@ -1,29 +1,39 @@ -// Type definitions for fuzzaldrin-plus +// Type definitions for fuzzaldrin-plus 0.6.0 // Project: https://github.com/jeancroy/fuzzaldrin-plus/ -// Definitions by: Jean Christophe Roy , Jason Killian +// Definitions by: Jean Christophe Roy , +// Jason Killian +// Ronald Rey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 -export as namespace fuzzaldrin; +export as namespace fuzzaldrin -export interface IQueryOptions { - pathSeparator?: string; - optCharRegEx?: RegExp; +export class Query { + $$__internal: Symbol } -export interface IScoringOptions extends IQueryOptions { - allowErrors?: boolean; - isPath?: boolean; - useExtensionBonus?: boolean; +export interface IOptions { + allowErrors?: boolean + usePathScoring?: boolean + useExtensionBonus?: boolean + pathSeparator?: '/' | '\\' | string + optCharRegEx?: RegExp + wrap?: { tagOpen?: string; tagClass?: string; tagClose?: string } + preparedQuery?: Query } -export interface IFilterOptions extends IScoringOptions { - key?: string; - maxResults?: number; +export type IFilterOptions = IOptions & { + key?: string + maxResults?: number + maxInners?: number } -export type PreparedQuery = { __internalAPIBrand: string; }; - -export function filter(data: T[], query: string, options?: IFilterOptions): T[]; -export function score(str: string, query: string, preparedQuery?: PreparedQuery, options?: IScoringOptions): number; -export function match(str: string, query: string, preparedQuery?: PreparedQuery, options?: IScoringOptions): number[]; -export function prepQuery(query: string, options?: IQueryOptions): PreparedQuery; +export function filter( + data: T[], + query: string, + options?: IFilterOptions +): T[] +export function score(str: string, query: string, options?: IOptions): number +export function match(str: string, query: string, options?: IOptions): number[] +export function wrap(str: string, query: string, options?: IOptions): string +export function prepareQuery(query: string, options?: IOptions): Query diff --git a/types/ganache-core/ganache-core-tests.ts b/types/ganache-core/ganache-core-tests.ts new file mode 100644 index 0000000000..c0a6121c34 --- /dev/null +++ b/types/ganache-core/ganache-core-tests.ts @@ -0,0 +1,3 @@ +import { provider } from "ganache-core"; + +provider({ verbose: true }); diff --git a/types/ganache-core/index.d.ts b/types/ganache-core/index.d.ts new file mode 100644 index 0000000000..9297848806 --- /dev/null +++ b/types/ganache-core/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ganache-core 2.1 +// Project: https://github.com/trufflesuite/ganache-core#readme +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Provider } from "ethereum-protocol"; +export interface GanacheOpts { + verbose?: boolean; + logger?: { + log(msg: string): void; + }; + port?: number; + network_id?: number; + networkId?: number; + mnemonic?: string; + gasLimit?: number; +} +export function provider(opts: GanacheOpts): Provider; diff --git a/types/ganache-core/tsconfig.json b/types/ganache-core/tsconfig.json new file mode 100644 index 0000000000..ecbab1915e --- /dev/null +++ b/types/ganache-core/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ganache-core-tests.ts" + ] +} diff --git a/types/ganache-core/tslint.json b/types/ganache-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ganache-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gapi/index.d.ts b/types/gapi/index.d.ts index 38bf7f07b4..7ab0dfd1e6 100644 --- a/types/gapi/index.d.ts +++ b/types/gapi/index.d.ts @@ -247,11 +247,7 @@ declare namespace gapi.client { } interface HttpRequestRejected { - result: { - error: { - message: string; - } - }; + result: any | boolean; body: string; headers?: any[]; status?: number; diff --git a/types/gc-stats/gc-stats-tests.ts b/types/gc-stats/gc-stats-tests.ts new file mode 100644 index 0000000000..bf44e20175 --- /dev/null +++ b/types/gc-stats/gc-stats-tests.ts @@ -0,0 +1,11 @@ +import GCStats = require("gc-stats"); +import { GCStatistics } from "gc-stats"; + +const gcStats = GCStats(); + +gcStats.on("stats", (stats: GCStatistics) => { + const { gctype: gcType, startTime, endTime, before, after, diff } = stats; + const beforeMallocedMemory = before.mallocedMemory; + const afterMallocedMemory = after.mallocedMemory; + const diffMallocedMemory = diff.mallocedMemory; +}); diff --git a/types/gc-stats/index.d.ts b/types/gc-stats/index.d.ts new file mode 100644 index 0000000000..917aedf5b9 --- /dev/null +++ b/types/gc-stats/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for gc-stats 1.2 +// Project: https://github.com/dainis/node-gcstats#readme +// Definitions by: Vitor Fernandes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EventEmitter } from "events"; + +declare namespace GCStats { + interface MemoryStatistics { + totalHeapSize: number; + totalHeapExecutableSize: number; + usedHeapSize: number; + heapSizeLimit: number; + totalPhysicalSize: number; + totalAvailableSize: number; + mallocedMemory: number; + peakMallocedMemory: number; + } + + interface GCStatistics { + startTime: number; + endTime: number; + pause: number; + pauseMS: number; + gctype: 1 | 2 | 4 | 8 | 15; + before: MemoryStatistics; + after: MemoryStatistics; + diff: MemoryStatistics; + } +} + +declare function GCStats(): EventEmitter; + +export = GCStats; diff --git a/types/gc-stats/tsconfig.json b/types/gc-stats/tsconfig.json new file mode 100644 index 0000000000..67fda0ff67 --- /dev/null +++ b/types/gc-stats/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gc-stats-tests.ts" + ] +} diff --git a/types/gc-stats/tslint.json b/types/gc-stats/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gc-stats/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/generic-pool/generic-pool-tests.ts b/types/generic-pool/generic-pool-tests.ts index 9cc8707c86..09a1e611ea 100644 --- a/types/generic-pool/generic-pool-tests.ts +++ b/types/generic-pool/generic-pool-tests.ts @@ -11,8 +11,8 @@ const factory = { resolve(conn); }); }, - destroy: (conn: Connection): Promise => { - return new Promise(resolve => { + destroy: (conn: Connection): Promise => { + return new Promise(resolve => { conn.connected = false; resolve(); }); @@ -41,6 +41,8 @@ const opts = { const pool = genericPool.createPool(factory, opts); +pool.start(); + pool.use((conn: Connection) => 'test') .then((result: string) => { }); @@ -53,7 +55,7 @@ pool.acquire() return pool.destroy(conn); }).then(() => { return pool.clear(); - }).then((results: undefined[]) => { + }).then(() => { }); pool.on('factoryCreateError', (err: Error) => { diff --git a/types/generic-pool/index.d.ts b/types/generic-pool/index.d.ts index bcfbb907e1..e50682ab12 100644 --- a/types/generic-pool/index.d.ts +++ b/types/generic-pool/index.d.ts @@ -17,17 +17,18 @@ export class Pool extends EventEmitter { max: number; min: number; + start(): void; acquire(priority?: number): PromiseLike; release(resource: T): void; destroy(resource: T): void; - drain(): PromiseLike; - clear(): PromiseLike; + drain(): PromiseLike; + clear(): PromiseLike; use(cb: (resource: T) => U): PromiseLike; } export interface Factory { create(): PromiseLike; - destroy(client: T): PromiseLike; + destroy(client: T): PromiseLike; validate?(client: T): PromiseLike; } diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index ac1bf84e99..93f66d3f27 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -80,7 +80,7 @@ export interface GeometryObject extends GeoJsonObject { * Union of geometry objects. * https://tools.ietf.org/html/rfc7946#section-3 */ -export type Geometry = Point | MultiPoint | LineString | Polygon | MultiPolygon | GeometryCollection; +export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection; /** * Point geometry object. diff --git a/types/gestalt/gestalt-tests.tsx b/types/gestalt/gestalt-tests.tsx new file mode 100644 index 0000000000..6445062d1a --- /dev/null +++ b/types/gestalt/gestalt-tests.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; +import { + Avatar, + Box, + Button, + Card, + Checkbox, + Column, + Container, + GroupAvatar, + Icon, + IconButton +} from "gestalt"; + +; +; +